diff --git a/Makefile b/Makefile index ea5751d947a..4a813120468 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ install: done -.PHONY: default doxygen clean realclean distclean install linux-directfb-install +.PHONY: default doxygen clean realclean distclean install # If there's no current configuration file $(TOP)/configs/current: @@ -109,7 +109,6 @@ linux-alpha-static \ linux-cell \ linux-cell-debug \ linux-debug \ -linux-directfb \ linux-dri \ linux-dri-debug \ linux-dri-x86 \ @@ -119,7 +118,6 @@ linux-dri-xcb \ linux-egl \ linux-indirect \ linux-fbdev \ -linux-glide \ linux-ia64-icc \ linux-ia64-icc-static \ linux-icc \ @@ -135,9 +133,6 @@ linux-osmesa32 \ linux-ppc \ linux-ppc-static \ linux-profile \ -linux-solo \ -linux-solo-x86 \ -linux-solo-ia64 \ linux-sparc \ linux-sparc5 \ linux-static \ @@ -150,7 +145,6 @@ linux-x86-64 \ linux-x86-64-debug \ linux-x86-64-profile \ linux-x86-64-static \ -linux-x86-glide \ linux-x86-profile \ linux-x86-static \ netbsd \ @@ -186,7 +180,7 @@ ultrix-gcc: # Rules for making release tarballs -VERSION=7.7 +VERSION=7.9-devel DIRECTORY = Mesa-$(VERSION) LIB_NAME = MesaLib-$(VERSION) DEMO_NAME = MesaDemos-$(VERSION) @@ -211,8 +205,6 @@ MAIN_FILES = \ $(DIRECTORY)/docs/RELNOTES* \ $(DIRECTORY)/docs/*.spec \ $(DIRECTORY)/include/GL/internal/glcore.h \ - $(DIRECTORY)/include/GL/dmesa.h \ - $(DIRECTORY)/include/GL/ggimesa.h \ $(DIRECTORY)/include/GL/gl.h \ $(DIRECTORY)/include/GL/glext.h \ $(DIRECTORY)/include/GL/gl_mangle.h \ @@ -223,16 +215,16 @@ MAIN_FILES = \ $(DIRECTORY)/include/GL/glx_mangle.h \ $(DIRECTORY)/include/GL/glfbdev.h \ $(DIRECTORY)/include/GL/mesa_wgl.h \ - $(DIRECTORY)/include/GL/mglmesa.h \ $(DIRECTORY)/include/GL/osmesa.h \ - $(DIRECTORY)/include/GL/svgamesa.h \ $(DIRECTORY)/include/GL/vms_x_fix.h \ $(DIRECTORY)/include/GL/wglext.h \ $(DIRECTORY)/include/GL/wmesa.h \ + $(DIRECTORY)/include/VG/*.h \ + $(DIRECTORY)/include/KHR/*.h \ $(DIRECTORY)/src/glsl/Makefile \ $(DIRECTORY)/src/glsl/Makefile.template \ + $(DIRECTORY)/src/glsl/SConscript \ $(DIRECTORY)/src/glsl/*/Makefile \ - $(DIRECTORY)/src/glsl/*/SConscript \ $(DIRECTORY)/src/glsl/*/*.[ch] \ $(DIRECTORY)/src/Makefile \ $(DIRECTORY)/src/mesa/Makefile* \ @@ -253,7 +245,6 @@ MAIN_FILES = \ $(DIRECTORY)/src/mesa/shader/slang/descrip.mms \ $(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \ $(DIRECTORY)/src/mesa/shader/slang/library/*.gc \ - $(DIRECTORY)/src/mesa/shader/slang/library/*.syn \ $(DIRECTORY)/src/mesa/shader/slang/library/Makefile \ $(DIRECTORY)/src/mesa/swrast/*.[ch] \ $(DIRECTORY)/src/mesa/swrast/descrip.mms \ @@ -271,25 +262,13 @@ MAIN_FILES = \ $(DIRECTORY)/src/mesa/drivers/beos/Makefile \ $(DIRECTORY)/src/mesa/drivers/common/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/common/descrip.mms \ - $(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \ - $(DIRECTORY)/src/mesa/drivers/directfb/Makefile \ - $(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \ $(DIRECTORY)/src/mesa/drivers/fbdev/Makefile \ $(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \ - $(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \ - $(DIRECTORY)/src/mesa/drivers/ggi/*.[ch] \ - $(DIRECTORY)/src/mesa/drivers/ggi/ggimesa.conf.in \ - $(DIRECTORY)/src/mesa/drivers/ggi/default/*.c \ - $(DIRECTORY)/src/mesa/drivers/ggi/default/genkgi.conf.in \ - $(DIRECTORY)/src/mesa/drivers/ggi/display/*.c \ - $(DIRECTORY)/src/mesa/drivers/ggi/display/fbdev.conf.in \ - $(DIRECTORY)/src/mesa/drivers/ggi/include/ggi/mesa/*.h \ $(DIRECTORY)/src/mesa/drivers/osmesa/Makefile \ $(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win \ $(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \ $(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \ $(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \ - $(DIRECTORY)/src/mesa/drivers/svga/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/windows/*/*.def \ $(DIRECTORY)/src/mesa/drivers/x11/Makefile \ @@ -314,9 +293,9 @@ MAIN_FILES = \ ES_FILES = \ $(DIRECTORY)/include/GLES/*.h \ $(DIRECTORY)/include/GLES2/*.h \ - $(DIRECTORY)/src/mesa/glapi/*.xml \ - $(DIRECTORY)/src/mesa/glapi/*.py \ - $(DIRECTORY)/src/mesa/glapi/*.dtd \ + $(DIRECTORY)/src/mesa/glapi/gen/*.xml \ + $(DIRECTORY)/src/mesa/glapi/gen/*.py \ + $(DIRECTORY)/src/mesa/glapi/gen/*.dtd \ $(DIRECTORY)/src/mesa/es/glapi/Makefile \ $(DIRECTORY)/src/mesa/es/glapi/*.xml \ $(DIRECTORY)/src/mesa/es/glapi/*.py \ @@ -332,6 +311,7 @@ EGL_FILES = \ $(DIRECTORY)/include/EGL/*.h \ $(DIRECTORY)/src/egl/Makefile \ $(DIRECTORY)/src/egl/*/Makefile \ + $(DIRECTORY)/src/egl/*/Makefile.template \ $(DIRECTORY)/src/egl/*/*.[ch] \ $(DIRECTORY)/src/egl/*/*/Makefile \ $(DIRECTORY)/src/egl/*/*/*.[ch] \ @@ -458,11 +438,7 @@ DEMO_FILES = \ $(DIRECTORY)/progs/glsl/*.c \ $(DIRECTORY)/progs/glsl/*.frag \ $(DIRECTORY)/progs/glsl/*.vert \ - $(DIRECTORY)/progs/glsl/*.shtest \ - $(DIRECTORY)/progs/windml/Makefile.ugl \ - $(DIRECTORY)/progs/windml/*.c \ - $(DIRECTORY)/progs/windml/*.bmp \ - $(DIRECTORY)/progs/ggi/*.c + $(DIRECTORY)/progs/glsl/*.shtest GLUT_FILES = \ $(DIRECTORY)/include/GL/glut.h \ @@ -475,17 +451,10 @@ GLUT_FILES = \ $(DIRECTORY)/src/glut/beos/*.[ch] \ $(DIRECTORY)/src/glut/beos/*.cpp \ $(DIRECTORY)/src/glut/beos/Makefile \ - $(DIRECTORY)/src/glut/dos/*.[ch] \ - $(DIRECTORY)/src/glut/dos/PC_HW/*.[chS] \ - $(DIRECTORY)/src/glut/ggi/*.[ch] \ - $(DIRECTORY)/src/glut/ggi/Makefile \ $(DIRECTORY)/src/glut/fbdev/Makefile \ $(DIRECTORY)/src/glut/fbdev/*[ch] \ $(DIRECTORY)/src/glut/mini/*[ch] \ $(DIRECTORY)/src/glut/mini/glut.pc.in \ - $(DIRECTORY)/src/glut/directfb/Makefile \ - $(DIRECTORY)/src/glut/directfb/NOTES \ - $(DIRECTORY)/src/glut/directfb/*[ch] DEPEND_FILES = \ $(TOP)/src/mesa/depend \ diff --git a/SConstruct b/SConstruct index ea63b90f46f..6ed44ddd067 100644 --- a/SConstruct +++ b/SConstruct @@ -110,12 +110,19 @@ Export([ ####################################################################### # Environment setup +# Always build trace and identity drivers +if 'trace' not in env['drivers']: + env['drivers'].append('trace') +if 'identity' not in env['drivers']: + env['drivers'].append('identity') + # Includes env.Append(CPPPATH = [ '#/include', '#/src/gallium/include', '#/src/gallium/auxiliary', '#/src/gallium/drivers', + '#/src/gallium/winsys', ]) if env['msvc']: diff --git a/bin/mklib b/bin/mklib index 9e6e46de8b9..08ef99ec105 100755 --- a/bin/mklib +++ b/bin/mklib @@ -25,8 +25,14 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# Clear CDPATH as the 'cd' command will echo stuff +# to stdout if it is set +unset CDPATH + # Given a list of files, look for .a archives and unpack them. # Return the original list of files minus the .a files plus the unpacked files. +# first param: name of a temp directory (to be deleted when finished) +# remaining params: list of .o and .a files expand_archives() { DIR=$1 shift @@ -60,27 +66,6 @@ expand_archives() { } -# Given a list of files, look for .a archives and return a list of all objects -# in the .a archives. -contents_of_archives() { - FILES=$@ - NEWFILES="" - for FILE in $FILES ; do - case $FILE in - *.a) - # get list of members in this .a archive - MEMBERS=`ar t $FILE` - NEWFILES="$NEWFILES $MEMBERS" - ;; - *) - # skip other file types - ;; - esac - done - echo $NEWFILES -} - - # Make static library with 'ar' # params: # options to ar @@ -758,12 +743,20 @@ case $ARCH in if [ $STATIC = 1 ] ; then LIBNAME="lib${LIBNAME}.a" echo "mklib: Making Darwin static library: " ${LIBNAME} - LINK="ar" OPTS="-ruvs" if [ "${ALTOPTS}" ] ; then OPTS=${ALTOPTS} fi - ${LINK} ${OPTS} ${LIBNAME} ${OBJECTS} + + # expand .a into .o files + NEW_OBJECTS=`expand_archives ${LIBNAME}.obj $OBJECTS` + + # make static lib + FINAL_LIBS=`make_ar_static_lib ${OPTS} 1 ${LIBNAME} ${NEW_OBJECTS}` + + # remove temporary extracted .o files + rm -rf ${LIBNAME}.obj + FINAL_LIBS=${LIBNAME} else # On Darwin a .bundle is used for a library that you want to dlopen @@ -955,7 +948,14 @@ case $ARCH in if [ "${ALTOPTS}" ] ; then OPTS=${ALTOPTS} fi - FINAL_LIBS=`make_ar_static_lib ${OPTS} 1 ${LIBNAME} ${OBJECTS}` + + # expand .a into .o files + NEW_OBJECTS=`expand_archives ${LIBNAME}.obj $OBJECTS` + + FINAL_LIBS=`make_ar_static_lib ${OPTS} 1 ${LIBNAME} ${NEW_OBJECTS}` + + # remove temporary extracted .o files + rm -rf ${LIBNAME}.obj else OPTS="-shared -Wl,--enable-auto-image-base -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a" if [ "${ALTOPTS}" ] ; then @@ -977,6 +977,11 @@ case $ARCH in # make lib ${LINK} ${OPTS} ${LDFLAGS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS} + # make build fail if link failed + es=$? + if [ "$es" -ne "0" ]; then + exit $es + fi # make usual symlinks ln -s ${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a # finish up diff --git a/bin/raw2png.py b/bin/raw2png.py deleted file mode 100755 index f01e7990a13..00000000000 --- a/bin/raw2png.py +++ /dev/null @@ -1,366 +0,0 @@ -#!/usr/bin/env python -########################################################################## -# -# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sub license, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice (including the -# next paragraph) shall be included in all copies or substantial portions -# of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR -# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -########################################################################## - - -import os.path -import sys -import struct -import Image # http://www.pythonware.com/products/pil/ - -PIPE_FORMAT_LAYOUT_RGBAZS = 0 -PIPE_FORMAT_LAYOUT_YCBCR = 1 -PIPE_FORMAT_LAYOUT_DXT = 2 -PIPE_FORMAT_LAYOUT_MIXED = 3 - -PIPE_FORMAT_COMP_R = 0 -PIPE_FORMAT_COMP_G = 1 -PIPE_FORMAT_COMP_B = 2 -PIPE_FORMAT_COMP_A = 3 -PIPE_FORMAT_COMP_0 = 4 -PIPE_FORMAT_COMP_1 = 5 -PIPE_FORMAT_COMP_Z = 6 -PIPE_FORMAT_COMP_S = 7 - -PIPE_FORMAT_TYPE_UNKNOWN = 0 -PIPE_FORMAT_TYPE_FLOAT = 1 -PIPE_FORMAT_TYPE_UNORM = 2 -PIPE_FORMAT_TYPE_SNORM = 3 -PIPE_FORMAT_TYPE_USCALED = 4 -PIPE_FORMAT_TYPE_SSCALED = 5 -PIPE_FORMAT_TYPE_SRGB = 6 -PIPE_FORMAT_TYPE_FIXED = 7 - -def _PIPE_FORMAT_RGBAZS( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, EXP2, TYPE ): - return ((PIPE_FORMAT_LAYOUT_RGBAZS << 0) |\ - ((SWZ) << 2) |\ - ((SIZEX) << 14) |\ - ((SIZEY) << 17) |\ - ((SIZEZ) << 20) |\ - ((SIZEW) << 23) |\ - ((EXP2) << 26) |\ - ((TYPE) << 29) ) - -def _PIPE_FORMAT_SWZ( SWZX, SWZY, SWZZ, SWZW ): - return (((SWZX) << 0) | ((SWZY) << 3) | ((SWZZ) << 6) | ((SWZW) << 9)) - -def _PIPE_FORMAT_RGBAZS_1( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, TYPE ): - return _PIPE_FORMAT_RGBAZS( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, 0, TYPE ) - -def _PIPE_FORMAT_RGBAZS_2( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, TYPE ): - _PIPE_FORMAT_RGBAZS( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, 1, TYPE ) - -def _PIPE_FORMAT_RGBAZS_8( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, TYPE ): - return _PIPE_FORMAT_RGBAZS( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, 3, TYPE ) - -def _PIPE_FORMAT_RGBAZS_64( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, TYPE ): - return _PIPE_FORMAT_RGBAZS( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, 6, TYPE ) - -def _PIPE_FORMAT_MIXED( SWZ, SIZEX, SIZEY, SIZEZ, SIZEW, SIGNX, SIGNY, SIGNZ, SIGNW, NORMALIZED, SCALE8 ): - return ((PIPE_FORMAT_LAYOUT_MIXED << 0) |\ - ((SWZ) << 2) |\ - ((SIZEX) << 14) |\ - ((SIZEY) << 17) |\ - ((SIZEZ) << 20) |\ - ((SIZEW) << 23) |\ - ((SIGNX) << 26) |\ - ((SIGNY) << 27) |\ - ((SIGNZ) << 28) |\ - ((SIGNW) << 29) |\ - ((NORMALIZED) << 30) |\ - ((SCALE8) << 31) ) - - -_PIPE_FORMAT_R001 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_1 ) -_PIPE_FORMAT_RG01 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_1 ) -_PIPE_FORMAT_RGB1 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_B, PIPE_FORMAT_COMP_1 ) -_PIPE_FORMAT_RGBA = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_B, PIPE_FORMAT_COMP_A ) -_PIPE_FORMAT_ARGB = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_A, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_B ) -_PIPE_FORMAT_ABGR = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_A, PIPE_FORMAT_COMP_B, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_R ) -_PIPE_FORMAT_BGRA = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_B, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_A ) -_PIPE_FORMAT_1RGB = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_1, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_B ) -_PIPE_FORMAT_1BGR = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_1, PIPE_FORMAT_COMP_B, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_R ) -_PIPE_FORMAT_BGR1 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_B, PIPE_FORMAT_COMP_G, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_1 ) -_PIPE_FORMAT_0000 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0 ) -_PIPE_FORMAT_000R = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_R ) -_PIPE_FORMAT_RRR1 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_1 ) -_PIPE_FORMAT_RRRR = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R ) -_PIPE_FORMAT_RRRG = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_R, PIPE_FORMAT_COMP_G ) -_PIPE_FORMAT_Z000 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_Z, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0 ) -_PIPE_FORMAT_0Z00 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_Z, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0 ) -_PIPE_FORMAT_SZ00 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_S, PIPE_FORMAT_COMP_Z, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0 ) -_PIPE_FORMAT_ZS00 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_Z, PIPE_FORMAT_COMP_S, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0 ) -_PIPE_FORMAT_S000 = _PIPE_FORMAT_SWZ( PIPE_FORMAT_COMP_S, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0, PIPE_FORMAT_COMP_0 ) - -def _PIPE_FORMAT_YCBCR( REV ): - return ((PIPE_FORMAT_LAYOUT_YCBCR << 0) |\ - ((REV) << 2) ) - -def _PIPE_FORMAT_DXT( LEVEL, RSIZE, GSIZE, BSIZE, ASIZE ): - return ((PIPE_FORMAT_LAYOUT_DXT << 0) | \ - ((LEVEL) << 2) | \ - ((RSIZE) << 5) | \ - ((GSIZE) << 8) | \ - ((BSIZE) << 11) | \ - ((ASIZE) << 14) ) - -PIPE_FORMAT_NONE = _PIPE_FORMAT_RGBAZS_1 ( _PIPE_FORMAT_0000, 0, 0, 0, 0, PIPE_FORMAT_TYPE_UNKNOWN ) -PIPE_FORMAT_A8R8G8B8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_ARGB, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_X8R8G8B8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_1RGB, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_B8G8R8A8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_BGRA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_B8G8R8X8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_BGR1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_A1R5G5B5_UNORM = _PIPE_FORMAT_RGBAZS_1 ( _PIPE_FORMAT_ARGB, 1, 5, 5, 5, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_A4R4G4B4_UNORM = _PIPE_FORMAT_RGBAZS_1 ( _PIPE_FORMAT_ARGB, 4, 4, 4, 4, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R5G6B5_UNORM = _PIPE_FORMAT_RGBAZS_1 ( _PIPE_FORMAT_RGB1, 5, 6, 5, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_A2B10G10R10_UNORM = _PIPE_FORMAT_RGBAZS_2 ( _PIPE_FORMAT_ABGR, 1, 5, 5, 5, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_L8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RRR1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_A8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_000R, 0, 0, 0, 1, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_I8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RRRR, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_A8L8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RRRG, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_L16_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RRR1, 2, 2, 2, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_YCBCR = _PIPE_FORMAT_YCBCR( 0 ) -PIPE_FORMAT_YCBCR_REV = _PIPE_FORMAT_YCBCR( 1 ) -PIPE_FORMAT_Z16_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_Z000, 2, 0, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_Z32_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_Z000, 4, 0, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_Z32_FLOAT = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_Z000, 4, 0, 0, 0, PIPE_FORMAT_TYPE_FLOAT ) -PIPE_FORMAT_S8Z24_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_SZ00, 1, 3, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_Z24S8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_ZS00, 3, 1, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_X8Z24_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_0Z00, 1, 3, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_Z24X8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_Z000, 3, 1, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_S8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_S000, 1, 0, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R64_FLOAT = _PIPE_FORMAT_RGBAZS_64( _PIPE_FORMAT_R001, 1, 0, 0, 0, PIPE_FORMAT_TYPE_FLOAT ) -PIPE_FORMAT_R64G64_FLOAT = _PIPE_FORMAT_RGBAZS_64( _PIPE_FORMAT_RG01, 1, 1, 0, 0, PIPE_FORMAT_TYPE_FLOAT ) -PIPE_FORMAT_R64G64B64_FLOAT = _PIPE_FORMAT_RGBAZS_64( _PIPE_FORMAT_RGB1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_FLOAT ) -PIPE_FORMAT_R64G64B64A64_FLOAT = _PIPE_FORMAT_RGBAZS_64( _PIPE_FORMAT_RGBA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_FLOAT ) -PIPE_FORMAT_R32_FLOAT = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 4, 0, 0, 0, PIPE_FORMAT_TYPE_FLOAT ) -PIPE_FORMAT_R32G32_FLOAT = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 4, 4, 0, 0, PIPE_FORMAT_TYPE_FLOAT ) -PIPE_FORMAT_R32G32B32_FLOAT = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 4, 4, 4, 0, PIPE_FORMAT_TYPE_FLOAT ) -PIPE_FORMAT_R32G32B32A32_FLOAT = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 4, 4, 4, 4, PIPE_FORMAT_TYPE_FLOAT ) -PIPE_FORMAT_R32_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 4, 0, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R32G32_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 4, 4, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R32G32B32_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 4, 4, 4, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R32G32B32A32_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 4, 4, 4, 4, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R32_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 4, 0, 0, 0, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R32G32_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 4, 4, 0, 0, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R32G32B32_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 4, 4, 4, 0, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R32G32B32A32_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 4, 4, 4, 4, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R32_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 4, 0, 0, 0, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R32G32_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 4, 4, 0, 0, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R32G32B32_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 4, 4, 4, 0, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R32G32B32A32_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 4, 4, 4, 4, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R32_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 4, 0, 0, 0, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R32G32_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 4, 4, 0, 0, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R32G32B32_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 4, 4, 4, 0, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R32G32B32A32_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 4, 4, 4, 4, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R16_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 2, 0, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R16G16_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 2, 2, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R16G16B16_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 2, 2, 2, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R16G16B16A16_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 2, 2, 2, 2, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R16_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 2, 0, 0, 0, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R16G16_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 2, 2, 0, 0, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R16G16B16_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 2, 2, 2, 0, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R16G16B16A16_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 2, 2, 2, 2, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R16_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 2, 0, 0, 0, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R16G16_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 2, 2, 0, 0, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R16G16B16_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 2, 2, 2, 0, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R16G16B16A16_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 2, 2, 2, 2, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R16_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 2, 0, 0, 0, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R16G16_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 2, 2, 0, 0, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R16G16B16_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 2, 2, 2, 0, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R16G16B16A16_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 2, 2, 2, 2, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 1, 0, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R8G8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 1, 1, 0, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R8G8B8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R8G8B8A8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R8G8B8X8_UNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_UNORM ) -PIPE_FORMAT_R8_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 1, 0, 0, 0, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R8G8_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 1, 1, 0, 0, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R8G8B8_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R8G8B8A8_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R8G8B8X8_USCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_USCALED ) -PIPE_FORMAT_R8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 1, 0, 0, 0, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R8G8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 1, 1, 0, 0, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R8G8B8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R8G8B8A8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R8G8B8X8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_B6G5R5_SNORM = _PIPE_FORMAT_RGBAZS_1 ( _PIPE_FORMAT_BGR1, 6, 5, 5, 0, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_A8B8G8R8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_BGRA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_X8B8G8R8_SNORM = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SNORM ) -PIPE_FORMAT_R8_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 1, 0, 0, 0, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R8G8_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 1, 1, 0, 0, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R8G8B8_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R8G8B8A8_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R8G8B8X8_SSCALED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SSCALED ) -PIPE_FORMAT_R32_FIXED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_R001, 4, 0, 0, 0, PIPE_FORMAT_TYPE_FIXED ) -PIPE_FORMAT_R32G32_FIXED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RG01, 4, 4, 0, 0, PIPE_FORMAT_TYPE_FIXED ) -PIPE_FORMAT_R32G32B32_FIXED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 4, 4, 4, 0, PIPE_FORMAT_TYPE_FIXED ) -PIPE_FORMAT_R32G32B32A32_FIXED = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 4, 4, 4, 4, PIPE_FORMAT_TYPE_FIXED ) -PIPE_FORMAT_L8_SRGB = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RRR1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_SRGB ) -PIPE_FORMAT_A8_L8_SRGB = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RRRG, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SRGB ) -PIPE_FORMAT_R8G8B8_SRGB = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 0, PIPE_FORMAT_TYPE_SRGB ) -PIPE_FORMAT_R8G8B8A8_SRGB = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGBA, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SRGB ) -PIPE_FORMAT_R8G8B8X8_SRGB = _PIPE_FORMAT_RGBAZS_8 ( _PIPE_FORMAT_RGB1, 1, 1, 1, 1, PIPE_FORMAT_TYPE_SRGB ) -PIPE_FORMAT_X8UB8UG8SR8S_NORM = _PIPE_FORMAT_MIXED( _PIPE_FORMAT_1BGR, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1 ) -PIPE_FORMAT_B6UG5SR5S_NORM = _PIPE_FORMAT_MIXED( _PIPE_FORMAT_BGR1, 6, 5, 5, 0, 0, 1, 1, 0, 1, 0 ) -PIPE_FORMAT_DXT1_RGB = _PIPE_FORMAT_DXT( 1, 8, 8, 8, 0 ) -PIPE_FORMAT_DXT1_RGBA = _PIPE_FORMAT_DXT( 1, 8, 8, 8, 8 ) -PIPE_FORMAT_DXT3_RGBA = _PIPE_FORMAT_DXT( 3, 8, 8, 8, 8 ) -PIPE_FORMAT_DXT5_RGBA = _PIPE_FORMAT_DXT( 5, 8, 8, 8, 8 ) - - -formats = {} -for name, value in globals().items(): - if name.startswith("PIPE_FORMAT_") and isinstance(value, int): - formats[value] = name - - -def clip(g): - return min(max(g, 0), 255) - - -def yuv2rgb(y, u, v): - C = y - 16 - D = u - 128 - E = v - 128 - - r = clip(( 298 * C + 409 * E + 128) >> 8) - g = clip(( 298 * C - 100 * D - 208 * E + 128) >> 8) - b = clip(( 298 * C + 516 * D + 128) >> 8) - - return r, g, b - - -def translate_r5g6b5(data): - value, = struct.unpack_from("H", data) - r = ((value >> 11) & 0x1f)*0xff/0x1f - g = ((value >> 5) & 0x3f)*0xff/0x3f - b = ((value >> 0) & 0x1f)*0xff/0x1f - a = 255 - return [[(r, g, b, a)]] - -def translate_a8r8g8b8(data): - b, g, r, a = struct.unpack_from("BBBB", data) - return [[(r, g, b, a)]] - - -def translate_x8r8g8b8(data): - b, g, r, x = struct.unpack_from("BBBB", data) - a = 255 - return [[(r, g, b, a)]] - -def translate_r8g8b8a8(data): - r, g, b, a = struct.unpack_from("BBBB", data) - return [[(r, g, b, a)]] - -def translate_ycbcr(data): - y1, u, y2, v = struct.unpack_from("BBBB", data) - r1, g1, b1 = yuv2rgb(y1, u, v) - r2, g2, b2 = yuv2rgb(y1, u, v) - return [[(r1, g1, b1, 255), (r2, g2, b2, 255)]] - -def translate_ycbcr_rev(data): - v, y2, u, y1 = struct.unpack_from("BBBB", data) - r1, g1, b1 = yuv2rgb(y1, u, v) - r2, g2, b2 = yuv2rgb(y1, u, v) - return [[(r1, g1, b1, 255), (r2, g2, b2, 255)]] - -def translate_x8z24(data): - value, = struct.unpack_from("I", data) - r = g = b = (value & 0xffffff)*0xff/0xffffff - a = 255 - return [[(r, g, b, a)]] - -def translate_s8z24(data): - value, = struct.unpack_from("I", data) - r = (value & 0xffffff)*0xff/0xffffff - g = value >> 24 - b = 0 - a = 255 - return [[(r, g, b, a)]] - - -translate = { - PIPE_FORMAT_A8R8G8B8_UNORM: (4, 1, 1, translate_a8r8g8b8), - PIPE_FORMAT_X8R8G8B8_UNORM: (4, 1, 1, translate_x8r8g8b8), - PIPE_FORMAT_B8G8R8A8_UNORM: (4, 1, 1, translate_r8g8b8a8), - PIPE_FORMAT_B8G8R8X8_UNORM: (4, 1, 1, translate_r8g8b8a8), - PIPE_FORMAT_A8B8G8R8_SNORM: (4, 1, 1, translate_r8g8b8a8), - PIPE_FORMAT_R5G6B5_UNORM: (2, 1, 1, translate_r5g6b5), - PIPE_FORMAT_YCBCR: (4, 2, 1, translate_ycbcr), - PIPE_FORMAT_YCBCR_REV: (4, 2, 1, translate_ycbcr_rev), - PIPE_FORMAT_S8Z24_UNORM: (4, 1, 1, translate_s8z24), - PIPE_FORMAT_X8Z24_UNORM: (4, 1, 1, translate_x8z24), -} - -def read_header(infile): - header_fmt = "IIII" - header = infile.read(struct.calcsize(header_fmt)) - return struct.unpack_from(header_fmt, header) - -def process(infilename, outfilename): - sys.stderr.write("%s -> %s\n" % (infilename, outfilename)) - infile = open(infilename, "rb") - format, cpp, width, height = read_header(infile) - sys.stderr.write(" %ux%ux%ubpp %s\n" % (width, height, cpp*8, formats[format])) - outimage = Image.new( - mode='RGB', - size=(width, height), - color=(0,0,0)) - outpixels = outimage.load() - try: - bsize, bwidth, bheight, translate_func = translate[format] - except KeyError: - sys.stderr.write('error: unsupported format %s\n' % formats[format]) - return - for y in range(0, height, bheight): - for x in range(0, width, bwidth): - indata = infile.read(bsize) - outdata = translate_func(indata) - for j in range(bheight): - for i in range(bwidth): - r, g, b, a = outdata[j][i] - outpixels[x+i, y+j] = r, g, b - outimage.save(outfilename, "PNG") - - -def main(): - if sys.platform == 'win32': - # wildcard expansion - from glob import glob - args = [] - for arg in sys.argv[1:]: - args.extend(glob(arg)) - else: - args = sys.argv[1:] - for infilename in args: - root, ext = os.path.splitext(infilename) - outfilename = root + ".png" - process(infilename, outfilename) - - -if __name__ == '__main__': - main() diff --git a/configs/autoconf.in b/configs/autoconf.in index 30637877f3b..bf34f3bffad 100644 --- a/configs/autoconf.in +++ b/configs/autoconf.in @@ -73,6 +73,7 @@ EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@ GALLIUM_DIRS = @GALLIUM_DIRS@ GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@ GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@ +GALLIUM_TARGET_DIRS = @GALLIUM_TARGET_DIRS@ GALLIUM_WINSYS_DRM_DIRS = @GALLIUM_WINSYS_DRM_DIRS@ GALLIUM_STATE_TRACKERS_DIRS = @GALLIUM_STATE_TRACKERS_DIRS@ GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a @@ -83,7 +84,6 @@ PROGRAM_DIRS = @PROGRAM_DIRS@ # Driver specific build vars DRI_DIRS = @DRI_DIRS@ -WINDOW_SYSTEM = @WINDOW_SYSTEM@ EGL_DISPLAYS = @EGL_DISPLAYS@ # Dependencies diff --git a/configs/default b/configs/default index ad6d93c92ff..a6a92efe8fb 100644 --- a/configs/default +++ b/configs/default @@ -9,7 +9,7 @@ CONFIG_NAME = default # Version info MESA_MAJOR=7 -MESA_MINOR=8 +MESA_MINOR=9 MESA_TINY=0 MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY) @@ -86,7 +86,7 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2 # Directories to build LIB_DIR = lib -SRC_DIRS = glsl mesa gallium egl gallium/winsys glu glut/glx glew glw +SRC_DIRS = glsl mesa gallium egl gallium/winsys gallium/targets glu glut/glx glew glw GLU_DIRS = sgi DRIVER_DIRS = x11 osmesa # Which subdirs under $(TOP)/progs/ to enter: @@ -100,7 +100,8 @@ GALLIUM_DIRS = auxiliary drivers state_trackers GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a GALLIUM_DRIVERS_DIRS = softpipe failover svga i915 i965 r300 trace identity GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a) -GALLIUM_WINSYS_DIRS = drm xlib +GALLIUM_WINSYS_DIRS = drm null xlib +GALLIUM_TARGET_DIRS = libgl-xlib GALLIUM_WINSYS_DRM_DIRS = swrast GALLIUM_STATE_TRACKERS_DIRS = glx vega diff --git a/configs/freebsd-dri b/configs/freebsd-dri index da63e3b78c5..2c697e1c6e4 100644 --- a/configs/freebsd-dri +++ b/configs/freebsd-dri @@ -44,12 +44,9 @@ GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGL -lXt -lX11 SRC_DIRS = glx gallium mesa glu glut/glx glew glw DRIVER_DIRS = dri PROGRAM_DIRS = -WINDOW_SYSTEM=dri DRM_SOURCE_PATH=$(TOP)/../drm -# ffb and gamma are missing because they have not been converted to use the new -# interface. DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \ unichrome savage sis diff --git a/configs/linux-cell b/configs/linux-cell index e89a08cd934..306b9e01f47 100644 --- a/configs/linux-cell +++ b/configs/linux-cell @@ -37,7 +37,7 @@ CXXFLAGS = $(COMMON_C_CPP_FLAGS) # Omitting glw here: -SRC_DIRS = glsl mesa gallium gallium/winsys glu glut/glx glew +SRC_DIRS = glsl mesa gallium gallium/winsys gallium/targets glu glut/glx glew # Build no traditional Mesa drivers: DRIVER_DIRS = diff --git a/configs/linux-directfb b/configs/linux-directfb deleted file mode 100644 index 9ae3de96d1c..00000000000 --- a/configs/linux-directfb +++ /dev/null @@ -1,38 +0,0 @@ -# Configuration for DirectFB - -include $(TOP)/configs/default - -CONFIG_NAME = linux-directfb - -# Compiler and flags -CC = gcc -CXX = g++ - -CFLAGS = -Wall -O3 -ffast-math -fPIC -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE -D_SVID_SOURCE \ - -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DPTHREADS - -CXXFLAGS = -Wall -O3 -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - -# Work around aliasing bugs - developers should comment this out -CFLAGS += -fno-strict-aliasing -CXXFLAGS += -fno-strict-aliasing - -HAVE_X86 = $(shell uname -m | grep 'i[3-6]86' >/dev/null && echo yes) -ifeq ($(HAVE_X86), yes) - CFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM - CXXFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM - MESA_ASM_SOURCES = $(X86_SOURCES) - GLAPI_ASM_SOURCES = $(X86_API) -endif - -# Directories -SRC_DIRS = gallium mesa glu glut/directfb glew -GLU_DIRS = sgi -DRIVER_DIRS = directfb -PROGRAM_DIRS = demos directfb - -# Library/program dependencies -GL_LIB_DEPS = -lm -lpthread -GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLU_LIB) -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLU_LIB) -l$(GLUT_LIB) - diff --git a/configs/linux-dri b/configs/linux-dri index 634546c64ca..04bcfd859d1 100644 --- a/configs/linux-dri +++ b/configs/linux-dri @@ -58,13 +58,13 @@ PROGRAM_DIRS := egl $(PROGRAM_DIRS) EGL_DRIVERS_DIRS = glx DRIVER_DIRS = dri -WINDOW_SYSTEM = dri GALLIUM_WINSYS_DIRS = drm +GALLIUM_TARGET_DIRS = GALLIUM_WINSYS_DRM_DIRS = vmware intel i965 GALLIUM_STATE_TRACKERS_DIRS = egl DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon \ - savage sis tdfx unichrome ffb swrast + savage sis tdfx unichrome swrast INTEL_LIBS = `pkg-config --libs libdrm_intel` INTEL_CFLAGS = `pkg-config --cflags libdrm_intel` diff --git a/configs/linux-dri-x86-64 b/configs/linux-dri-x86-64 index ceab05d5db4..656cf6140d7 100644 --- a/configs/linux-dri-x86-64 +++ b/configs/linux-dri-x86-64 @@ -16,7 +16,7 @@ LIB_DIR = lib64 # Library/program dependencies EXTRA_LIB_PATH=-L/usr/X11R6/lib64 -# ffb, gamma, and sis are missing because they have not be converted to use +# sis is missing because it has not been converted to use # the new interface. i810 are missing because there is no x86-64 # system where they could *ever* be used. # diff --git a/configs/linux-dri-xcb b/configs/linux-dri-xcb index 691f8e4918c..1ed980aa36e 100644 --- a/configs/linux-dri-xcb +++ b/configs/linux-dri-xcb @@ -51,9 +51,5 @@ SRC_DIRS = glx gallium mesa glu glut/glx glew glw PROGRAM_DIRS = xdemos DRIVER_DIRS = dri -WINDOW_SYSTEM=dri - -# gamma are missing because they have not been converted to use the new -# interface. DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon \ - savage sis tdfx unichrome ffb + savage sis tdfx unichrome diff --git a/configs/linux-egl b/configs/linux-egl index 6494a68aeb1..28165ed5b5a 100644 --- a/configs/linux-egl +++ b/configs/linux-egl @@ -47,13 +47,11 @@ GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \ # Directories -SRC_DIRS = gallium mesa gallium/winsys glu egl +SRC_DIRS = gallium mesa gallium/winsys gallium/targets glu egl PROGRAM_DIRS = egl DRIVER_DIRS = dri -WINDOW_SYSTEM = dri GALLIUM_WINSYS_DIRS = egl_drm +GALLIUM_TARGET_DIRS = -# gamma are missing because they have not been converted to use the new -# interface. DRI_DIRS = intel diff --git a/configs/linux-glide b/configs/linux-glide deleted file mode 100644 index 31475c81d84..00000000000 --- a/configs/linux-glide +++ /dev/null @@ -1,23 +0,0 @@ -# Configuration for generic Linux with 3Dfx Glide driver - -include $(TOP)/configs/default - -CONFIG_NAME = linux-glide - -# Compiler and flags -CC = gcc -CXX = g++ - -CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DFX -I/usr/include/glide -I/usr/local/glide/include -CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -GLUT_CFLAGS = -fexceptions - -# Work around aliasing bugs - developers should comment this out -CFLAGS += -fno-strict-aliasing -CXXFLAGS += -fno-strict-aliasing - -# Library/program dependencies -GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -L/usr/local/glide/lib -lglide3x -lm -lpthread -GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11 -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/local/glide/lib -lglide3x -lm diff --git a/configs/linux-i965 b/configs/linux-i965 index e66abc347bb..7656a2adc5e 100644 --- a/configs/linux-i965 +++ b/configs/linux-i965 @@ -6,3 +6,4 @@ CONFIG_NAME = linux-i965 GALLIUM_DRIVER_DIRS = i965 GALLIUM_WINSYS_DIRS = drm/i965/xlib +GALLIUM_TARGET_DIRS = diff --git a/configs/linux-indirect b/configs/linux-indirect index 0914fba19bc..1c7dd857db6 100644 --- a/configs/linux-indirect +++ b/configs/linux-indirect @@ -50,4 +50,3 @@ GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl SRC_DIRS = glx glu glut/glx glew glw DRIVER_DIRS = PROGRAM_DIRS = -WINDOW_SYSTEM=dri diff --git a/configs/linux-opengl-es b/configs/linux-opengl-es index 259c26a931b..76054aad14e 100644 --- a/configs/linux-opengl-es +++ b/configs/linux-opengl-es @@ -6,7 +6,7 @@ CONFIG_NAME = linux-opengl-es # Directories to build LIB_DIR = lib -SRC_DIRS = egl glsl mesa/es gallium gallium/winsys +SRC_DIRS = egl glsl mesa/es gallium gallium/winsys gallium/targets PROGRAM_DIRS = es1/screen es1/xegl es2/xegl # egl st needs this diff --git a/configs/linux-solo b/configs/linux-solo deleted file mode 100644 index 247a2d489ab..00000000000 --- a/configs/linux-solo +++ /dev/null @@ -1,54 +0,0 @@ -# Configuration for linux-solo: Linux DRI hardware drivers for fbdev - -include $(TOP)/configs/default - -CONFIG_NAME = linux-solo - -# Compiler and flags -CC = gcc -CXX = g++ - -WARN_FLAGS = -Wall -Wundef -OPT_FLAGS = -O3 -g -PIC_FLAGS = -fPIC - -# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. -ARCH_FLAGS ?= - -# DRM and pciaccess -LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm) -LIBDRM_LIB = $(shell pkg-config --libs libdrm) -PCIACCESS_CFLAGS = $(shell pkg-config --cflags pciaccess) -PCIACCESS_LIB = $(shell pkg-config --libs pciaccess) - - -DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ - -D_BSD_SOURCE -D_GNU_SOURCE -DHAVE_POSIX_MEMALIGN \ - -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \ - -DHAVE_ALIAS - -CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ - $(ASM_FLAGS) -std=c99 -ffast-math - -CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) - -# Work around aliasing bugs - developers should comment this out -CFLAGS += -fno-strict-aliasing -CXXFLAGS += -fno-strict-aliasing - -MESA_ASM_SOURCES = - -# Library/program dependencies -DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(TOP)/$(LIB_DIR) $(PCIACCESS_LIB) -GL_LIB_DEPS = -lm -lpthread -ldl -GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread - -# Directories -SRC_DIRS = glx/mini gallium mesa glu glut/mini glew -DRIVER_DIRS = dri -PROGRAM_DIRS = miniglx - -#DRI_DIRS = ffb gamma sis savage tdfx unichrome fb -DRI_DIRS = i810 i915tex i915 mach64 mga r128 r200 radeon diff --git a/configs/linux-solo-ia64 b/configs/linux-solo-ia64 deleted file mode 100644 index b2051fac855..00000000000 --- a/configs/linux-solo-ia64 +++ /dev/null @@ -1,7 +0,0 @@ -# Configuration for linux-solo-ia64: Linux DRI hardware drivers for fbdev - -include $(TOP)/configs/linux-solo - -CONFIG_NAME = linux-solo-ia64 - -DRI_DIRS = fb mach64 mga r128 r200 radeon sis tdfx unichrome diff --git a/configs/linux-solo-x86 b/configs/linux-solo-x86 deleted file mode 100644 index a9bf3882602..00000000000 --- a/configs/linux-solo-x86 +++ /dev/null @@ -1,10 +0,0 @@ -# -*-makefile-*- -# Configuration for linux-solo-x86: Linux hardware drivers for fbdev for x86 - -include $(TOP)/configs/linux-solo - -CONFIG_NAME = linux-solo-x86 - -ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -MESA_ASM_SOURCES = $(X86_SOURCES) -GLAPI_ASM_SOURCES = $(X86_API) diff --git a/configs/linux-x86-glide b/configs/linux-x86-glide deleted file mode 100644 index 603b2bf758b..00000000000 --- a/configs/linux-x86-glide +++ /dev/null @@ -1,28 +0,0 @@ -# Configuration for Linux with 3Dfx Glide driver and x86 optimizations - -include $(TOP)/configs/default - -CONFIG_NAME = linux-x86-glide - -# Compiler and flags -CC = gcc -CXX = g++ - -CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include -DFX -I/usr/include/glide -I/usr/local/glide/include - -CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - -GLUT_CFLAGS = -fexceptions - -# Work around aliasing bugs - developers should comment this out -CFLAGS += -fno-strict-aliasing -CXXFLAGS += -fno-strict-aliasing - -MESA_ASM_SOURCES = $(X86_SOURCES) -GLAPI_ASM_SOURCES = $(X86_API) - -# Library/program dependencies -GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -L/usr/local/glide/lib -lglide3x -lm -lpthread -GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11 -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/local/glide/lib -lglide3x -lm diff --git a/configure.ac b/configure.ac index be06adf5e5e..70e158f5d7a 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,28 @@ solaris*) ;; esac +dnl If we're using GCC, make sure that it is at least version 3.3.0. Older +dnl versions are explictly not supported. +if test "x$GCC" = xyes; then + AC_MSG_CHECKING([whether gcc version is sufficient]) + major=0 + minor=0 + + GCC_VERSION=`$CC -dumpversion` + if test $? -eq 0; then + major=`echo $GCC_VERSION | cut -d. -f1` + minor=`echo $GCC_VERSION | cut -d. -f1` + fi + + if test $major -lt 3 -o $major -eq 3 -a $minor -lt 3 ; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.]) + else + AC_MSG_RESULT([yes]) + fi +fi + + MKDEP_OPTIONS=-fdepend dnl Ask gcc where it's keeping its secret headers if test "x$GCC" = xyes; then @@ -92,6 +114,9 @@ linux*|*-gnu*|gnu*) solaris*) DEFINES="$DEFINES -DPTHREADS -DSVR4" ;; +cygwin*) + DEFINES="$DEFINES -DPTHREADS" + ;; esac dnl Add flags for gcc and g++ @@ -392,7 +417,7 @@ fi dnl dnl Driver configuration. Options are xlib, dri and osmesa right now. -dnl More later: directfb, fbdev, ... +dnl More later: fbdev, ... dnl default_driver="xlib" @@ -432,7 +457,6 @@ CORE_DIRS="glsl mesa" SRC_DIRS="glew" GLU_DIRS="sgi" -WINDOW_SYSTEM="" GALLIUM_DIRS="auxiliary drivers state_trackers" GALLIUM_WINSYS_DIRS="" GALLIUM_WINSYS_DRM_DIRS="" @@ -447,7 +471,6 @@ xlib) dri) SRC_DIRS="$SRC_DIRS glx" DRIVER_DIRS="dri" - WINDOW_SYSTEM="dri" GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm" ;; osmesa) @@ -457,7 +480,6 @@ esac AC_SUBST([SRC_DIRS]) AC_SUBST([GLU_DIRS]) AC_SUBST([DRIVER_DIRS]) -AC_SUBST([WINDOW_SYSTEM]) AC_SUBST([GALLIUM_DIRS]) AC_SUBST([GALLIUM_WINSYS_DIRS]) AC_SUBST([GALLIUM_WINSYS_DRM_DIRS]) @@ -717,10 +739,9 @@ if test "$mesa_driver" = dri; then case "$host_cpu" in x86_64) - # ffb, gamma, and sis are missing because they have not be - # converted to use the new interface. i810 are missing - # because there is no x86-64 system where they could *ever* - # be used. + # sis is missing because they have not be converted to use + # the new interface. i810 are missing because there is no + # x86-64 system where they could *ever* be used. if test "x$DRI_DIRS" = "xyes"; then DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon \ savage tdfx unichrome swrast" @@ -736,7 +757,7 @@ if test "$mesa_driver" = dri; then sparc*) # Build only the drivers for cards that exist on sparc` if test "x$DRI_DIRS" = "xyes"; then - DRI_DIRS="mach64 r128 r200 r300 r600 radeon ffb swrast" + DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast" fi ;; esac @@ -752,8 +773,6 @@ if test "$mesa_driver" = dri; then CXXFLAGS="$CXXFLAGS -ansi -pedantic" fi - # ffb and gamma are missing because they have not been converted - # to use the new interface. if test "x$DRI_DIRS" = "xyes"; then DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \ unichrome savage sis swrast" @@ -775,7 +794,7 @@ if test "$mesa_driver" = dri; then # default drivers if test "x$DRI_DIRS" = "xyes"; then DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \ - savage sis tdfx unichrome ffb swrast" + savage sis tdfx unichrome swrast" fi DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'` @@ -804,7 +823,7 @@ AC_SUBST([DRI_LIB_DEPS]) case $DRI_DIRS in *i915*|*i965*) - PKG_CHECK_MODULES([INTEL], [libdrm_intel]) + PKG_CHECK_MODULES([INTEL], [libdrm_intel >= 2.4.19]) ;; esac diff --git a/docs/GL3.txt b/docs/GL3.txt index df3fd745498..889edefbce1 100644 --- a/docs/GL3.txt +++ b/docs/GL3.txt @@ -20,7 +20,7 @@ Framebuffer objects (GL_EXT_framebuffer_object) DONE Half-float some infrastructure done Multisample blit DONE Non-normalized Integer texture/framebuffer formats not started -1D/2D Texture arrays mostly done +1D/2D Texture arrays core Mesa, swrast done Packed depth/stencil formats DONE Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE GL_EXT_texture_compression_rgtc not started diff --git a/docs/MiniGLX.html b/docs/MiniGLX.html deleted file mode 100644 index e7ebae68519..00000000000 --- a/docs/MiniGLX.html +++ /dev/null @@ -1,534 +0,0 @@ - - -
- Copyright © 2002-2003 by Tungsten Graphics, Inc., Cedar Park,
-Texas. All Rights Reserved.
-
-Permission is granted to make and distribute verbatim copies of this
-document provided the copyright notice and this permission notice are
-preserved on all copies.
-
-
The Mini GLX interface facilitates OpenGL rendering on embedded -devices. The interface is a subset of the GLX interface, plus a minimal -set of Xlib-like functions.
-Programs written to the Mini GLX specification should run unchanged -on systems with the X Window System and the GLX extension. The intention -is to allow flexibility for prototyping and testing.
-This document serves as both the reference guide and programming
-guide for Mini GLX.
-
-
The OpenGL specification does not describe how OpenGL rendering -contexts and drawing surfaces (i.e. the frame buffer) are created and -managed. Rather, this is handled by an OpenGL window system interface, -such as Mini GLX.
-There are three main datatypes or resources managed by Mini GLX. The -resources and their corresponding GLX or Xlib data types are:
-| Resource | -Data type | -
| pixel formats | -X Visual and XVisualInfo | -
| drawing surfaces | -X Window or GLXDrawable | -
| rendering contexts | -GLXContext | -
Pixel formats or X Visuals describe the per-pixel attributes of the -frame buffer. For example, bits per color component, Z buffer size, -stencil size, TrueColor vs PseudoColor, etc.
-Drawing surfaces or X Windows typically describe a spatial -allocation of the frame buffer (i.e. the position and size of a -rectangular region of pixels). Since MiniGLX doesn't really support a -window system, the window is effectively the entire frame buffer.
-A rendering context represents the current OpenGL state such as -current drawing color, line width, blending mode, texture parameters, -etc. Several rendering contexts can be created but only one can be in -use at any given time.
-The Mini GLX interface provides all the functions needed for
-choosing pixel formats, create drawing surfaces, creating rendering
-contexts and binding rendering contexts to drawing surfaces.
-
-
To use the Mini GLX interface in your application, include the -GL/miniglx.h header file at compile time:
- #include <GL/miniglx.h>
-
-Applications should link with libGL.so (i.e. gcc
-myprogram.o -lGL -o myprogram). libGL.so implements the
-MiniGLX API functions and, in turn, loads a hardware-specific device
-driver (such as radeon_dri.so) at runtime. The
-environment variable LIBGL_DRIVERS_PATH should name the
-directory where these modules are located.The XOpenDisplay function is used to initialize the graphics system:
---Display *XOpenDisplay(const char *displayname)-
The displayName parameter is currently ignored in Mini
-GLX. It is recommended that NULL be passed as thedisplayName
-parameter.
If XOpenDisplay is able to initialize the graphics system a pointer -to a Display will be returned. Otherwise, NULL will be returned.
-A visual (i.e. pixel format) must be chosen before a drawing surface -or rendering context can be created. This is done with the -glXChooseVisual function:
---XVisualInfo *glXChooseVisual(Display *dpy, int screen, const int *attribList)-
dpy is a pointer to the display returned by
-XOpenDisplay.
screen is currently ignored by Mini GLX and should be
-zero.
attribList is a list of GLX attributes which describe
-the desired pixel format. It is terminated by the token None.
-The attributes are as follows:
---
-- -
GLX_USE_GL- This attribute should always be present in order to maintain -compatibility with GLX.
-- -
GLX_RGBA- If present, only RGBA pixel formats will be considered. -Otherwise, only color index formats are considered.
-- -
GLX_DOUBLEBUFFER- if present, only double-buffered pixel formats will be chosen.
-- -
GLX_RED_SIZE n- Must be followed by a non-negative integer indicating the -minimum number of bits per red pixel component that is acceptable.
-- -
GLX_GREEN_SIZE n- Must be followed by a non-negative integer indicating the -minimum number of bits per green pixel component that is acceptable.
-- -
GLX_BLUE_SIZE n- Must be followed by a non-negative integer indicating the -minimum number of bits per blue pixel component that is acceptable.
-- -
GLX_ALPHA_SIZE n- Must be followed by a non-negative integer indicating the -minimum number of bits per alpha pixel component that is acceptable.
-- -
GLX_STENCIL_SIZE n- Must be followed by a non-negative integer indicating the -minimum number of bits per stencil value that is acceptable.
-- -
None- This token is used to terminate the attribute list.
-
glXChooseVisual will return a pointer to an XVisualInfo object which -most closely matches the requirements of the attribute list. If there -is no visual which matches the request, NULL will be returned.
-Note that visuals with accumulation buffers and depth buffers are
-not available.
-
-
Drawing surfaces are created as X windows. For Mini GLX, -windows are full-screen; they cover the entire frame buffer. - Also, Mini GLX imposes a limit of one window. A second window -cannot be created until the first one is destroyed.
-The XCreateWindow function is used to create a drawing surface:
---Window XCreateWindow( Display *display,-
Window parent,
int x, int y,
unsigned int width, unsigned int height,
unsigned int borderWidth,
int depth,
unsigned int class,
Visual *visual,
unsigned long valuemask,
XSetWindowAttributes *attributes )
The parameters are as follows:
----
-- -
display- A Display pointer, as returned by XOpenDisplay.
-- -
parent- The parent window for the new window. For Mini GLX, this -should be
-RootWindow(dpy, 0).- -
x, y- The position of the window. For Mini GLX, both values should -be zero.
-- -
width, height- The size of the window. For Mini GLX, this specifies the -desired screen size such as 1024, 768 or 1280, 1024.
-- -
borderWidth- This parameter should be zero.
-- -
depth- The pixel depth for the window. For Mini GLX this should be -the depth found in the XVisualInfo object returned by
-glxChooseVisual.- -
class- The window class. For Mini GLX this value should be
-InputOutput.- -
visual- This parameter should be the
-visualfield of theXVisualInfo-object returned byglxChooseVisual.- -
valuemask- This parameter indicates which fields of the
-XSetWindowAttributes-are to be used. For Mini GLX this is typically the bitmaskCWBackPixel -| CWBorderPixel | CWColormap.- -
attributes- Initial window attributes. Of the fields in the
-XSetWindowAttributes-structure, thebackground_pixel,border_pixel-andcolormapfields should be set. See the discussion -below regarding colormaps.
XCreateWindow will return a window handle if it succeeds
-or zero if it fails.
To display the window the XMapWindow function must be called:
---void XMapWindow(Display *dpy, Window w)-
This function does nothing in Mini GLX but is required for Xlib/GLX -compatibility
-Xlib requires specification of a colormap when creating a window. - For purposes of interoperability, Mini GLX requires this as well, -though the colormap is not actually used. The XCreateColormap -function is used to create a colormap:
--Colormap XCreateColormap(Display *dpy, Window window, -Visual *visual, int alloc)
-
The parameters are as follows:
-
---
-- -
dpy- The display handle as returned by XOpenDisplay.
-- -
window- This parameter is ignored by Mini GLX but should be the value -returned by the
-RootWindow(dpy, 0)macro.
-- -
visual- This parameter is ignored by Mini GLX but should be the visual -field of the XVisualInfo object returned by glXChooseVisual.
-- -
alloc- This parameter is ignored by Mini GLX but should be set to
-AllocNone.
An OpenGL rendering context is created with the glXCreateContext
-function:
--GLXContext glXCreateContext(Display *dpy, XVisualInfo *visInfo, GLXContext shareList, Bool direct)-
The parameters are as follows:
----
-- -
dpy- The display handle as returned by XOpenDisplay.
-- -
visInfo- The visual as returned by glXChooseVisual.
-- -
shareList- If non-zero, texture objects and display lists are shared with -the named rendering context. If zero, texture objects and display lists -will (initially) be private to this context. They may be shared when a -subsequent context is created.
-- -
direct- Specifies whether direct or indirect rendering is desired. For -Mini GLX this value is ignored but it should be set to
-True.
glXCreateContext will return a GLXContext handle if it
-succeeds or zero if it fails due to invalid parameter or insufficient
-resources.
-
-
The final step before beginning OpenGL rendering is to bind (i.e. -activate) a rendering context and drawing surface with the -glXMakeCurrent function:
---Bool glXMakeCurrent(Display *dpy, GLXDrawable drawable, GLXContext ctx)-
The parameters are as follows:
----
-- -
dpy- The display handle, as returned by XOpenDisplay.
-- -
drawable- The window or drawable to bind to the rendering context. This -should be the value returned by XCreateWindow.
-- -
ctx- The rendering context to bind, as returned by glXCreateContext.
-
If glXMakeCurrent succeeds True is returned. Otherwise False is -returned to indicate an invalid display, window or context parameter.
-After the rendering context has been bound to the drawing surface -OpenGL rendering can begin.
-The current rendering context may be unbound by calling -glXMakeCurrent with the window and context parameters set to zero.
-An application may create any number of rendering contexts and bind
-them as needed. Note that binding a rendering context is generally not a
-light-weight operation. Most simple OpenGL applications create
-only one rendering context.
-
-
A double buffered window has two color buffers: a front buffer and a -back buffer. Normally, rendering is directed to the back buffer while -the front buffer is displayed. When rendering of a frame is finished -the front and back buffers are swapped to provide the illusion of -instanteous screen updates.
-The color buffers for a particular window (i.e. drawable) may be -swapped with the glXSwapBuffers command:
---Any pending rendering commands will be completed before the buffer swap -takes place.void glXSwapBuffers(Display *dpy, GLXDrawable drawable)-
A rendering context may be destroyed by calling glXDestroyContext:
---void glXDestroyContext(Display *dpy, GLXContext ctx)-
A window may be destroyed by calling XDestroyWindow:
---void XDestroyWindow(Display *dpy, Window window)-
An XVisualInfo object may be freed by calling XFree:
---void XFree(void *data)-
A colormap may be freed by calling XFreeColormap:
---void XFreeColormap(Display *dpy, Colormap colormap)-
When the application is about to exit, the resources associated with -the graphics system can be released by calling XCloseDisplay:
---void XCloseDisplay(Display *dpy)-
The display handle becomes invalid at this point.
-
-
XVisualInfo
-*XGetVisualInfo(Display *dpy, long vinfo_mask, XVisualInfo
-*vinfo_template, int *nitems_return)
---The return value is the address of an array of all available visuals.-
-- -
dpy- The display handle, as returned by XOpenDisplay.
-- -
vinfo_mask- A bitmask indicating which fields of the vinfo_template are to -be matched. The value must be VisualScreenMask.
-- -
vinfo_template- A template whose fields indicate which visual attributes must -be matched by the results. The screen field of this structure must -be zero.
-- -
nitems_return- Returns the number of visuals returned.
-
XVisualInfo visTemplate, *results;int numVisuals;Display *dpy = XOpenDisplay(NULL);visTemplate.screen = 0;results = XGetVisualInfo(dpy, VisualScreenMask, &visTemplate,
-&numVisuals);The GLX attributes of an X visual may be queried with the -glXGetConfig function:
---int glXGetConfig(Display *dpy, XVisualInfo *vis, int attribute, int *value)-
The parameters are as follows:
----
-- -
dpy- The display handle, as returned by XOpenDisplay.
-- -
vis- The visual, as returned by glXChooseVisual.
-- -
attribute- The attribute to query. The attributes are listed below.
-- -
value- Pointer to an integer in which the result of the query will be -stored.
-
The return value will be zero if no error occurs.
- GLX_INVALID_ATTRIBUTE will be returned if the attribute
-parameter is invalid. GLX_BAD_VISUAL will be returned
-if the XVisualInfo parameter is invalid.
The following attributes may be queried:
----
-- -
GLX_USE_GL- The result will be
-TrueorFalseto -indicate if OpenGL rendering is supported with the visual. Mini GLX -always returnTrue.- -
GLX_RGBA- The result will be
-Truefor RGBA visuals orFalse-for color index visuals.- -
GLX_DOUBLEBUFFER- The result will be
-Trueif the visual has two -color buffers orFalseif the visual has one color buffer.- -
GLX_RED_SIZE- The result will be the number of red bits per pixel.
-- -
GLX_GREEN_SIZE- The result will be the number of green bits per pixel.
-- -
GLX_BLUE_SIZE- The result will be the number of blue bits per pixel.
-- -
GLX_ALPHA_SIZE- The result will be the number of alpha bits per pixel.
-- -
GLX_DEPTH_SIZE- The result will be the number of bits per Z value.
-- -
GLX_STENCIL_SIZE- The result will be the number of bits per stencil value.
-
-
-
The current rendering context can be queried with -glXGetCurrentContext:
---GLXContext glXGetCurrentContext(void)-
Zero will be returned if no context is currently bound.
-
-
The current drawable (i.e. window or drawing surface) can be queried -with glXGetCurrentDrawable:
---GLXDrawable glXGetCurrentDrawable(void)-
Zero will be returned if no drawable is currently bound.
-
-
The glXGetProcAddress function will return the address of any -available OpenGL or Mini GLX function:
---void *glXGetProcAddress(const GLubyte *procName)-
If procName is a valid function name, a pointer to that
-function will be returned. Otherwise, NULL will be returned.
The purpose of glXGetProcAddress is to facilitate using future
-extensions to OpenGL or Mini GLX. If a future version of the library
-adds new extension functions they'll be accessible via
-glXGetProcAddress. The alternative is to hard-code calls to the new
-functions in the application but doing so will prevent linking the
-application with older versions of the library.
-
-
--Bool glXQueryVersion(Display *dpy, int *major, int *minor)-
major will be set to the major version number andminor
-will be set to the minor version number.True will be
-returned if the function succeeds. False will be returned
-if the function fails due to invalid parameters. The dpy
-argument is currently ignored, but should be the value returned by
-XOpenDisplay.
At compile time, the Mini GLX interface version can be tested with
-the MINI_GLX_VERSION_1_x preprocessor tokens. For example, if
-version 1.0 of Mini GLX is supported, then MINI_GLX_VERSION_1_0
-will be defined. If version 1.1 of Mini GLX is supported, then
-MINI_GLX_VERSION_1_1 will be defined.
At the time of writing the current Mini GLX version is 1.0.
-
-
Display
-data type is defined as a structure in /usr/include/X11/Xlib.h and
-programmers may access any fields of that structure at will. Mini
-GLX also defines a Display data type but its fields are hidden and not
-visiblein miniglx.h. Duplicating the Xlib
-declaration for the Display data type in minigl.h would
-require defining a large number of other superfluous Xlib datatypes.XVisualInfo and XSetWindowAtttributes
-data types must be completely public.
-RootWindow(dpy,
-screen) macro returns the root window for a given screen on a
-given display. Unfortunately, macros do nothing to aid in ABI
-compatibility since they are resolved at compile time instead of at
-link/run time.RootWindow macro since it's
-essential for creating windows. But the implementation of this
-macro by Xlib and Mini GLX is completely different.This section shows an example program which uses the Mini GLX
-interface. The program simply draws several frames of a rotating square.
-
The program may be compiled for use with Xlib/GLX or Mini GLX by
-setting the USE_MINIGLX token to 0 or 1, respectively.
- Note that the only difference is the header files which are
-included.
-
-
-#define USE_MINIGLX 1 /* 1 = use Mini GLX, 0 = use Xlib/GLX */
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#if USE_MINIGLX
#include <GL/miniglx.h>
#else
#include <GL/glx.h>
#include <X11/Xlib.h>
#endif/*
* Create a simple double-buffered RGBA window.
*/
static Window
MakeWindow(Display * dpy, unsigned int width, unsigned int height)
{
int visAttributes[] = {
GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
None
};
XSetWindowAttributes attr;
unsigned long attrMask;
Window root;
Window win;
GLXContext ctx;
XVisualInfo *visinfo;
root = RootWindow(dpy, 0);
/* Choose GLX visual / pixel format */
visinfo = glXChooseVisual(dpy, 0, visAttributes);
if (!visinfo) {
printf("Error: couldn't get an RGB, Double-buffered visual\n");
exit(1);
}
/* Create the window */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
attrMask = CWBackPixel | CWBorderPixel | CWColormap;
win = XCreateWindow(dpy, root, 0, 0, width, height,
0, visinfo->depth, InputOutput,
visinfo->visual, attrMask, &attr);
if (!win) {
printf("Error: XCreateWindow failed\n");
exit(1);
}
/* Display the window */
XMapWindow(dpy, win);
/* Create GLX rendering context */
ctx = glXCreateContext(dpy, visinfo, NULL, True);
if (!ctx) {
printf("Error: glXCreateContext failed\n");
exit(1);
}
/* Bind the rendering context and window */
glXMakeCurrent(dpy, win, ctx);
return win;
}
/*
* Draw a few frames of a rotating square.
*/
static void
DrawFrames(Display * dpy, Window win)
{
int angle;
glShadeModel(GL_FLAT);
glClearColor(0.5, 0.5, 0.5, 1.0);
for (angle = 0; angle < 360; angle += 10) {
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 0.0);
glPushMatrix();
glRotatef(angle, 0, 0, 1);
glRectf(-0.8, -0.8, 0.8, 0.8);
glPopMatrix();
glXSwapBuffers(dpy, win);
}
}
int
main(int argc, char *argv[])
{
Display *dpy;
Window win;
dpy = XOpenDisplay(NULL);
if (!dpy) {
printf("Error: XOpenDisplay failed\n");
return 1;
}
win = MakeWindow(dpy, 300, 300);
DrawFrames(dpy, win);
return 0;
}