Compare commits
228 Commits
mesa_20050
...
mesa_6_3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4596584f6 | ||
|
|
6bb49eacfd | ||
|
|
bfb5ea307e | ||
|
|
364ae78e69 | ||
|
|
8d7d9c22f6 | ||
|
|
2d47c07398 | ||
|
|
7e152b83cb | ||
|
|
ed886336e1 | ||
|
|
5343ae8304 | ||
|
|
df88dfe1df | ||
|
|
c235a96a71 | ||
|
|
aa8ff1e75d | ||
|
|
9bdfee3a47 | ||
|
|
e0e993c5ff | ||
|
|
c529f6bf70 | ||
|
|
8d3aca655e | ||
|
|
1f88391747 | ||
|
|
d39760d718 | ||
|
|
df0350b7ec | ||
|
|
b0489d4f82 | ||
|
|
8ec981c469 | ||
|
|
4eb3a0f076 | ||
|
|
4c72778251 | ||
|
|
badad72383 | ||
|
|
c62c24c72f | ||
|
|
b127cfeb7a | ||
|
|
3f7cb794ea | ||
|
|
c472dcdac0 | ||
|
|
ce721143b4 | ||
|
|
9311bc253e | ||
|
|
0cfbd849ec | ||
|
|
6d5d1f8a41 | ||
|
|
38e2fa385d | ||
|
|
2550844c6e | ||
|
|
259f096ed8 | ||
|
|
f3186e5789 | ||
|
|
4cf6718725 | ||
|
|
78be0b5dad | ||
|
|
f0ff50d4ed | ||
|
|
1a9cac10b8 | ||
|
|
9204e87b2e | ||
|
|
4f178c6e3a | ||
|
|
ef2ce9d003 | ||
|
|
c1c684b0f3 | ||
|
|
666dcaaf05 | ||
|
|
7b12220256 | ||
|
|
5f79d27b82 | ||
|
|
c136b41b09 | ||
|
|
ee850657e6 | ||
|
|
0cf67634bb | ||
|
|
101d05ad94 | ||
|
|
c5b6580c6f | ||
|
|
35a11c14ee | ||
|
|
ec171b7d02 | ||
|
|
2de5f6e252 | ||
|
|
b64d60a2a6 | ||
|
|
eac7688231 | ||
|
|
219f3c4489 | ||
|
|
06abb854f0 | ||
|
|
7fe8696d01 | ||
|
|
9b56781986 | ||
|
|
758f334717 | ||
|
|
8e8fa63cb4 | ||
|
|
559c494fc8 | ||
|
|
03f52fea63 | ||
|
|
6d3284efd4 | ||
|
|
58a9573b08 | ||
|
|
0d34c0158d | ||
|
|
f4f1c29597 | ||
|
|
bb5c84fcbc | ||
|
|
446e258940 | ||
|
|
54fb9226e4 | ||
|
|
30aea49cf6 | ||
|
|
cf5b2f7419 | ||
|
|
c212abf99a | ||
|
|
1ac8ae446a | ||
|
|
aa70253cbb | ||
|
|
049e320f46 | ||
|
|
f138b977d0 | ||
|
|
4d652b7855 | ||
|
|
b0d62880e8 | ||
|
|
0e55891674 | ||
|
|
ccda2162f6 | ||
|
|
b6c0d753fa | ||
|
|
ec17e7941a | ||
|
|
b6c5116171 | ||
|
|
84f8d7aafb | ||
|
|
39a488ed63 | ||
|
|
2dbffb30f0 | ||
|
|
397088ff5e | ||
|
|
c43f03e38d | ||
|
|
3f9839a52b | ||
|
|
a4eb693b5f | ||
|
|
32b898126e | ||
|
|
3b817fde88 | ||
|
|
845f2a7350 | ||
|
|
f8582b6c1f | ||
|
|
394fd40a53 | ||
|
|
4e1aae6e0e | ||
|
|
5aafea03af | ||
|
|
3fb86eefe8 | ||
|
|
1c5caba184 | ||
|
|
2636e853f6 | ||
|
|
814e5360b0 | ||
|
|
66a5548fbb | ||
|
|
f292e13a20 | ||
|
|
1e4744d2b9 | ||
|
|
ebd99043ed | ||
|
|
a5fb15cb87 | ||
|
|
04f863e856 | ||
|
|
23606a5704 | ||
|
|
90b40c33e7 | ||
|
|
dc137ddb3f | ||
|
|
a6a3e01b09 | ||
|
|
4378dee78c | ||
|
|
38332a6d94 | ||
|
|
4e7df27466 | ||
|
|
3c6f17be32 | ||
|
|
af02907b4c | ||
|
|
463c1d6c57 | ||
|
|
0e288e58ef | ||
|
|
3176f8e2e1 | ||
|
|
6c2098ffd4 | ||
|
|
f445aaa67a | ||
|
|
aa26915472 | ||
|
|
fb818a0b11 | ||
|
|
6b9d9c5039 | ||
|
|
2d218885ec | ||
|
|
902e70875d | ||
|
|
b675c48027 | ||
|
|
4476978856 | ||
|
|
252d8e78cc | ||
|
|
5d6ecf25f8 | ||
|
|
b4979ec178 | ||
|
|
6c1948d593 | ||
|
|
729cccba5d | ||
|
|
7e8e4c500e | ||
|
|
f6e7cfb60d | ||
|
|
52608d2d21 | ||
|
|
1c48986e54 | ||
|
|
1fc4bcbb17 | ||
|
|
44367aab2a | ||
|
|
2c6e8e90ec | ||
|
|
81032030ff | ||
|
|
a8534885ef | ||
|
|
79b7bd18bb | ||
|
|
8e56122782 | ||
|
|
ea93b2986b | ||
|
|
002d0ad3e9 | ||
|
|
562bdaf70e | ||
|
|
9899f58c76 | ||
|
|
dce3a91a8d | ||
|
|
2d2f5a4b19 | ||
|
|
ee7ad16f3f | ||
|
|
2c7336af4e | ||
|
|
012de39c23 | ||
|
|
60339c7062 | ||
|
|
7fb16836e7 | ||
|
|
d45cb9a836 | ||
|
|
681b758f11 | ||
|
|
a0b5c98364 | ||
|
|
31d0cedd78 | ||
|
|
7477a7d366 | ||
|
|
4417d4cb61 | ||
|
|
ed7f3aead8 | ||
|
|
395280bf88 | ||
|
|
a4691981d9 | ||
|
|
1d60469c4c | ||
|
|
461a2a799a | ||
|
|
757e0855ad | ||
|
|
17d249d31b | ||
|
|
4f923fb0bc | ||
|
|
c20a2b0b72 | ||
|
|
ef9e0be0cb | ||
|
|
2e7dcdd38b | ||
|
|
d59fbcdee5 | ||
|
|
3c4c6d1f80 | ||
|
|
40b8b57ed4 | ||
|
|
df5e2b934b | ||
|
|
d96dd3cd49 | ||
|
|
bb8b302dbc | ||
|
|
5ec5c6b222 | ||
|
|
863bd56520 | ||
|
|
5821f3d70c | ||
|
|
5b10d71559 | ||
|
|
516546ad5b | ||
|
|
3fe9c40cb2 | ||
|
|
13c8f985d9 | ||
|
|
1516f559bc | ||
|
|
c4fbdb090c | ||
|
|
589a3a3f6e | ||
|
|
f090fdc50b | ||
|
|
d638f6a0bb | ||
|
|
502504de23 | ||
|
|
f772e3dd15 | ||
|
|
c7264415b6 | ||
|
|
1b93953fbc | ||
|
|
5d5100aabc | ||
|
|
2e081cd90e | ||
|
|
0009e3d97d | ||
|
|
628b18b8ca | ||
|
|
4ec6eceea9 | ||
|
|
8c2a9a9166 | ||
|
|
ef377c3c00 | ||
|
|
b79c47e90c | ||
|
|
8a1df96862 | ||
|
|
9dff2ca07a | ||
|
|
12eabeb3b9 | ||
|
|
c7f8d36451 | ||
|
|
993d8ad5ef | ||
|
|
b328dded75 | ||
|
|
c1b87b2a06 | ||
|
|
0936eeb456 | ||
|
|
f2149a7a66 | ||
|
|
0b73889d54 | ||
|
|
2962f88189 | ||
|
|
f054fa85d8 | ||
|
|
2ed4c296d9 | ||
|
|
22b0a42465 | ||
|
|
0bae91562e | ||
|
|
908dbc44c2 | ||
|
|
74e412c695 | ||
|
|
0080faf83e | ||
|
|
d322810e13 | ||
|
|
6580a6d561 | ||
|
|
70dbbbf89a | ||
|
|
497dd3e920 | ||
|
|
249db89b00 |
53
Makefile
53
Makefile
@@ -28,6 +28,7 @@ realclean:
|
||||
-rm -f `find . -name \*.o`
|
||||
-rm -f `find . -name \*.a`
|
||||
-rm -f `find . -name \*.so`
|
||||
-rm -f `find . -name depend`
|
||||
|
||||
|
||||
|
||||
@@ -61,6 +62,7 @@ darwin \
|
||||
darwin-static \
|
||||
freebsd \
|
||||
freebsd-dri \
|
||||
freebsd-dri-amd64 \
|
||||
freebsd-dri-x86 \
|
||||
hpux10 \
|
||||
hpux10-gcc \
|
||||
@@ -139,7 +141,6 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/Makefile* \
|
||||
$(DIRECTORY)/descrip.mms \
|
||||
$(DIRECTORY)/mms-config. \
|
||||
$(DIRECTORY)/Mesa.dsw \
|
||||
$(DIRECTORY)/bin/mklib \
|
||||
$(DIRECTORY)/bin/installmesa \
|
||||
$(DIRECTORY)/configs/[a-z]* \
|
||||
@@ -179,28 +180,25 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/src/mesa/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/depend \
|
||||
$(DIRECTORY)/src/mesa/main/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/main/main.dsp \
|
||||
$(DIRECTORY)/src/mesa/main/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/glapi/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/glapi/glapi.dsp \
|
||||
$(DIRECTORY)/src/mesa/glapi/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/array_cache/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/array_cache/array_cache.dsp \
|
||||
$(DIRECTORY)/src/mesa/array_cache/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/math/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/math/math.dsp \
|
||||
$(DIRECTORY)/src/mesa/math/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/shader/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/shader/shader.dsp \
|
||||
$(DIRECTORY)/src/mesa/shader/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/shader/grammar/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/shader/grammar/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/shader/slang/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/shader/slang/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/swrast/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/swrast/swrast.dsp \
|
||||
$(DIRECTORY)/src/mesa/swrast/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/swrast_setup/swrast_setup.dsp \
|
||||
$(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/tnl/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/tnl/tnl.dsp \
|
||||
$(DIRECTORY)/src/mesa/tnl/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \
|
||||
@@ -209,13 +207,12 @@ LIB_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/directfb/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/directfb/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/common/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \
|
||||
$(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/glide/*.def \
|
||||
$(DIRECTORY)/src/mesa/drivers/ggi/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/ggi/ggimesa.conf.in \
|
||||
$(DIRECTORY)/src/mesa/drivers/ggi/default/*.c \
|
||||
@@ -226,26 +223,26 @@ LIB_FILES = \
|
||||
$(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/osmesa.dsp \
|
||||
$(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/windows/*/*.dsp \
|
||||
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/ppc/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/sparc/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/x86/Makefile \
|
||||
$(DIRECTORY)/src/mesa/x86/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/x86/*.S \
|
||||
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/x86-64/Makefile \
|
||||
$(DIRECTORY)/src/glu/Makefile \
|
||||
$(DIRECTORY)/src/glu/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile.win \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile.DJ \
|
||||
$(DIRECTORY)/src/glu/sgi/cc*.txt \
|
||||
$(DIRECTORY)/src/glu/sgi/glu.def \
|
||||
$(DIRECTORY)/src/glu/sgi/glu.dsp \
|
||||
$(DIRECTORY)/src/glu/sgi/dummy.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
|
||||
@@ -277,7 +274,18 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/progs/util/sampleMakefile \
|
||||
$(DIRECTORY)/vms/analyze_map.com \
|
||||
$(DIRECTORY)/vms/xlib.opt \
|
||||
$(DIRECTORY)/vms/xlib_share.opt
|
||||
$(DIRECTORY)/vms/xlib_share.opt \
|
||||
$(DIRECTORY)/windows/VC6/mesa/gdi/gdi.dsp \
|
||||
$(DIRECTORY)/windows/VC6/mesa/glu/*.txt \
|
||||
$(DIRECTORY)/windows/VC6/mesa/glu/glu.dsp \
|
||||
$(DIRECTORY)/windows/VC6/mesa/mesa.dsw \
|
||||
$(DIRECTORY)/windows/VC6/mesa/mesa/mesa.dsp \
|
||||
$(DIRECTORY)/windows/VC6/mesa/osmesa/osmesa.dsp \
|
||||
$(DIRECTORY)/windows/VC7/mesa/gdi/gdi.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/mesa/glu/glu.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/mesa/mesa.sln \
|
||||
$(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj
|
||||
|
||||
|
||||
GLUT_FILES = \
|
||||
@@ -288,7 +296,6 @@ GLUT_FILES = \
|
||||
$(DIRECTORY)/src/glut/glx/*def \
|
||||
$(DIRECTORY)/src/glut/glx/descrip.mms \
|
||||
$(DIRECTORY)/src/glut/glx/mms_depend \
|
||||
$(DIRECTORY)/src/glut/glx/glut.dsp \
|
||||
$(DIRECTORY)/src/glut/glx/*.[ch] \
|
||||
$(DIRECTORY)/src/glut/beos/*.[ch] \
|
||||
$(DIRECTORY)/src/glut/beos/*.cpp \
|
||||
@@ -311,8 +318,6 @@ DEMO_FILES = \
|
||||
$(DIRECTORY)/progs/demos/*.cxx \
|
||||
$(DIRECTORY)/progs/demos/*.dat \
|
||||
$(DIRECTORY)/progs/demos/README \
|
||||
$(DIRECTORY)/progs/demos/Windows/*.dsp \
|
||||
$(DIRECTORY)/progs/demos/Windows/*.dsw \
|
||||
$(DIRECTORY)/progs/xdemos/Makefile* \
|
||||
$(DIRECTORY)/progs/xdemos/descrip.mms \
|
||||
$(DIRECTORY)/progs/xdemos/*.[chf] \
|
||||
@@ -325,7 +330,13 @@ DEMO_FILES = \
|
||||
$(DIRECTORY)/progs/windml/Makefile.ugl \
|
||||
$(DIRECTORY)/progs/windml/*.c \
|
||||
$(DIRECTORY)/progs/windml/*.bmp \
|
||||
$(DIRECTORY)/progs/ggi/*.c
|
||||
$(DIRECTORY)/progs/ggi/*.c \
|
||||
$(DIRECTORY)/windows/VC6/progs/demos/*.dsp \
|
||||
$(DIRECTORY)/windows/VC6/progs/glut/glut.dsp \
|
||||
$(DIRECTORY)/windows/VC6/progs/progs.dsw \
|
||||
$(DIRECTORY)/windows/VC7/progs/demos/*.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/progs/glut/glut.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/progs/progs.sln
|
||||
|
||||
|
||||
DRI_FILES = \
|
||||
|
||||
@@ -53,8 +53,10 @@ set -v
|
||||
|
||||
mkdir ${INCLUDE_DIR}
|
||||
mkdir ${INCLUDE_DIR}/GL
|
||||
mkdir ${INCLUDE_DIR}/GLES
|
||||
mkdir ${LIB_DIR}
|
||||
cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL
|
||||
cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES
|
||||
cp -fd ${TOP}/lib*/lib* ${LIB_DIR}
|
||||
|
||||
echo "Done."
|
||||
|
||||
@@ -446,7 +446,7 @@ case $ARCH in
|
||||
${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
|
||||
FINAL_LIBS=${LIBNAME}
|
||||
else
|
||||
LIBNAME="${LIBNAME}.dylib"
|
||||
LIBNAME="lib${LIBNAME}.dylib"
|
||||
echo "mklib: Making Darwin shared library: " ${LIBNAME}
|
||||
FLAGS="-dynamiclib -multiply_defined suppress"
|
||||
if [ $CPLUSPLUS = 1 ] ; then
|
||||
|
||||
@@ -18,8 +18,12 @@ GLW_LIB_NAME = libGLw.dylib
|
||||
OSMESA_LIB_NAME = libOSMesa.dylib
|
||||
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
|
||||
OSMESA_LIB_DEPS = $(TOP)/lib/GL.dylib
|
||||
GLU_LIB_DEPS = $(TOP)/lib/GL.dylib
|
||||
GLUT_LIB_DEPS =
|
||||
OSMESA_LIB_DEPS = -L$(LIB_DIR) -lGL
|
||||
GLU_LIB_DEPS = -L$(LIB_DIR) -lGL
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -lGL -lGLU -L/usr/X11R6/lib -lX11 -lXmu -lXi -lXext
|
||||
GLW_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXt $(TOP)/lib/GL.dylib
|
||||
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
|
||||
# omit glw lib for now:
|
||||
SRC_DIRS = mesa glu glut/glx
|
||||
|
||||
|
||||
@@ -26,6 +26,10 @@ MKDEP = makedepend
|
||||
MKDEP_OPTIONS = -fdepend
|
||||
MAKE = make
|
||||
|
||||
# Python and flags (generally only needed by the developers)
|
||||
PYTHON2 = python
|
||||
PYTHON_FLAGS = -t -O -O
|
||||
|
||||
# Library names (base name)
|
||||
GL_LIB = GL
|
||||
GLU_LIB = GLU
|
||||
@@ -39,7 +43,7 @@ GL_LIB_NAME = lib$(GL_LIB).so
|
||||
GLU_LIB_NAME = lib$(GLU_LIB).so
|
||||
GLUT_LIB_NAME = lib$(GLUT_LIB).so
|
||||
GLW_LIB_NAME = lib$(GLW_LIB).so
|
||||
OSMESA_LIB_NAME = lib$(OSMesa).so
|
||||
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
|
||||
|
||||
|
||||
# Optional assembly language optimization files for libGL
|
||||
@@ -61,9 +65,10 @@ PROGRAM_DIRS = demos redbook samples xdemos
|
||||
|
||||
|
||||
# Library/program dependencies
|
||||
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
|
||||
EXTRA_LIB_PATH ?=
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
|
||||
OSMESA_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB)
|
||||
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lXt -lX11
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
||||
|
||||
@@ -11,16 +11,18 @@ CXX = g++
|
||||
WARN_FLAGS = -Wall
|
||||
OPT_FLAGS = -O
|
||||
|
||||
EXPAT_INCLUDES = -I/usr/local/include
|
||||
X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
|
||||
DEFINES = -DDRI_NEW_INTERFACE_ONLY
|
||||
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math -I/usr/local/include $(X11_INCLUDES)
|
||||
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC \
|
||||
-ffast-math $(X11_INCLUDES)
|
||||
CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC
|
||||
|
||||
ASM_SOURCES =
|
||||
|
||||
# Library/program dependencies
|
||||
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -pthread
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
|
||||
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lXm -lX11
|
||||
|
||||
9
configs/freebsd-dri-amd64
Normal file
9
configs/freebsd-dri-amd64
Normal file
@@ -0,0 +1,9 @@
|
||||
# -*-makefile-*-
|
||||
# Configuration for freebsd-dri-amd64: FreeBSD DRI hardware drivers
|
||||
|
||||
include $(TOP)/configs/freebsd-dri
|
||||
|
||||
CONFIG_NAME = freebsd-dri-x86-64
|
||||
|
||||
ASM_FLAGS = -DUSE_X86_64_ASM
|
||||
ASM_SOURCES = $(X86-64_SOURCES) $(X86-64_API)
|
||||
@@ -8,13 +8,26 @@ CONFIG_NAME = linux
|
||||
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
|
||||
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
WARN_FLAGS = -Wall
|
||||
OPT_FLAGS = -O3 -g
|
||||
PIC_FLAGS = -fPIC
|
||||
|
||||
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. Add -m32
|
||||
# to build properly on 64-bit platforms.
|
||||
|
||||
ARCH_FLAGS ?=
|
||||
|
||||
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
|
||||
-D_BSD_SOURCE -DPTHREADS -DUSE_XSHM
|
||||
|
||||
X11_INCLUDES = -I/usr/X11R6/include
|
||||
|
||||
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
|
||||
$(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
|
||||
|
||||
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
|
||||
$(X11_INCLUDES)
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
|
||||
# Library/program dependencies
|
||||
# Need to have -L/usr/X11R6/lib in these:
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
|
||||
EXTRA_LIB_PATH = -L/usr/X11R6/lib
|
||||
|
||||
@@ -1,20 +1,8 @@
|
||||
# Configuration for debugging on Linux
|
||||
|
||||
include $(TOP)/configs/default
|
||||
include $(TOP)/configs/linux
|
||||
|
||||
CONFIG_NAME = linux-debug
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG
|
||||
|
||||
CXXFLAGS = -g -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
# Need to have -L/usr/X11R6/lib in these:
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -L/usr/X11R6/lib -lX11
|
||||
OPT_FLAGS = -g
|
||||
DEFINES += -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
|
||||
|
||||
@@ -39,8 +39,6 @@ EXTRA_LIB_PATH=-L/usr/X11R6/lib
|
||||
|
||||
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
|
||||
GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
|
||||
|
||||
|
||||
# Directories
|
||||
@@ -49,7 +47,7 @@ DRIVER_DIRS = dri
|
||||
PROGRAM_DIRS =
|
||||
WINDOW_SYSTEM=dri
|
||||
|
||||
# ffb and gamma are missing because they have not been converted to use the new
|
||||
# gamma are missing because they have not been converted to use the new
|
||||
# interface.
|
||||
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon s3v \
|
||||
savage sis tdfx trident unichrome
|
||||
savage sis tdfx trident unichrome ffb
|
||||
|
||||
@@ -8,5 +8,9 @@ CONFIG_NAME = linux-dri-x86
|
||||
# Unnecessary on x86, generally.
|
||||
PIC_FLAGS =
|
||||
|
||||
# Add -m32 to CFLAGS:
|
||||
ARCH_FLAGS = -m32
|
||||
|
||||
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
|
||||
ASM_SOURCES = $(X86_SOURCES)
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ CONFIG_NAME = linux-dri-x86-64
|
||||
|
||||
ARCH_FLAGS = -m64
|
||||
|
||||
ASM_FLAGS = -DUSE_X86_64_ASM
|
||||
ASM_SOURCES = $(X86-64_SOURCES) $(X86-64_API)
|
||||
|
||||
LIB_DIR = $(TOP)/lib64
|
||||
|
||||
# Library/program dependencies
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
# Configuration for Linux on PPC
|
||||
|
||||
include $(TOP)/configs/default
|
||||
include $(TOP)/configs/linux
|
||||
|
||||
CONFIG_NAME = linux-ppc
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
CFLAGS = -O3 -mcpu=603 -ansi -pedantic -fPIC -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM
|
||||
CXXFLAGS = -O3 -mcpu=603 -ansi -pedantic -fPIC -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
||||
OPT_FLAGS = -O3 -mcpu=603 -fsigned-char -funroll-loops
|
||||
|
||||
# FIXME: Use of PowerPC assembly should be enabled here.
|
||||
@@ -1,15 +1,9 @@
|
||||
# Configuration for Linux on PPC, static libs
|
||||
|
||||
include $(TOP)/configs/default
|
||||
include $(TOP)/configs/linux-ppc
|
||||
|
||||
CONFIG_NAME = linux-ppc-static
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
CFLAGS = -O3 -mcpu=603 -ansi -pedantic -fPIC -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM
|
||||
CXXFLAGS = -O3 -mcpu=603 -ansi -pedantic -fPIC -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
MKLIB_OPTIONS = -static
|
||||
|
||||
# Library names (actual file names)
|
||||
@@ -18,9 +12,3 @@ GLU_LIB_NAME = libGLU.a
|
||||
GLUT_LIB_NAME = libglut.a
|
||||
GLW_LIB_NAME = libGLw.a
|
||||
OSMESA_LIB_NAME = libOSMesa.a
|
||||
|
||||
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lm
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
# Configuration for generic Linux, making static libs
|
||||
|
||||
include $(TOP)/configs/default
|
||||
include $(TOP)/configs/linux
|
||||
|
||||
CONFIG_NAME = linux-static
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
|
||||
CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
MKLIB_OPTIONS = -static
|
||||
|
||||
# Library names (actual file names)
|
||||
@@ -27,4 +19,3 @@ OSMESA_LIB_DEPS =
|
||||
GLU_LIB_DEPS =
|
||||
GLUT_LIB_DEPS =
|
||||
GLW_LIB_DEPS =
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm -lstdc++
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
# Configuration for Linux with x86 optimizations
|
||||
|
||||
include $(TOP)/configs/default
|
||||
include $(TOP)/configs/linux
|
||||
|
||||
CONFIG_NAME = linux-x86
|
||||
|
||||
# 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
|
||||
|
||||
CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
|
||||
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
|
||||
ASM_SOURCES = $(X86_SOURCES) $(X86_API)
|
||||
|
||||
# Library/program dependencies
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
||||
|
||||
@@ -4,10 +4,4 @@ include $(TOP)/configs/linux-x86
|
||||
|
||||
CONFIG_NAME = linux-x86-32
|
||||
|
||||
|
||||
# Other than -m32, these are the same as in linux-x86, which we included above.
|
||||
|
||||
CFLAGS = -m32 -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
|
||||
|
||||
CXXFLAGS = -m32 -Wall -O3 fPIC -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
|
||||
ARCH_FLAGS += -m32
|
||||
|
||||
@@ -1,28 +1,13 @@
|
||||
# Configuration for Linux for 64-bit X86 (Opteron)
|
||||
|
||||
include $(TOP)/configs/default
|
||||
include $(TOP)/configs/linux
|
||||
|
||||
CONFIG_NAME = linux-x86-64
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
CFLAGS = -m64 -Wall -O3 -std=c99 -pedantic -fPIC -D_REENTRANT -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DUSE_X86_64_ASM
|
||||
|
||||
CXXFLAGS = -m64 -Wall -O3 -fPIC -D_REENTRANT -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
|
||||
ASM_SOURCES = $(X86-64_SOURCES)
|
||||
ARCH_FLAGS = -m64
|
||||
|
||||
ASM_SOURCES = $(X86-64_SOURCES) $(X86-64_API)
|
||||
ASM_FLAGS = -DUSE_X86_64_ASM
|
||||
|
||||
LIB_DIR = $(TOP)/lib64
|
||||
|
||||
|
||||
# Library/program dependencies
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib64 -lX11 -lXext -lm -lpthread
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib64 -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib64 -lXt -lX11
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
||||
EXTRA_LIB_PATH = -L/usr/X11R6/lib64
|
||||
|
||||
@@ -1,28 +1,7 @@
|
||||
# Configuration for Linux for 64-bit X86 (Opteron)
|
||||
|
||||
include $(TOP)/configs/default
|
||||
include $(TOP)/configs/linux-x86-64
|
||||
|
||||
CONFIG_NAME = linux-x86-64-debug
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
CFLAGS = -g -m64 -Wall -O3 -std=c99 -pedantic -fPIC -D_REENTRANT -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DUSE_X86_64_ASM -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
|
||||
|
||||
CXXFLAGS = -g -m64 -Wall -O3 -ansi -pedantic -fPIC -D_REENTRANT -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
|
||||
ASM_SOURCES = $(X86-64_SOURCES)
|
||||
|
||||
|
||||
LIB_DIR = $(TOP)/lib64
|
||||
|
||||
|
||||
# Library/program dependencies
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib64 -lX11 -lXext -lm -lpthread
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib64 -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib64 -lXt -lX11
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
||||
DEFINES += -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
|
||||
|
||||
@@ -1,22 +1,11 @@
|
||||
# Configuration for Linux for 64-bit X86 (Opteron), static libs
|
||||
|
||||
include $(TOP)/configs/default
|
||||
include $(TOP)/configs/linux-x86-64
|
||||
|
||||
CONFIG_NAME = linux-x86-64-static
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
CFLAGS = -m64 -Wall -O3 -ansi -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
|
||||
|
||||
CXXFLAGS = -m64 -Wall -O3 -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
MKLIB_OPTIONS = -static
|
||||
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = libGL.a
|
||||
GLU_LIB_NAME = libGLU.a
|
||||
@@ -24,17 +13,9 @@ GLUT_LIB_NAME = libglut.a
|
||||
GLW_LIB_NAME = libGLw.a
|
||||
OSMESA_LIB_NAME = libOSMesa.a
|
||||
|
||||
|
||||
#ASM_SOURCES = $(X86_SOURCES)
|
||||
|
||||
|
||||
LIB_DIR = $(TOP)/lib64
|
||||
|
||||
|
||||
# Library/program dependencies (static libs don't have dependencies)
|
||||
GL_LIB_DEPS =
|
||||
OSMESA_LIB_DEPS =
|
||||
GLU_LIB_DEPS =
|
||||
GLUT_LIB_DEPS =
|
||||
GLW_LIB_DEPS =
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib64 -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm -lstdc++
|
||||
|
||||
@@ -5,6 +5,5 @@ include $(TOP)/configs/linux-x86
|
||||
|
||||
CONFIG_NAME = linux-x86-debug
|
||||
|
||||
CFLAGS = -Wall -g -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
|
||||
|
||||
CXXFLAGS = -Wall -g -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
OPT_FLAGS = -g
|
||||
DEFINES += -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
|
||||
|
||||
@@ -1,22 +1,11 @@
|
||||
# Configuration for Linux with x86 optimizations, static libs
|
||||
|
||||
include $(TOP)/configs/default
|
||||
include $(TOP)/configs/linux-x86
|
||||
|
||||
CONFIG_NAME = linux-x86-static
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
CFLAGS = -Wall -O3 -ansi -pedantic -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
|
||||
|
||||
CXXFLAGS = -Wall -O3 -ansi -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
MKLIB_OPTIONS = -static
|
||||
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = libGL.a
|
||||
GLU_LIB_NAME = libGLU.a
|
||||
@@ -24,14 +13,9 @@ GLUT_LIB_NAME = libglut.a
|
||||
GLW_LIB_NAME = libGLw.a
|
||||
OSMESA_LIB_NAME = libOSMesa.a
|
||||
|
||||
|
||||
ASM_SOURCES = $(X86_SOURCES) $(X86_API)
|
||||
|
||||
|
||||
# Library/program dependencies (static libs don't have dependencies)
|
||||
GL_LIB_DEPS =
|
||||
OSMESA_LIB_DEPS =
|
||||
GLU_LIB_DEPS =
|
||||
GLUT_LIB_DEPS =
|
||||
GLW_LIB_DEPS =
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm -lstdc++
|
||||
|
||||
@@ -9,7 +9,7 @@ CC = cc
|
||||
CFLAGS = -Xa -xO3 -xpentium -KPIC -I/usr/openwin/include -DUSE_XSHM
|
||||
MKLIB_OPTIONS = -static
|
||||
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm -lglut -lGLU -lGL
|
||||
|
||||
GL_LIB_NAME = libGL.a
|
||||
GLU_LIB_NAME = libGLU.a
|
||||
|
||||
@@ -14,68 +14,77 @@ Quick & dirty start:
|
||||
|
||||
|
||||
|
||||
Contact:
|
||||
--------
|
||||
|
||||
Daniel Borca <dborca@users.sourceforge.net>
|
||||
|
||||
|
||||
|
||||
WARNING! The info below this line is outdated (yet some of it useful). WARNING!
|
||||
*******************************************************************************
|
||||
The Mingw port for Mesa 3-D Graphics Library was created August 30, 1998 by Paul Garceau.
|
||||
|
||||
|
||||
|
||||
August 30, 1998 -- Paul Garceau
|
||||
Updated January 13, 2000 -- Paul Garceau (pgarceau@teleport.com)
|
||||
Updated January 13, 2000; June 3, 2005 -- Paul Garceau <pgarceau@users.sourceforge.net>
|
||||
|
||||
DISCLAIMER: I make this port of the Mesa 3-D Graphics Library as a service
|
||||
to the general public. I can, in no way support or make any guarantee that the
|
||||
build will work for your system.
|
||||
|
||||
The associated packages and batch files I have included as part of the GCC-2.95.2/Mingw32 extension are provided "As-is" with out any guarantee of support or functionality from this author.
|
||||
Acknowledgements:
|
||||
|
||||
Feel free to modify or change things as you see fit, just remember that
|
||||
I can't support any modifications you might want to make to the files which I
|
||||
have included OR the lgpl protected Mesa 3-D Graphics Library.
|
||||
Daniel Borca, whose work and commitment to maintaining the Mingw port of the Mesa 3-D Graphics Library has been, and will continue to be greatly appreciated by an overworked and underpaid developer such as myself.
|
||||
Without the creative inspiration and personal commitment provided by Mumit Khan, Jan-Jaap Vanderhagen and Colin Peters, Mingw would never have existed. Acknowledgements also need to be given to all of the developers who have worked on Mingw, Mesa and Msys over the years.
|
||||
Last, but certainly far from the least, Brian Paul, who has dedicated at least the last seven or eight years of his life to making Mesa 3-D Graphics Library what it is today and managing the development for all of those years.
|
||||
*********************************************************************************
|
||||
|
||||
I recommend using GCC-2.95.2/Mingw32 which is available at Mumit Khans' ftp site:
|
||||
Greetings,
|
||||
|
||||
(ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/)
|
||||
Feel free to modify or change things related to the Mingw build as you see fit, just remember that, the author of the current build may not be able to support any modifications you might want to make to the files which have been included for the build.
|
||||
|
||||
Mesa core components are licensed under XFree-86 (for more on licensing of Mesa 3-D Graphics Library, check out the Mesa homepage (http://www.mesa3d.org).
|
||||
|
||||
The Mingw generated libraries themselves are licensed under the GNU-LGPL license. Source code for Mingw can be found at http://www.mingw.org. For licensing terms on Mingw, please visit http://www.mingw.org.
|
||||
|
||||
It is recommended that you use the latest "stable" release of Mingw. "Candidates" are beta testing distributions for Mingw. Mingw is available at http://www.mingw.org.
|
||||
|
||||
This build has been tested under WinNT4/SP6. Win9x and WinNT5 remain untested by me. I have not tested any of the demos included with Mesa3d.
|
||||
|
||||
I recommend using the GCC-2.95.2/Mingw32.
|
||||
Installation:
|
||||
|
||||
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95.2
|
||||
This readme assumes that you already have extracted the necessary files to a working directory/folder that Mingw can use to build the Mesa3D libraries and that you know where that directory/folder is located on your Windows system. If you have any questions about how to set things up properly which is specific to Mesa3D, the folks on the Mesa3D mailing lists (http://www.mesa3d.org) would probably be happy to assist you. Also you can probably ask anyone on the Mingw mailing lists for any questions specific to Mingw (http://www.mingw.org)
|
||||
|
||||
Much thanks to the combined efforts of Mumit Khan, Jan-Jaap Vanderhagen
|
||||
and Colin Peters for making it possible for the Mingw32 toolchain to exist. Also, thanks go out to Stephane Rehel for the work that was completed on the Cygwin build.
|
||||
Targets and Environment variables used for Mingw build:
|
||||
|
||||
Installing GCC-2.95.2/Mingw32 Build:
|
||||
Before going into the actual build of the libraries, here is a list of available targets for the make process:
|
||||
|
||||
a) Open the file archive (either tar.gz or .zip extensions)
|
||||
"all" or "libgl" -- this target will build libopengl.a, a static library. It will not build the demos, etc.
|
||||
|
||||
b) Decide the directory you want to move the archived files to.
|
||||
clean -- this target will clean up most of the Mesa 3-D Graphics Library/object code from your hard drive.
|
||||
|
||||
realclean -- this target will clean up all of the Mesa 3D Graphics Library and the Mesa object code that it can find.
|
||||
|
||||
Environment Variables:
|
||||
|
||||
The environment variables are used to determine what sort of graphics driver support needs to be included in the finished Mesa 3-D Graphics Library.
|
||||
|
||||
GLIDE path to Glide3 SDK; used with FX.
|
||||
default = $(TOP)/glide3
|
||||
FX=1 build for 3dfx Glide3. Note that this disables
|
||||
compilation of most WMesa code and requires fxMesa.
|
||||
As a consequence, you'll need the Win32 Glide3
|
||||
library to build any application.
|
||||
default = no
|
||||
ICD=1 build the installable client driver interface
|
||||
(windows opengl driver interface)
|
||||
default = no
|
||||
X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
|
||||
default = no
|
||||
|
||||
d) Extract the files from the archive.
|
||||
|
||||
e) Edit the mingw32.bat file to accomodate your choice of directory structure.
|
||||
|
||||
%mesaroot%: This is your root directory (Mesa-3.3)
|
||||
%mesasrc%: This is the Mesa-3.3 src directory (Mesa-3.3\src)
|
||||
%mesalib%: This is where the build will put libGL.a and libGLU.a
|
||||
|
||||
Running the Build:
|
||||
|
||||
Open your Command Prompt or MS-DOS prompt.
|
||||
Go to your Mesa-3.3 'root' directory
|
||||
At the command line type: mingw32
|
||||
Launch Mingw.
|
||||
From the Windows Command Prompt:
|
||||
Set Environment Variables (as needed).
|
||||
"cd" to your Mesa3D 'root' directory.
|
||||
Enter "mingw32-make -f makefile.mgw <target>
|
||||
|
||||
That's all there is to it.
|
||||
|
||||
Enjoy!
|
||||
|
||||
Peace,
|
||||
|
||||
Paul G. (pgarceau@teleport.com)
|
||||
Paul G. <pgarceau@users.sourceforge.net>
|
||||
Daniel Borca <dborca@users.sourceforge.net>
|
||||
|
||||
@@ -1,108 +1,139 @@
|
||||
File: docs/README.WIN32
|
||||
|
||||
Last updated: Oct 01, 2004 - Karl Schultz - kschultz@users.sourceforge.net
|
||||
Last updated: Jul 01, 2005 - Karl Schultz - kschultz@users.sourceforge.net
|
||||
|
||||
Quick Start
|
||||
----- -----
|
||||
|
||||
Unzip both ZIP files (MesaLib and MesaDemos) into the same directory.
|
||||
The libs and demos build separately, so if you do not care about the
|
||||
demos, you do not have to unzip that zip file. But if you do, it does
|
||||
need to be unzipped into the same directory as the lib zip file because
|
||||
the demos depend on the libs.
|
||||
need to be unzipped into the same directory as the lib zip file
|
||||
because the demos depend on the libs.
|
||||
|
||||
The build system has been changed to use Microsoft Visual Studio project
|
||||
workspaces and projects. Makefiles are no longer shipped or supported, but
|
||||
can be generated from the projects using Visual Studio.
|
||||
The Windows build system uses Microsoft Visual Studio. Project files
|
||||
for a specific version of Visual Studio are in their own directory in
|
||||
the top-level "windows" directory. For example, Visual Studio 6 files
|
||||
are in windows/VC6. If a directory does not exist for your version of
|
||||
Visual Studio, you can try importing the project files from an earlier
|
||||
version of Visual Studio. At this time, project files exist for
|
||||
Version 6 and Version 7. The code has been built with a beta version
|
||||
of Version 8 and it runs on 64-bit Windows. If you want to try this,
|
||||
start by importing the VC7 files and create the 64-bit targets in the
|
||||
configuration manager.
|
||||
|
||||
The workspace and project files were created with Visual Studio 6, so that
|
||||
they can be used with VS6 and so that they can also be imported into VS 7.
|
||||
The project files to build the core Mesa library, Windows Mesa
|
||||
drivers, OSMesa, and GLU are in the mesa directory. The project files
|
||||
to build GLUT and some demo programs are in the progs directory.
|
||||
|
||||
Details and Notes
|
||||
Makefiles are no longer shipped or supported, but can be generated
|
||||
from the projects using Visual Studio.
|
||||
|
||||
- To build the Mesa libraries, open the Mesa.dsw workspace file
|
||||
in the top directory. You will need to build at least one
|
||||
driver. Currently, only the gdi and osmesa drivers are available.
|
||||
Select one or the other as the active project and build it.
|
||||
If you want glu, select the glu project as active and build that as well.
|
||||
|
||||
- Glut is no longer in the Mesa.dsw workspace. It is now built in
|
||||
the demo workspace (see below).
|
||||
|
||||
- The build process will create a lib directory in the top directory
|
||||
and will put the following files there as you build them:
|
||||
Windows Drivers
|
||||
------- -------
|
||||
|
||||
At this time, only the GDI driver is known to work, as it has been
|
||||
ported and rewritten to the latest Mesa DD interfaces. Source code
|
||||
also exists in the tree for other drivers in src/mesa/drivers/windows,
|
||||
but the status of this code is unknown.
|
||||
|
||||
The GDI driver operates basically by writing pixel spans into a DIB
|
||||
section and then blitting the DIB to the window. The driver was
|
||||
recently cleaned up and rewitten and so may have bugs or may be
|
||||
missing some functionality. The older versions of the CVS source may
|
||||
be useful in figuring out any problems, or report them to me.
|
||||
|
||||
To build Mesa with the GDI driver, build the mesa, gdi, and glu
|
||||
projects in the Visual Studio workspace found at
|
||||
|
||||
windows/VC6/mesa/mesa.dsw
|
||||
or
|
||||
windows/VC7/mesa/mesa.sln
|
||||
|
||||
The osmesa DLL can also be built with the osmesa project.
|
||||
|
||||
The build system creates a lib top-level directory and copies
|
||||
resulting LIB and DLL files to this lib directory. The files are:
|
||||
|
||||
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
|
||||
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
|
||||
|
||||
- Some users have reported problems building glu with VS7 after importing
|
||||
and converting the VS6 project files. The problem is caused by a custom
|
||||
build step that was put in place to work around a problem with VS6 not
|
||||
recognizing .cc files as C++ source files. It appears that VS7 can be
|
||||
configured to recognize .cc files as C++ files and so it compiles these
|
||||
glu files with the default settings, and does not use settings that are
|
||||
required to compile the files correctly. The easiest way to solve the
|
||||
problem is to remove the .cc files from the glu project. This does not
|
||||
delete the files, but removes them from the project so that VS does not
|
||||
try to compile them at all. This allows the custom build step to compile
|
||||
the files with the proper settings.
|
||||
If the MesaDemos ZIP file was extracted, the DLL files are also copied
|
||||
to the demos directory. This facilitates running the demos as described
|
||||
below.
|
||||
|
||||
- After building, you can copy the above DLL files to a place in your PATH
|
||||
such as $SystemRoot/SYSTEM32. If you don't like putting things in a
|
||||
system directory, place them in the same directory as the executable(s).
|
||||
Be careful about accidentially overwriting files of the same name in
|
||||
the SYSTEM32 directory.
|
||||
|
||||
- Build the demos by opening the appropriate *.dsw file in the
|
||||
progs directory tree. For example, to build the demos, use
|
||||
progs/demos/Windows/demos.dsw. The Windows directory contains
|
||||
the workspace and all the projects for each demo program. Each
|
||||
project places the executable in the same directory as its source
|
||||
code, which is required for some demos.
|
||||
GLUT and Demos
|
||||
---- --- -----
|
||||
|
||||
- The demo projects also copy the Mesa library DLL files from the lib
|
||||
directory into the same directory as the demo executables, so that
|
||||
the demos use the Mesa libs you just built.
|
||||
A Visual Studio workspace can be found at
|
||||
|
||||
- The DLL files are built so that the external entry points use the
|
||||
stdcall calling convention.
|
||||
windows/VC6/progs/progs.dsw
|
||||
or
|
||||
windows/VC7/progs/progs.sln
|
||||
|
||||
- Static LIB files are not built. The LIB files that are built with
|
||||
are the linker import files associated with the DLL files.
|
||||
It can be used to build GLUT and a few demos. The GLUT lib and DLL
|
||||
are copied to the top-level lib directory, along with the Mesa libs.
|
||||
|
||||
- The si-glu sources are used to build the GLU libs. This was done
|
||||
mainly to get the better tessellator code.
|
||||
The demo build system expects to find the LIB files in the top level
|
||||
lib directory, so you must build the Mesa libs first. The demo
|
||||
executables are placed in the demos directory, because some of them
|
||||
rely on data files found there. Also, the Mesa lib DLL's were copied
|
||||
there by the Mesa lib build process. Therefore, you should be able to
|
||||
simply run the demo executables from the demo directory.
|
||||
|
||||
- The Windows driver (in src/Windows) builds and runs at least at
|
||||
a minimal level. I modified this driver to work with the new
|
||||
Mesa 4.0 code and driver architecture, but I did not do a great
|
||||
deal of optimization and testing. There are many opportunities
|
||||
for optimization, many of which can be done by coding more specific
|
||||
paths for the rasterizers. See src/osmesa/osmesa.c for some good
|
||||
examples.
|
||||
If you want to run the demos from the Visual Studio, you may have to
|
||||
change the startup directory and explicitly state where the executables are.
|
||||
|
||||
- There is DirectDraw support in the Windows driver, updated by
|
||||
Daniel Slater. You'll need to uncomment the #define DDRAW line
|
||||
in src/Windows/wmesadef.h and add ddraw.lib to the list of libraries.
|
||||
On some systems, you will acheive significantly higher framerates
|
||||
with DirectDraw.
|
||||
|
||||
- Some of the more specialized code like FX drivers, stereo, and
|
||||
parallel support isn't compiled or tested. I left much of this
|
||||
code alone, but it may need some work to get it 'turned on' again.
|
||||
Build System Notes
|
||||
----- ------ -----
|
||||
|
||||
- No assembly code is compiled or assembled. Again, this may need
|
||||
some work to turn it back on or use it again.
|
||||
VC6
|
||||
---
|
||||
|
||||
- To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
|
||||
to the project settings. You will also need to edit src/mesa.def to change
|
||||
all the gl* symbols to mgl*. Because this is easy to do with a global
|
||||
replace operation in a text editor, no additional mangled version of mesa.def
|
||||
is maintained or shipped.
|
||||
Visual Studio 6 does not recognize files with the .cc extension as C++
|
||||
language files, without a lot of unnatural tweaking. So, the VC6
|
||||
build process uses custom build steps to compile these files in the
|
||||
GLU library.
|
||||
|
||||
|
||||
VC7
|
||||
---
|
||||
|
||||
The above-mentioned .cc problem does not exist in this version.
|
||||
|
||||
|
||||
General
|
||||
-------
|
||||
|
||||
After building, you can copy the above DLL files to a place in your
|
||||
PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
|
||||
in a system directory, place them in the same directory as the
|
||||
executable(s). Be careful about accidentially overwriting files of
|
||||
the same name in the SYSTEM32 directory.
|
||||
|
||||
The DLL files are built so that the external entry points use the
|
||||
stdcall calling convention.
|
||||
|
||||
Static LIB files are not built. The LIB files that are built with are
|
||||
the linker import files associated with the DLL files.
|
||||
|
||||
The si-glu sources are used to build the GLU libs. This was done
|
||||
mainly to get the better tessellator code.
|
||||
|
||||
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
|
||||
to the project settings. You will also need to edit src/mesa.def to
|
||||
change all the gl* symbols to mgl*. Because this is easy to do with a
|
||||
global replace operation in a text editor, no additional mangled
|
||||
version of mesa.def is maintained or shipped.
|
||||
|
||||
If you have a Windows-related build problem or question, it is
|
||||
probably better to direct it to me (kschultz@users.sourceforge.net),
|
||||
rather than directly to the other Mesa developers. I will help you
|
||||
as much as I can. I also monitor the Mesa mailing lists and will
|
||||
answer questions in this area there as well.
|
||||
rather than directly to the other Mesa developers. I will help you as
|
||||
much as I can. I also monitor the Mesa mailing lists and will answer
|
||||
questions in this area there as well.
|
||||
|
||||
|
||||
Karl Schultz
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
Mesa 6.3 release notes
|
||||
|
||||
month day, 2004
|
||||
July 20, 2004
|
||||
|
||||
PLEASE READ!!!!
|
||||
|
||||
@@ -28,7 +28,8 @@ GL_OES_read_format - allows one to query the fastest glReadPixels format
|
||||
GL_ARB_pixel_buffer_object - buffer objects for pixel read/write functions.
|
||||
|
||||
GL_EXT_framebuffer_object - allows render-to-texture and provides a
|
||||
window-system indepedent Pbuffer facility
|
||||
window-system indepedent Pbuffer facility.
|
||||
The Mesa CVS tree contains a couple tests of this extension.
|
||||
|
||||
DirectFB driver, contributed by Claudio Ciccani. See docs/README.directfb
|
||||
for details.
|
||||
@@ -63,11 +64,25 @@ contexts so they can't be deleted until they're unbound in _all_ contexts.
|
||||
|
||||
|
||||
|
||||
GL_EXT_framebuffer_object changes
|
||||
---------------------------------
|
||||
|
||||
Implementing this extension involved changing a lot of code (for the better).
|
||||
|
||||
The gl_framebuffer object now a collection of gl_renderbuffer objects.
|
||||
Renderbuffers may store colors, stencil indices, or depth values. The
|
||||
gl_framebuffer and gl_renderbuffer types are object-oriented in design.
|
||||
|
||||
All the old RGB, color index, stencil and depth-related span functions for
|
||||
reading/writing pixels from/to buffers has changed. Now, all pixels are
|
||||
read/written through a set of common renderbuffer functions (methods).
|
||||
|
||||
Most device drivers have been updated for these changes, but some haven't.
|
||||
|
||||
|
||||
To Do before release
|
||||
--------------------
|
||||
Fix dinoshade bug
|
||||
|
||||
To Do (someday) items
|
||||
---------------------
|
||||
Switch to freeglut
|
||||
Increase MAX_DRAWBUFFERS
|
||||
driver hooks for BeginQuery/EndQuery
|
||||
@@ -77,7 +92,7 @@ To Do before release
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
The main/get.c file is now generated with a Python script.
|
||||
The main/get.c file is now generated with a Python script (get_gen.py).
|
||||
|
||||
|
||||
|
||||
@@ -97,4 +112,4 @@ D3D needs updating
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-6.3,v 3.9 2005/05/04 20:11:35 brianp Exp $
|
||||
$Id: RELNOTES-6.3,v 3.12 2005/07/20 18:07:11 brianp Exp $
|
||||
|
||||
@@ -1314,20 +1314,39 @@ Mesa Version History
|
||||
- bug reports should to go bugzilla.freedesktop.org
|
||||
|
||||
|
||||
6.3 Month day, 2004
|
||||
6.3 July 20, 2004
|
||||
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
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<!--Override a few values from the style sheet: -->
|
||||
<style>
|
||||
<!--
|
||||
@@ -40,6 +38,7 @@ a:visited {
|
||||
<b>Download / Install</b>
|
||||
<ul>
|
||||
<li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Stable Release (6.2.1)</a>
|
||||
<li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Devel Release (6.3)</a>
|
||||
<li><a href="download.html" target="MainFrame">Downloading/Unpacking</a>
|
||||
<li><a href="install.html" target="MainFrame">Compilation/Installation</a>
|
||||
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>
|
||||
|
||||
@@ -82,7 +82,7 @@ my work hours at the Space Science and Engineering Center at the University
|
||||
of Wisconsin in Madison. My supervisor, Bill Hibbard, lets me do this because
|
||||
Mesa is now being using for the <a href="http://www.ssec.wisc.edu/%7Ebillh/vis.html" target="_parent">Vis5D</a> project.
|
||||
</p><p>
|
||||
October 1996: Mesa 2.0 is released. It implementes the OpenGL 1.1 specification.
|
||||
October 1996: Mesa 2.0 is released. It implements the OpenGL 1.1 specification.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -134,8 +134,8 @@ GL_ARB_fragment_program extensions.
|
||||
|
||||
|
||||
<p>
|
||||
Ongoing: Mesa is used as the core of many hardware OpenGL drivers for XFree86
|
||||
within the
|
||||
Ongoing: Mesa is used as the core of many hardware OpenGL drivers for
|
||||
the XFree86 X.org X servers within the
|
||||
<A href="http://dri.sourceforge.net/" target="_parent">DRI project</A>.
|
||||
I continue to enhance Mesa with new extensions and features.
|
||||
</p>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* Mesa CSS */
|
||||
body {
|
||||
background-color: #ffffff;
|
||||
/*background-color: #55bbff;*/
|
||||
font: 14px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;
|
||||
color: black;
|
||||
link: #111188;
|
||||
|
||||
@@ -6,9 +6,54 @@
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>News</H1>
|
||||
|
||||
|
||||
<h2>July 20, 2005</h2>
|
||||
<p>
|
||||
Mesa 6.3 has been released.
|
||||
This is a development release with new features, changes and bug fixes.
|
||||
</p>
|
||||
<pre>
|
||||
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.)
|
||||
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
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>December 9, 2004</h2>
|
||||
<p>
|
||||
Mesa 6.2.1 has been released.
|
||||
@@ -960,6 +1005,6 @@ source code</a>.</p>
|
||||
|
||||
|
||||
<hr>
|
||||
$Id: news.html,v 3.19 2005/05/05 14:18:31 brianp Exp $
|
||||
$Id: news.html,v 3.21 2005/07/20 18:07:11 brianp Exp $
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
127
include/GL/gl.h
127
include/GL/gl.h
@@ -2,7 +2,7 @@
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.3
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -2213,13 +2213,9 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid
|
||||
|
||||
typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback,
|
||||
GLvoid *data);
|
||||
GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name,
|
||||
GLfloat *v);
|
||||
GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v);
|
||||
|
||||
#endif /* GL_MESA_program_debug */
|
||||
|
||||
@@ -2235,123 +2231,6 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen
|
||||
#endif /* GL_ATI_blend_equation_separate */
|
||||
|
||||
|
||||
/* XXX this is temporary here! */
|
||||
#ifndef GL_EXT_framebuffer_object
|
||||
#define GL_EXT_framebuffer_object
|
||||
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
glIsRenderbufferEXT(GLuint renderbuffer);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glBindRenderbufferEXT(GLenum target, GLuint renderbuffer);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glDeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glRenderbufferStorageEXT(GLenum target, GLenum internalformat,
|
||||
GLsizei width, GLsizei height);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params);
|
||||
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
glIsFramebufferEXT(GLuint framebuffer);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glBindFramebufferEXT(GLenum target, GLuint framebuffer);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glDeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glGenFramebuffersEXT(GLsizei n, GLuint *framebuffers);
|
||||
|
||||
GLAPI GLenum GLAPIENTRY
|
||||
glCheckFramebufferStatusEXT(GLenum target);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glFramebufferTexture1DEXT(GLenum target, GLenum attachment,
|
||||
GLenum textarget, GLuint texture, GLint level);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glFramebufferTexture2DEXT(GLenum target, GLenum attachment,
|
||||
GLenum textarget, GLuint texture, GLint level);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glFramebufferTexture3DEXT(GLenum target, GLenum attachment,
|
||||
GLenum textarget, GLuint texture,
|
||||
GLint level, GLint zoffset);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glFramebufferRenderbufferEXT(GLenum target, GLenum attachment,
|
||||
GLenum renderbuffertarget,
|
||||
GLuint renderbuffer);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
|
||||
GLenum pname, GLint *params);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glGenerateMipmapEXT(GLenum target);
|
||||
|
||||
|
||||
#define GL_FRAMEBUFFER_EXT 0x8D40
|
||||
#define GL_RENDERBUFFER_EXT 0x8D41
|
||||
#define GL_STENCIL_INDEX_EXT 0x8D45
|
||||
#define GL_STENCIL_INDEX1_EXT 0x8D46
|
||||
#define GL_STENCIL_INDEX4_EXT 0x8D47
|
||||
#define GL_STENCIL_INDEX8_EXT 0x8D48
|
||||
#define GL_STENCIL_INDEX16_EXT 0x8D49
|
||||
#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
|
||||
#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
|
||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
|
||||
#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
|
||||
#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
|
||||
#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
|
||||
#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
|
||||
#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
|
||||
#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
|
||||
#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
|
||||
#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
|
||||
#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
|
||||
#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
|
||||
#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
|
||||
#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
|
||||
#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
|
||||
#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
|
||||
#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
|
||||
#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
|
||||
#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
|
||||
#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
|
||||
#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
|
||||
#define GL_FRAMEBUFFER_STATUS_ERROR_EXT 0x8CDE
|
||||
#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
|
||||
#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
|
||||
#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
|
||||
#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
|
||||
|
||||
#endif /* GL_EXT_framebuffer_object */
|
||||
|
||||
|
||||
|
||||
/**
|
||||
** NOTE!!!!! If you add new functions to this file, or update
|
||||
** glext.h be sure to regenerate the gl_mangle.h file. See comments
|
||||
|
||||
@@ -62,11 +62,13 @@
|
||||
#define glBindBufferARB MANGLE(BindBufferARB)
|
||||
#define glBindBuffer MANGLE(BindBuffer)
|
||||
#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
|
||||
#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
|
||||
#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
|
||||
#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT)
|
||||
#define glBindParameterEXT MANGLE(BindParameterEXT)
|
||||
#define glBindProgramARB MANGLE(BindProgramARB)
|
||||
#define glBindProgramNV MANGLE(BindProgramNV)
|
||||
#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT)
|
||||
#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
|
||||
#define glBindTextureEXT MANGLE(BindTextureEXT)
|
||||
#define glBindTexture MANGLE(BindTexture)
|
||||
@@ -102,6 +104,7 @@
|
||||
#define glBufferSubData MANGLE(BufferSubData)
|
||||
#define glCallList MANGLE(CallList)
|
||||
#define glCallLists MANGLE(CallLists)
|
||||
#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT)
|
||||
#define glClampColorARB MANGLE(ClampColorARB)
|
||||
#define glClearAccum MANGLE(ClearAccum)
|
||||
#define glClearColor MANGLE(ClearColor)
|
||||
@@ -244,6 +247,7 @@
|
||||
#define glDeleteFencesAPPLE MANGLE(DeleteFencesAPPLE)
|
||||
#define glDeleteFencesNV MANGLE(DeleteFencesNV)
|
||||
#define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI)
|
||||
#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT)
|
||||
#define glDeleteLists MANGLE(DeleteLists)
|
||||
#define glDeleteObjectARB MANGLE(DeleteObjectARB)
|
||||
#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
|
||||
@@ -252,6 +256,7 @@
|
||||
#define glDeleteProgramsNV MANGLE(DeleteProgramsNV)
|
||||
#define glDeleteQueriesARB MANGLE(DeleteQueriesARB)
|
||||
#define glDeleteQueries MANGLE(DeleteQueries)
|
||||
#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
|
||||
#define glDeleteShader MANGLE(DeleteShader)
|
||||
#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
|
||||
#define glDeleteTextures MANGLE(DeleteTextures)
|
||||
@@ -365,6 +370,10 @@
|
||||
#define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX)
|
||||
#define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX)
|
||||
#define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX)
|
||||
#define glFramebufferRenderbufferEXT MANGLE(FramebufferRenderbufferEXT)
|
||||
#define glFramebufferTexture1DEXT MANGLE(FramebufferTexture1DEXT)
|
||||
#define glFramebufferTexture2DEXT MANGLE(FramebufferTexture2DEXT)
|
||||
#define glFramebufferTexture3DEXT MANGLE(FramebufferTexture3DEXT)
|
||||
#define glFrameZoomSGIX MANGLE(FrameZoomSGIX)
|
||||
#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI)
|
||||
#define glFrontFace MANGLE(FrontFace)
|
||||
@@ -372,15 +381,18 @@
|
||||
#define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX)
|
||||
#define glGenBuffersARB MANGLE(GenBuffersARB)
|
||||
#define glGenBuffers MANGLE(GenBuffers)
|
||||
#define glGenerateMipmapEXT MANGLE(GenerateMipmapEXT)
|
||||
#define glGenFencesAPPLE MANGLE(GenFencesAPPLE)
|
||||
#define glGenFencesNV MANGLE(GenFencesNV)
|
||||
#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI)
|
||||
#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT)
|
||||
#define glGenLists MANGLE(GenLists)
|
||||
#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV)
|
||||
#define glGenProgramsARB MANGLE(GenProgramsARB)
|
||||
#define glGenProgramsNV MANGLE(GenProgramsNV)
|
||||
#define glGenQueriesARB MANGLE(GenQueriesARB)
|
||||
#define glGenQueries MANGLE(GenQueries)
|
||||
#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT)
|
||||
#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
|
||||
#define glGenTexturesEXT MANGLE(GenTexturesEXT)
|
||||
#define glGenTextures MANGLE(GenTextures)
|
||||
@@ -438,6 +450,7 @@
|
||||
#define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX)
|
||||
#define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX)
|
||||
#define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX)
|
||||
#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT)
|
||||
#define glGetHandleARB MANGLE(GetHandleARB)
|
||||
#define glGetHistogramEXT MANGLE(GetHistogramEXT)
|
||||
#define glGetHistogram MANGLE(GetHistogram)
|
||||
@@ -502,6 +515,7 @@
|
||||
#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV)
|
||||
#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
|
||||
#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
|
||||
#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA)
|
||||
#define glGetProgramStringARB MANGLE(GetProgramStringARB)
|
||||
#define glGetProgramStringNV MANGLE(GetProgramStringNV)
|
||||
#define glGetQueryivARB MANGLE(GetQueryivARB)
|
||||
@@ -510,6 +524,7 @@
|
||||
#define glGetQueryObjectiv MANGLE(GetQueryObjectiv)
|
||||
#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
|
||||
#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
|
||||
#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
|
||||
#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
|
||||
#define glGetSeparableFilter MANGLE(GetSeparableFilter)
|
||||
#define glGetShaderInfoLog MANGLE(GetShaderInfoLog)
|
||||
@@ -601,6 +616,7 @@
|
||||
#define glIsEnabled MANGLE(IsEnabled)
|
||||
#define glIsFenceAPPLE MANGLE(IsFenceAPPLE)
|
||||
#define glIsFenceNV MANGLE(IsFenceNV)
|
||||
#define glIsFramebufferEXT MANGLE(IsFramebufferEXT)
|
||||
#define glIsList MANGLE(IsList)
|
||||
#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
|
||||
#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
|
||||
@@ -609,6 +625,7 @@
|
||||
#define glIsProgramNV MANGLE(IsProgramNV)
|
||||
#define glIsQueryARB MANGLE(IsQueryARB)
|
||||
#define glIsQuery MANGLE(IsQuery)
|
||||
#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
|
||||
#define glIsShader MANGLE(IsShader)
|
||||
#define glIsTextureEXT MANGLE(IsTextureEXT)
|
||||
#define glIsTexture MANGLE(IsTexture)
|
||||
@@ -836,6 +853,7 @@
|
||||
#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV)
|
||||
#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT)
|
||||
#define glPrioritizeTextures MANGLE(PrioritizeTextures)
|
||||
#define glProgramCallbackMESA MANGLE(ProgramCallbackMESA)
|
||||
#define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB)
|
||||
#define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB)
|
||||
#define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB)
|
||||
@@ -895,6 +913,7 @@
|
||||
#define glRects MANGLE(Rects)
|
||||
#define glRectsv MANGLE(Rectsv)
|
||||
#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
|
||||
#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
|
||||
#define glRenderMode MANGLE(RenderMode)
|
||||
#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN)
|
||||
#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN)
|
||||
@@ -1003,6 +1022,7 @@
|
||||
#define glStencilOpSeparateATI MANGLE(StencilOpSeparateATI)
|
||||
#define glStencilOpSeparate MANGLE(StencilOpSeparate)
|
||||
#define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX)
|
||||
#define glStringMarkerGREMEDY MANGLE(StringMarkerGREMEDY)
|
||||
#define glSwizzleEXT MANGLE(SwizzleEXT)
|
||||
#define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX)
|
||||
#define glTangent3bEXT MANGLE(Tangent3bEXT)
|
||||
|
||||
@@ -52,9 +52,9 @@ extern "C" {
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glext.h last updated 2005/01/20 */
|
||||
/* glext.h last updated 2005/06/20 */
|
||||
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
|
||||
#define GL_GLEXT_VERSION 26
|
||||
#define GL_GLEXT_VERSION 29
|
||||
|
||||
#ifndef GL_VERSION_1_2
|
||||
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
|
||||
@@ -2980,6 +2980,64 @@ extern "C" {
|
||||
/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_object
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
|
||||
#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
|
||||
#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
|
||||
#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
|
||||
#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
|
||||
#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
|
||||
#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
|
||||
#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
|
||||
#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
|
||||
#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
|
||||
#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
|
||||
#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
|
||||
#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
|
||||
#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
|
||||
#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
|
||||
#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
|
||||
#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
|
||||
#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
|
||||
#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
|
||||
#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
|
||||
#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
|
||||
#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
|
||||
#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
|
||||
#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
|
||||
#define GL_FRAMEBUFFER_EXT 0x8D40
|
||||
#define GL_RENDERBUFFER_EXT 0x8D41
|
||||
#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
|
||||
#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
|
||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
|
||||
#define GL_STENCIL_INDEX1_EXT 0x8D46
|
||||
#define GL_STENCIL_INDEX4_EXT 0x8D47
|
||||
#define GL_STENCIL_INDEX8_EXT 0x8D48
|
||||
#define GL_STENCIL_INDEX16_EXT 0x8D49
|
||||
#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
|
||||
#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
|
||||
#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
|
||||
#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
|
||||
#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
|
||||
#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
|
||||
#endif
|
||||
|
||||
#ifndef GL_GREMEDY_string_marker
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
@@ -6381,6 +6439,54 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLen
|
||||
#define GL_NV_vertex_program3 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_object
|
||||
#define GL_EXT_framebuffer_object 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint);
|
||||
GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *);
|
||||
GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *);
|
||||
GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint);
|
||||
GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);
|
||||
GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum);
|
||||
GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint);
|
||||
GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGenerateMipmapEXT (GLenum);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
|
||||
typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
|
||||
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
|
||||
typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
|
||||
typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
|
||||
typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
|
||||
typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
|
||||
#endif
|
||||
|
||||
#ifndef GL_GREMEDY_string_marker
|
||||
#define GL_GREMEDY_string_marker 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ static GLint Mode = 4;
|
||||
static GLfloat Black[4] = {0.0, 0.0, 0.0, 1.0};
|
||||
static GLfloat White[4] = {1.0, 1.0, 1.0, 1.0};
|
||||
|
||||
static GLboolean smooth = 1;
|
||||
|
||||
static void
|
||||
Idle(void)
|
||||
@@ -143,9 +144,16 @@ static void Key( unsigned char key, int x, int y )
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
case 's':
|
||||
smooth = !smooth;
|
||||
if (smooth)
|
||||
glShadeModel(GL_SMOOTH);
|
||||
else
|
||||
glShadeModel(GL_FLAT);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
@@ -175,6 +183,8 @@ static void Init( void )
|
||||
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
|
||||
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, Black);
|
||||
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
glMaterialfv(GL_FRONT, GL_DIFFUSE, White);
|
||||
glMaterialfv(GL_FRONT, GL_SPECULAR, White);
|
||||
glMaterialf(GL_FRONT, GL_SHININESS, 20.0);
|
||||
|
||||
@@ -12,7 +12,8 @@ PROGRAMS = \
|
||||
demo1 \
|
||||
demo2 \
|
||||
demo3 \
|
||||
eglinfo
|
||||
eglinfo \
|
||||
eglgears
|
||||
|
||||
|
||||
.c.o:
|
||||
@@ -51,6 +52,12 @@ eglinfo.o: eglinfo.c $(HEADERS)
|
||||
$(CC) -c $(CFLAGS) -I$(TOP)/include eglinfo.c
|
||||
|
||||
|
||||
eglgears: eglgears.o $(LIB_DIR)/libEGL.so
|
||||
$(CC) eglgears.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
|
||||
|
||||
eglgears.o: eglgears.c $(HEADERS)
|
||||
$(CC) -c $(CFLAGS) -I$(TOP)/include eglgears.c
|
||||
|
||||
|
||||
clean:
|
||||
rm -f *.o *~
|
||||
|
||||
@@ -92,7 +92,6 @@ main(int argc, char *argv[])
|
||||
EGLContext ctx;
|
||||
EGLSurface pbuffer;
|
||||
EGLConfig configs[10];
|
||||
EGLint numConfigs, i;
|
||||
EGLBoolean b;
|
||||
const EGLint pbufAttribs[] = {
|
||||
EGL_WIDTH, 500,
|
||||
|
||||
@@ -56,6 +56,7 @@ static void Reshape(int width, int height)
|
||||
windH = (GLint)height;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void RotateColorMask(void)
|
||||
{
|
||||
static GLint rotation = 0;
|
||||
@@ -80,6 +81,7 @@ static void RotateColorMask(void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void Viewport(GLint row, GLint column)
|
||||
{
|
||||
|
||||
446
progs/egl/eglgears.c
Normal file
446
progs/egl/eglgears.c
Normal file
@@ -0,0 +1,446 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is a port of the infamous "glxgears" demo to straight EGL
|
||||
* Port by Dane Rushton 10 July 2005
|
||||
*
|
||||
* No command line options.
|
||||
* Program runs for 5 seconds then exits, outputing framerate to console
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GLES/egl.h>
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#define BENCHMARK
|
||||
|
||||
#ifdef BENCHMARK
|
||||
|
||||
/* XXX this probably isn't very portable */
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* return current time (in seconds) */
|
||||
static double
|
||||
current_time(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
#ifdef __VMS
|
||||
(void) gettimeofday(&tv, NULL );
|
||||
#else
|
||||
struct timezone tz;
|
||||
(void) gettimeofday(&tv, &tz);
|
||||
#endif
|
||||
return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
|
||||
}
|
||||
|
||||
#else /*BENCHMARK*/
|
||||
|
||||
/* dummy */
|
||||
static double
|
||||
current_time(void)
|
||||
{
|
||||
/* update this function for other platforms! */
|
||||
static double t = 0.0;
|
||||
static int warn = 1;
|
||||
if (warn) {
|
||||
fprintf(stderr, "Warning: current_time() not implemented!!\n");
|
||||
warn = 0;
|
||||
}
|
||||
return t += 1.0;
|
||||
}
|
||||
|
||||
#endif /*BENCHMARK*/
|
||||
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265
|
||||
#endif
|
||||
|
||||
|
||||
static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
|
||||
static GLint gear1, gear2, gear3;
|
||||
static GLfloat angle = 0.0;
|
||||
|
||||
static GLfloat eyesep = 5.0; /* Eye separation. */
|
||||
static GLfloat fix_point = 40.0; /* Fixation point distance. */
|
||||
static GLfloat left, right, asp; /* Stereo frustum params. */
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Draw a gear wheel. You'll probably want to call this function when
|
||||
* building a display list since we do a lot of trig here.
|
||||
*
|
||||
* Input: inner_radius - radius of hole at center
|
||||
* outer_radius - radius at center of teeth
|
||||
* width - width of gear
|
||||
* teeth - number of teeth
|
||||
* tooth_depth - depth of tooth
|
||||
*/
|
||||
static void
|
||||
gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
|
||||
GLint teeth, GLfloat tooth_depth)
|
||||
{
|
||||
GLint i;
|
||||
GLfloat r0, r1, r2;
|
||||
GLfloat angle, da;
|
||||
GLfloat u, v, len;
|
||||
|
||||
r0 = inner_radius;
|
||||
r1 = outer_radius - tooth_depth / 2.0;
|
||||
r2 = outer_radius + tooth_depth / 2.0;
|
||||
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
|
||||
glNormal3f(0.0, 0.0, 1.0);
|
||||
|
||||
/* draw front face */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
|
||||
if (i < teeth) {
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
|
||||
width * 0.5);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw front sides of teeth */
|
||||
glBegin(GL_QUADS);
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
for (i = 0; i < teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
|
||||
width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
|
||||
width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
glNormal3f(0.0, 0.0, -1.0);
|
||||
|
||||
/* draw back face */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
|
||||
if (i < teeth) {
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
|
||||
-width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw back sides of teeth */
|
||||
glBegin(GL_QUADS);
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
for (i = 0; i < teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
|
||||
-width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
|
||||
-width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw outward faces of teeth */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i < teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
|
||||
u = r2 * cos(angle + da) - r1 * cos(angle);
|
||||
v = r2 * sin(angle + da) - r1 * sin(angle);
|
||||
len = sqrt(u * u + v * v);
|
||||
u /= len;
|
||||
v /= len;
|
||||
glNormal3f(v, -u, 0.0);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
|
||||
glNormal3f(cos(angle), sin(angle), 0.0);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
|
||||
width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
|
||||
-width * 0.5);
|
||||
u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
|
||||
v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
|
||||
glNormal3f(v, -u, 0.0);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
|
||||
width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
|
||||
-width * 0.5);
|
||||
glNormal3f(cos(angle), sin(angle), 0.0);
|
||||
}
|
||||
|
||||
glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
|
||||
glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
|
||||
|
||||
glEnd();
|
||||
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
/* draw inside radius cylinder */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
glNormal3f(-cos(angle), -sin(angle), 0.0);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(view_rotx, 1.0, 0.0, 0.0);
|
||||
glRotatef(view_roty, 0.0, 1.0, 0.0);
|
||||
glRotatef(view_rotz, 0.0, 0.0, 1.0);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.0, -2.0, 0.0);
|
||||
glRotatef(angle, 0.0, 0.0, 1.0);
|
||||
glCallList(gear1);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(3.1, -2.0, 0.0);
|
||||
glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
|
||||
glCallList(gear2);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.1, 4.2, 0.0);
|
||||
glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
|
||||
glCallList(gear3);
|
||||
glPopMatrix();
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
/* new window size or exposure */
|
||||
static void
|
||||
reshape(int width, int height)
|
||||
{
|
||||
glViewport(0, 0, (GLint) width, (GLint) height);
|
||||
|
||||
GLfloat h = (GLfloat) height / (GLfloat) width;
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -40.0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
init(void)
|
||||
{
|
||||
static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 };
|
||||
static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
|
||||
static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
|
||||
static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
|
||||
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, pos);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
/* make the gears */
|
||||
gear1 = glGenLists(1);
|
||||
glNewList(gear1, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
|
||||
gear(1.0, 4.0, 1.0, 20, 0.7);
|
||||
glEndList();
|
||||
|
||||
gear2 = glGenLists(1);
|
||||
glNewList(gear2, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
|
||||
gear(0.5, 2.0, 2.0, 10, 0.7);
|
||||
glEndList();
|
||||
|
||||
gear3 = glGenLists(1);
|
||||
glNewList(gear3, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
|
||||
gear(1.3, 2.0, 0.5, 10, 0.7);
|
||||
glEndList();
|
||||
|
||||
glEnable(GL_NORMALIZE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
|
||||
{
|
||||
double st = current_time();
|
||||
double ct = st;
|
||||
int frames = 0;
|
||||
while (ct - st < ttr)
|
||||
{
|
||||
double tt = current_time();
|
||||
double dt = tt - ct;
|
||||
ct = tt;
|
||||
|
||||
/* advance rotation for next frame */
|
||||
angle += 70.0 * dt; /* 70 degrees per second */
|
||||
if (angle > 3600.0)
|
||||
angle -= 3600.0;
|
||||
|
||||
draw();
|
||||
|
||||
// DBR : Swap the Buffers
|
||||
eglSwapBuffers(dpy, surf);
|
||||
|
||||
|
||||
frames++;
|
||||
}
|
||||
|
||||
GLfloat seconds = ct - st;
|
||||
GLfloat fps = frames / seconds;
|
||||
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
|
||||
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int maj, min;
|
||||
EGLContext ctx;
|
||||
EGLSurface screen_surf;
|
||||
EGLConfig configs[10];
|
||||
EGLint numConfigs, i;
|
||||
EGLBoolean b;
|
||||
|
||||
const EGLint screenAttribs[] = {
|
||||
EGL_WIDTH, 1024,
|
||||
EGL_HEIGHT, 768,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
EGLModeMESA mode;
|
||||
EGLScreenMESA screen;
|
||||
EGLint count;
|
||||
GLboolean printInfo = GL_FALSE;
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if (strcmp(argv[i], "-info") == 0)
|
||||
{
|
||||
printInfo = GL_TRUE;
|
||||
}
|
||||
else
|
||||
printf("Warning: unknown parameter: %s\n", argv[i]);
|
||||
}
|
||||
|
||||
// DBR : Create EGL context/surface etc
|
||||
EGLDisplay d = eglGetDisplay("!fb_dri");
|
||||
assert(d);
|
||||
|
||||
if (!eglInitialize(d, &maj, &min)) {
|
||||
printf("demo: eglInitialize failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("EGL version = %d.%d\n", maj, min);
|
||||
printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
|
||||
|
||||
eglGetConfigs(d, configs, 10, &numConfigs);
|
||||
eglGetScreensMESA(d, &screen, 1, &count);
|
||||
eglGetModesMESA(d, screen, &mode, 1, &count);
|
||||
|
||||
ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
|
||||
if (ctx == EGL_NO_CONTEXT) {
|
||||
printf("failed to create context\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
|
||||
if (screen_surf == EGL_NO_SURFACE) {
|
||||
printf("failed to create screen surface\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
eglShowSurfaceMESA(d, screen, screen_surf, mode);
|
||||
|
||||
b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
|
||||
if (!b) {
|
||||
printf("make current failed\n");
|
||||
return 0;
|
||||
}
|
||||
// DBR
|
||||
|
||||
if (printInfo)
|
||||
{
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
|
||||
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
|
||||
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
|
||||
}
|
||||
|
||||
init(); // Initialise the GL visual
|
||||
reshape(1024,768);
|
||||
|
||||
// DBR : Run the simulation
|
||||
run_gears(d, screen_surf, 5.0);
|
||||
|
||||
|
||||
// DBR : Destroy EGL context/surface etc
|
||||
eglDestroySurface(d, screen_surf);
|
||||
eglDestroyContext(d, ctx);
|
||||
eglTerminate(d);
|
||||
// DBR
|
||||
|
||||
return 0;
|
||||
}
|
||||
2
progs/tests/.cvsignore
Normal file
2
progs/tests/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
.cvsignore
|
||||
getproclist.h
|
||||
@@ -22,6 +22,7 @@ SOURCES = antialias.c \
|
||||
blendminmax.c \
|
||||
blendsquare.c \
|
||||
bufferobj.c \
|
||||
bug_3101.c \
|
||||
crossbar.c \
|
||||
cva.c \
|
||||
dinoshade.c \
|
||||
|
||||
128
progs/tests/bug_3101.c
Normal file
128
progs/tests/bug_3101.c
Normal file
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* (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
|
||||
* VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file bug_3101.c
|
||||
*
|
||||
* Simple regression test for bug #3101. Attempt to draw a single square.
|
||||
* After emiting the first vertex, call \c glEdgeFlag to change the vertex
|
||||
* format. If the bug still exists, this will cause a segfault.
|
||||
*
|
||||
* \author Ian Romanick <idr@us.ibm.com>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
static int Width = 400;
|
||||
static int Height = 200;
|
||||
static const GLfloat Near = 5.0, Far = 25.0;
|
||||
|
||||
|
||||
static void Display( void )
|
||||
{
|
||||
glClearColor(0.2, 0.2, 0.8, 0);
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
/* This is the "reference" square.
|
||||
*/
|
||||
|
||||
glTranslatef(-4.5, 0, 0);
|
||||
glBlendEquation( GL_FUNC_ADD );
|
||||
glBlendFunc( GL_ONE, GL_ZERO );
|
||||
glBegin(GL_QUADS);
|
||||
glColor3f( 0.5, 0.5, 0.5 );
|
||||
glVertex2f(-1, -1);
|
||||
glVertex2f( 1, -1);
|
||||
glEdgeFlag(GL_TRUE);
|
||||
glVertex2f( 1, 1);
|
||||
glVertex2f(-1, 1);
|
||||
glEnd();
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void Reshape( int width, int height )
|
||||
{
|
||||
GLfloat ar = (float) width / (float) height;
|
||||
Width = width;
|
||||
Height = height;
|
||||
glViewport( 0, 0, width, height );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
glTranslatef( 0.0, 0.0, -15.0 );
|
||||
}
|
||||
|
||||
|
||||
static void Key( unsigned char key, int x, int y )
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
const char * const ver_string = (const char * const)
|
||||
glGetString( GL_VERSION );
|
||||
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
printf("GL_VERSION = %s\n", ver_string);
|
||||
|
||||
printf("\nThis program should draw a single square, but not crash.\n");
|
||||
printf("This is a regression test for bug #3101.\n");
|
||||
printf("https://bugs.freedesktop.org/show_bug.cgi?id=3101\n");
|
||||
glEnable( GL_BLEND );
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize( Width, Height );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
glutCreateWindow( "Bug #3101 Test" );
|
||||
glutReshapeFunc( Reshape );
|
||||
glutKeyboardFunc( Key );
|
||||
glutDisplayFunc( Display );
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
@@ -145,6 +145,19 @@ Init( void )
|
||||
|
||||
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
|
||||
|
||||
{
|
||||
GLint r, g, b, a;
|
||||
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
|
||||
GL_RENDERBUFFER_RED_SIZE_EXT, &r);
|
||||
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
|
||||
GL_RENDERBUFFER_GREEN_SIZE_EXT, &g);
|
||||
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
|
||||
GL_RENDERBUFFER_BLUE_SIZE_EXT, &b);
|
||||
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
|
||||
GL_RENDERBUFFER_ALPHA_SIZE_EXT, &a);
|
||||
printf("renderbuffer RGBA sizes = %d %d %d %d\n", r, g, b, a);
|
||||
}
|
||||
|
||||
CheckError(__LINE__);
|
||||
|
||||
/* restore to default */
|
||||
|
||||
@@ -223,6 +223,10 @@ Init(void)
|
||||
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRB);
|
||||
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
|
||||
TexWidth, TexHeight);
|
||||
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
|
||||
GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
|
||||
printf("Depth renderbuffer size = %d bits\n", i);
|
||||
assert(i > 0);
|
||||
|
||||
/* make stencil renderbuffer */
|
||||
glGenRenderbuffersEXT(1, &StencilRB);
|
||||
@@ -231,6 +235,10 @@ Init(void)
|
||||
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilRB);
|
||||
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX,
|
||||
TexWidth, TexHeight);
|
||||
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
|
||||
GL_RENDERBUFFER_STENCIL_SIZE_EXT, &i);
|
||||
printf("Stencil renderbuffer size = %d bits\n", i);
|
||||
assert(i > 0);
|
||||
|
||||
/* attach DepthRB to MyFB */
|
||||
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# $Id: getprocaddress.py,v 1.6 2004/11/27 19:57:46 brianp Exp $
|
||||
# $Id: getprocaddress.py,v 1.7 2005/06/21 23:42:43 idr Exp $
|
||||
|
||||
# Helper for the getprocaddress.c test.
|
||||
|
||||
from xml.sax import saxutils
|
||||
from xml.sax import make_parser
|
||||
from xml.sax.handler import feature_namespaces
|
||||
|
||||
import sys, getopt, re
|
||||
sys.path.append("../../src/mesa/glapi/" )
|
||||
import gl_XML
|
||||
@@ -30,16 +26,19 @@ def FindTestFunctions():
|
||||
return functions
|
||||
|
||||
|
||||
class PrintExports(gl_XML.FilterGLAPISpecBase):
|
||||
name = "gl_exports.py (from Mesa)"
|
||||
|
||||
class PrintExports(gl_XML.gl_print_base):
|
||||
def __init__(self):
|
||||
gl_XML.FilterGLAPISpecBase.__init__(self)
|
||||
gl_XML.gl_print_base.__init__(self)
|
||||
|
||||
self.name = "getprocaddress.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.tests = FindTestFunctions()
|
||||
self.prevCategory = ""
|
||||
return
|
||||
|
||||
|
||||
def printRealHeader(self):
|
||||
print """
|
||||
@@ -50,22 +49,28 @@ struct name_test_pair {
|
||||
|
||||
static struct name_test_pair functions[] = {"""
|
||||
|
||||
def printRealFooter(self):
|
||||
print"""
|
||||
{ NULL, NULL }
|
||||
};
|
||||
"""
|
||||
def printBody(self, api):
|
||||
prev_category = None
|
||||
|
||||
|
||||
def printFunction(self, f):
|
||||
if f.category != self.prevCategory:
|
||||
print ' { "-%s", NULL},' % f.category
|
||||
self.prevCategory = f.category
|
||||
for f in api.functionIterateByOffset():
|
||||
[category, num] = api.get_category_for_name( f.name )
|
||||
if category != prev_category:
|
||||
print ' { "-%s", NULL},' % category
|
||||
prev_category = category
|
||||
|
||||
if f.name in self.tests:
|
||||
test = "test_%s" % f.name
|
||||
else:
|
||||
test = "NULL"
|
||||
print ' { "gl%s", %s },' % (f.name, test)
|
||||
for name in f.entry_points:
|
||||
if name in self.tests:
|
||||
test = "test_%s" % name
|
||||
break
|
||||
|
||||
print ' { "gl%s", %s },' % (f.name, test)
|
||||
|
||||
print ''
|
||||
print ' { NULL, NULL }'
|
||||
print '};'
|
||||
print ''
|
||||
return
|
||||
|
||||
|
||||
@@ -81,15 +86,8 @@ if __name__ == '__main__':
|
||||
if arg == "-f":
|
||||
file_name = val
|
||||
|
||||
dh = PrintExports()
|
||||
printer = PrintExports()
|
||||
|
||||
parser = make_parser()
|
||||
parser.setFeature(feature_namespaces, 0)
|
||||
parser.setContentHandler(dh)
|
||||
api = gl_XML.parse_GL_API( file_name, gl_XML.gl_item_factory() )
|
||||
|
||||
f = open(file_name)
|
||||
|
||||
parser.parse(f)
|
||||
dh.printHeader()
|
||||
dh.printFunctions()
|
||||
dh.printFooter()
|
||||
printer.Print( api )
|
||||
|
||||
@@ -20,6 +20,7 @@ PROGS = glthreads \
|
||||
glxswapcontrol \
|
||||
manywin \
|
||||
offset \
|
||||
overlay \
|
||||
pbinfo \
|
||||
pbdemo \
|
||||
wincopy \
|
||||
@@ -51,10 +52,10 @@ clean:
|
||||
|
||||
# special cases
|
||||
pbinfo: pbinfo.o pbutil.o
|
||||
$(CC) pbinfo.o pbutil.o $(APP_LIB_DEPS) -o $@
|
||||
$(CC) $(CFLAGS) pbinfo.o pbutil.o $(APP_LIB_DEPS) -o $@
|
||||
|
||||
pbdemo: pbdemo.o pbutil.o
|
||||
$(CC) pbdemo.o pbutil.o $(APP_LIB_DEPS) -o $@
|
||||
$(CC) $(CFLAGS) pbdemo.o pbutil.o $(APP_LIB_DEPS) -o $@
|
||||
|
||||
pbinfo.o: pbinfo.c pbutil.h
|
||||
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbinfo.c
|
||||
@@ -66,13 +67,13 @@ pbutil.o: pbutil.c pbutil.h
|
||||
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbutil.c
|
||||
|
||||
glxgears_fbconfig: glxgears_fbconfig.o pbutil.o
|
||||
$(CC) glxgears_fbconfig.o pbutil.o $(APP_LIB_DEPS) -o $@
|
||||
$(CC) $(CFLAGS) glxgears_fbconfig.o pbutil.o $(APP_LIB_DEPS) -o $@
|
||||
|
||||
glxgears_fbconfig.o: glxgears_fbconfig.c pbutil.h
|
||||
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) glxgears_fbconfig.c
|
||||
$(CC) $(CFLAGS) -c -I. -I$(INCDIR) $(CFLAGS) glxgears_fbconfig.c
|
||||
|
||||
xrotfontdemo: xrotfontdemo.o xuserotfont.o
|
||||
$(CC) xrotfontdemo.o xuserotfont.o $(APP_LIB_DEPS) -o $@
|
||||
$(CC) $(CFLAGS) xrotfontdemo.o xuserotfont.o $(APP_LIB_DEPS) -o $@
|
||||
|
||||
xuserotfont.o: xuserotfont.c xuserotfont.h
|
||||
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) xuserotfont.c
|
||||
|
||||
245
progs/xdemos/overlay.c
Normal file
245
progs/xdemos/overlay.c
Normal file
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
* GLX overlay test/demo.
|
||||
*
|
||||
* Brian Paul
|
||||
* 18 July 2005
|
||||
*/
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glx.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static int WinWidth = 300, WinHeight = 300;
|
||||
static Window NormalWindow = 0;
|
||||
static Window OverlayWindow = 0;
|
||||
static GLXContext NormalContext = 0;
|
||||
static GLXContext OverlayContext = 0;
|
||||
static GLboolean RGBOverlay = GL_FALSE;
|
||||
static GLfloat Angle = 0.0;
|
||||
|
||||
|
||||
static void
|
||||
RedrawNormal(Display *dpy)
|
||||
{
|
||||
glXMakeCurrent(dpy, NormalWindow, NormalContext);
|
||||
glViewport(0, 0, WinWidth, WinHeight);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glClearColor(0.5, 0.5, 0.5, 1.0);
|
||||
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, NormalWindow);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
RedrawOverlay(Display *dpy)
|
||||
{
|
||||
glXMakeCurrent(dpy, OverlayWindow, OverlayContext);
|
||||
glViewport(0, 0, WinWidth, WinHeight);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
if (RGBOverlay) {
|
||||
glColor3f(0.0, 1.0, 1.0);
|
||||
}
|
||||
else {
|
||||
glIndexi(2);
|
||||
}
|
||||
glBegin(GL_LINES);
|
||||
glVertex2f(-1, -1);
|
||||
glVertex2f(1, 1);
|
||||
glVertex2f(1, -1);
|
||||
glVertex2f(-1, 1);
|
||||
glEnd();
|
||||
glXSwapBuffers(dpy, OverlayWindow);
|
||||
}
|
||||
|
||||
|
||||
static Window
|
||||
MakeWindow(Display *dpy, XVisualInfo *visinfo, Window parent,
|
||||
unsigned int width, unsigned int height)
|
||||
{
|
||||
int scrnum;
|
||||
XSetWindowAttributes attr;
|
||||
unsigned long mask;
|
||||
Window root;
|
||||
Window win;
|
||||
|
||||
scrnum = DefaultScreen(dpy);
|
||||
root = RootWindow(dpy, scrnum);
|
||||
|
||||
/* window attributes */
|
||||
attr.background_pixel = 0;
|
||||
attr.border_pixel = 0;
|
||||
attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
|
||||
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
|
||||
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
|
||||
|
||||
win = XCreateWindow(dpy, parent, 0, 0, width, height,
|
||||
0, visinfo->depth, InputOutput,
|
||||
visinfo->visual, mask, &attr);
|
||||
return win;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
MakeNormalWindow(Display *dpy)
|
||||
{
|
||||
int attrib[] = { GLX_RGBA,
|
||||
GLX_RED_SIZE, 1,
|
||||
GLX_GREEN_SIZE, 1,
|
||||
GLX_BLUE_SIZE, 1,
|
||||
GLX_DOUBLEBUFFER,
|
||||
None };
|
||||
int scrnum;
|
||||
Window root;
|
||||
XVisualInfo *visinfo;
|
||||
|
||||
scrnum = DefaultScreen(dpy);
|
||||
root = RootWindow(dpy, scrnum);
|
||||
|
||||
visinfo = glXChooseVisual(dpy, scrnum, attrib);
|
||||
if (!visinfo) {
|
||||
printf("Error: couldn't get an RGB, Double-buffered visual\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
NormalWindow = MakeWindow(dpy, visinfo, root, WinWidth, WinHeight);
|
||||
assert(NormalWindow);
|
||||
|
||||
NormalContext = glXCreateContext(dpy, visinfo, NULL, True);
|
||||
assert(NormalContext);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
MakeOverlayWindow(Display *dpy)
|
||||
{
|
||||
int rgbAttribs[] = {
|
||||
GLX_RGBA,
|
||||
GLX_RED_SIZE, 1,
|
||||
GLX_GREEN_SIZE, 1,
|
||||
GLX_BLUE_SIZE, 1,
|
||||
GLX_DOUBLEBUFFER,
|
||||
GLX_LEVEL, 1,
|
||||
None
|
||||
};
|
||||
int indexAttribs[] = {
|
||||
/*GLX_RGBA, leave this out */
|
||||
GLX_RED_SIZE, 1,
|
||||
GLX_GREEN_SIZE, 1,
|
||||
GLX_BLUE_SIZE, 1,
|
||||
GLX_DOUBLEBUFFER,
|
||||
GLX_LEVEL, 1,
|
||||
None
|
||||
};
|
||||
int scrnum;
|
||||
Window root;
|
||||
XVisualInfo *visinfo;
|
||||
|
||||
scrnum = DefaultScreen(dpy);
|
||||
root = RootWindow(dpy, scrnum);
|
||||
|
||||
visinfo = glXChooseVisual(dpy, scrnum, rgbAttribs);
|
||||
if (visinfo) {
|
||||
printf("Found RGB overlay visual 0x%x\n", (int) visinfo->visualid);
|
||||
RGBOverlay = GL_TRUE;
|
||||
}
|
||||
else {
|
||||
visinfo = glXChooseVisual(dpy, scrnum, indexAttribs);
|
||||
if (visinfo) {
|
||||
printf("Found Color Index overlay visual 0x%x\n",
|
||||
(int) visinfo->visualid);
|
||||
/* XXX setup the colormap entries! */
|
||||
}
|
||||
else {
|
||||
printf("Error: couldn't get an overlay visual!\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
OverlayWindow = MakeWindow(dpy, visinfo, NormalWindow, WinWidth, WinHeight);
|
||||
assert(OverlayWindow);
|
||||
|
||||
OverlayContext = glXCreateContext(dpy, visinfo, NULL, True);
|
||||
assert(OverlayContext);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
EventLoop(Display *dpy)
|
||||
{
|
||||
XEvent event;
|
||||
|
||||
while (1) {
|
||||
XNextEvent(dpy, &event);
|
||||
|
||||
switch (event.type) {
|
||||
case Expose:
|
||||
RedrawNormal(dpy);
|
||||
RedrawOverlay(dpy);
|
||||
break;
|
||||
case ConfigureNotify:
|
||||
WinWidth = event.xconfigure.width;
|
||||
WinHeight = event.xconfigure.height;
|
||||
if (event.xconfigure.window == NormalWindow)
|
||||
XResizeWindow(dpy, OverlayWindow, WinWidth, WinHeight);
|
||||
break;
|
||||
case KeyPress:
|
||||
{
|
||||
char buffer[10];
|
||||
int r, code;
|
||||
code = XLookupKeysym(&event.xkey, 0);
|
||||
r = XLookupString(&event.xkey, buffer, sizeof(buffer),
|
||||
NULL, NULL);
|
||||
if (buffer[0] == 27) {
|
||||
/* escape */
|
||||
return;
|
||||
}
|
||||
else if (buffer[0] == ' ') {
|
||||
Angle += 5.0;
|
||||
RedrawNormal(dpy);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
; /* nothing */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
Display *dpy = XOpenDisplay(NULL);
|
||||
|
||||
assert(dpy);
|
||||
|
||||
MakeNormalWindow(dpy);
|
||||
MakeOverlayWindow(dpy);
|
||||
|
||||
XMapWindow(dpy, NormalWindow);
|
||||
XMapWindow(dpy, OverlayWindow);
|
||||
|
||||
EventLoop(dpy);
|
||||
|
||||
glXDestroyContext(dpy, OverlayContext);
|
||||
glXDestroyContext(dpy, NormalContext);
|
||||
XDestroyWindow(dpy, OverlayWindow);
|
||||
XDestroyWindow(dpy, NormalWindow);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -53,145 +53,145 @@ glutExtensionSupported(const char *extension)
|
||||
|
||||
struct name_address_pair {
|
||||
const char *name;
|
||||
const void *address;
|
||||
const GLUTproc address;
|
||||
};
|
||||
|
||||
static struct name_address_pair glut_functions[] = {
|
||||
{ "glutInit", (const void *) glutInit },
|
||||
{ "glutInitDisplayMode", (const void *) glutInitDisplayMode },
|
||||
{ "glutInitDisplayString", (const void *) glutInitDisplayString },
|
||||
{ "glutInitWindowPosition", (const void *) glutInitWindowPosition },
|
||||
{ "glutInitWindowSize", (const void *) glutInitWindowSize },
|
||||
{ "glutMainLoop", (const void *) glutMainLoop },
|
||||
{ "glutCreateWindow", (const void *) glutCreateWindow },
|
||||
{ "glutCreateSubWindow", (const void *) glutCreateSubWindow },
|
||||
{ "glutDestroyWindow", (const void *) glutDestroyWindow },
|
||||
{ "glutPostRedisplay", (const void *) glutPostRedisplay },
|
||||
{ "glutPostWindowRedisplay", (const void *) glutPostWindowRedisplay },
|
||||
{ "glutSwapBuffers", (const void *) glutSwapBuffers },
|
||||
{ "glutGetWindow", (const void *) glutGetWindow },
|
||||
{ "glutSetWindow", (const void *) glutSetWindow },
|
||||
{ "glutSetWindowTitle", (const void *) glutSetWindowTitle },
|
||||
{ "glutSetIconTitle", (const void *) glutSetIconTitle },
|
||||
{ "glutPositionWindow", (const void *) glutPositionWindow },
|
||||
{ "glutReshapeWindow", (const void *) glutReshapeWindow },
|
||||
{ "glutPopWindow", (const void *) glutPopWindow },
|
||||
{ "glutPushWindow", (const void *) glutPushWindow },
|
||||
{ "glutIconifyWindow", (const void *) glutIconifyWindow },
|
||||
{ "glutShowWindow", (const void *) glutShowWindow },
|
||||
{ "glutHideWindow", (const void *) glutHideWindow },
|
||||
{ "glutFullScreen", (const void *) glutFullScreen },
|
||||
{ "glutSetCursor", (const void *) glutSetCursor },
|
||||
{ "glutWarpPointer", (const void *) glutWarpPointer },
|
||||
{ "glutEstablishOverlay", (const void *) glutEstablishOverlay },
|
||||
{ "glutRemoveOverlay", (const void *) glutRemoveOverlay },
|
||||
{ "glutUseLayer", (const void *) glutUseLayer },
|
||||
{ "glutPostOverlayRedisplay", (const void *) glutPostOverlayRedisplay },
|
||||
{ "glutPostWindowOverlayRedisplay", (const void *) glutPostWindowOverlayRedisplay },
|
||||
{ "glutShowOverlay", (const void *) glutShowOverlay },
|
||||
{ "glutHideOverlay", (const void *) glutHideOverlay },
|
||||
{ "glutCreateMenu", (const void *) glutCreateMenu },
|
||||
{ "glutDestroyMenu", (const void *) glutDestroyMenu },
|
||||
{ "glutGetMenu", (const void *) glutGetMenu },
|
||||
{ "glutSetMenu", (const void *) glutSetMenu },
|
||||
{ "glutAddMenuEntry", (const void *) glutAddMenuEntry },
|
||||
{ "glutAddSubMenu", (const void *) glutAddSubMenu },
|
||||
{ "glutChangeToMenuEntry", (const void *) glutChangeToMenuEntry },
|
||||
{ "glutChangeToSubMenu", (const void *) glutChangeToSubMenu },
|
||||
{ "glutRemoveMenuItem", (const void *) glutRemoveMenuItem },
|
||||
{ "glutAttachMenu", (const void *) glutAttachMenu },
|
||||
{ "glutDetachMenu", (const void *) glutDetachMenu },
|
||||
{ "glutDisplayFunc", (const void *) glutDisplayFunc },
|
||||
{ "glutReshapeFunc", (const void *) glutReshapeFunc },
|
||||
{ "glutKeyboardFunc", (const void *) glutKeyboardFunc },
|
||||
{ "glutMouseFunc", (const void *) glutMouseFunc },
|
||||
{ "glutMotionFunc", (const void *) glutMotionFunc },
|
||||
{ "glutPassiveMotionFunc", (const void *) glutPassiveMotionFunc },
|
||||
{ "glutEntryFunc", (const void *) glutEntryFunc },
|
||||
{ "glutVisibilityFunc", (const void *) glutVisibilityFunc },
|
||||
{ "glutIdleFunc", (const void *) glutIdleFunc },
|
||||
{ "glutTimerFunc", (const void *) glutTimerFunc },
|
||||
{ "glutMenuStateFunc", (const void *) glutMenuStateFunc },
|
||||
{ "glutSpecialFunc", (const void *) glutSpecialFunc },
|
||||
{ "glutSpaceballMotionFunc", (const void *) glutSpaceballMotionFunc },
|
||||
{ "glutSpaceballRotateFunc", (const void *) glutSpaceballRotateFunc },
|
||||
{ "glutSpaceballButtonFunc", (const void *) glutSpaceballButtonFunc },
|
||||
{ "glutButtonBoxFunc", (const void *) glutButtonBoxFunc },
|
||||
{ "glutDialsFunc", (const void *) glutDialsFunc },
|
||||
{ "glutTabletMotionFunc", (const void *) glutTabletMotionFunc },
|
||||
{ "glutTabletButtonFunc", (const void *) glutTabletButtonFunc },
|
||||
{ "glutMenuStatusFunc", (const void *) glutMenuStatusFunc },
|
||||
{ "glutOverlayDisplayFunc", (const void *) glutOverlayDisplayFunc },
|
||||
{ "glutWindowStatusFunc", (const void *) glutWindowStatusFunc },
|
||||
// { "glutKeyboardUpFunc", (const void *) glutKeyboardUpFunc },
|
||||
// { "glutSpecialUpFunc", (const void *) glutSpecialUpFunc },
|
||||
// { "glutJoystickFunc", (const void *) glutJoystickFunc },
|
||||
{ "glutSetColor", (const void *) glutSetColor },
|
||||
{ "glutGetColor", (const void *) glutGetColor },
|
||||
{ "glutCopyColormap", (const void *) glutCopyColormap },
|
||||
{ "glutGet", (const void *) glutGet },
|
||||
{ "glutDeviceGet", (const void *) glutDeviceGet },
|
||||
{ "glutExtensionSupported", (const void *) glutExtensionSupported },
|
||||
{ "glutGetModifiers", (const void *) glutGetModifiers },
|
||||
{ "glutLayerGet", (const void *) glutLayerGet },
|
||||
{ "glutGetProcAddress", (const void *) glutGetProcAddress },
|
||||
{ "glutBitmapCharacter", (const void *) glutBitmapCharacter },
|
||||
{ "glutBitmapWidth", (const void *) glutBitmapWidth },
|
||||
{ "glutStrokeCharacter", (const void *) glutStrokeCharacter },
|
||||
{ "glutStrokeWidth", (const void *) glutStrokeWidth },
|
||||
{ "glutBitmapLength", (const void *) glutBitmapLength },
|
||||
{ "glutStrokeLength", (const void *) glutStrokeLength },
|
||||
{ "glutWireSphere", (const void *) glutWireSphere },
|
||||
{ "glutSolidSphere", (const void *) glutSolidSphere },
|
||||
{ "glutWireCone", (const void *) glutWireCone },
|
||||
{ "glutSolidCone", (const void *) glutSolidCone },
|
||||
{ "glutWireCube", (const void *) glutWireCube },
|
||||
{ "glutSolidCube", (const void *) glutSolidCube },
|
||||
{ "glutWireTorus", (const void *) glutWireTorus },
|
||||
{ "glutSolidTorus", (const void *) glutSolidTorus },
|
||||
{ "glutWireDodecahedron", (const void *) glutWireDodecahedron },
|
||||
{ "glutSolidDodecahedron", (const void *) glutSolidDodecahedron },
|
||||
{ "glutWireTeapot", (const void *) glutWireTeapot },
|
||||
{ "glutSolidTeapot", (const void *) glutSolidTeapot },
|
||||
{ "glutWireOctahedron", (const void *) glutWireOctahedron },
|
||||
{ "glutSolidOctahedron", (const void *) glutSolidOctahedron },
|
||||
{ "glutWireTetrahedron", (const void *) glutWireTetrahedron },
|
||||
{ "glutSolidTetrahedron", (const void *) glutSolidTetrahedron },
|
||||
{ "glutWireIcosahedron", (const void *) glutWireIcosahedron },
|
||||
{ "glutSolidIcosahedron", (const void *) glutSolidIcosahedron },
|
||||
{ "glutVideoResizeGet", (const void *) glutVideoResizeGet },
|
||||
{ "glutSetupVideoResizing", (const void *) glutSetupVideoResizing },
|
||||
{ "glutStopVideoResizing", (const void *) glutStopVideoResizing },
|
||||
{ "glutVideoResize", (const void *) glutVideoResize },
|
||||
{ "glutVideoPan", (const void *) glutVideoPan },
|
||||
{ "glutReportErrors", (const void *) glutReportErrors },
|
||||
// { "glutIgnoreKeyRepeat", (const void *) glutIgnoreKeyRepeat },
|
||||
// { "glutSetKeyRepeat", (const void *) glutSetKeyRepeat },
|
||||
// { "glutForceJoystickFunc", (const void *) glutForceJoystickFunc },
|
||||
// { "glutGameModeString", (const void *) glutGameModeString },
|
||||
// { "glutEnterGameMode", (const void *) glutEnterGameMode },
|
||||
// { "glutLeaveGameMode", (const void *) glutLeaveGameMode },
|
||||
// { "glutGameModeGet", (const void *) glutGameModeGet },
|
||||
{ "glutInit", (const GLUTproc) glutInit },
|
||||
{ "glutInitDisplayMode", (const GLUTproc) glutInitDisplayMode },
|
||||
{ "glutInitDisplayString", (const GLUTproc) glutInitDisplayString },
|
||||
{ "glutInitWindowPosition", (const GLUTproc) glutInitWindowPosition },
|
||||
{ "glutInitWindowSize", (const GLUTproc) glutInitWindowSize },
|
||||
{ "glutMainLoop", (const GLUTproc) glutMainLoop },
|
||||
{ "glutCreateWindow", (const GLUTproc) glutCreateWindow },
|
||||
{ "glutCreateSubWindow", (const GLUTproc) glutCreateSubWindow },
|
||||
{ "glutDestroyWindow", (const GLUTproc) glutDestroyWindow },
|
||||
{ "glutPostRedisplay", (const GLUTproc) glutPostRedisplay },
|
||||
{ "glutPostWindowRedisplay", (const GLUTproc) glutPostWindowRedisplay },
|
||||
{ "glutSwapBuffers", (const GLUTproc) glutSwapBuffers },
|
||||
{ "glutGetWindow", (const GLUTproc) glutGetWindow },
|
||||
{ "glutSetWindow", (const GLUTproc) glutSetWindow },
|
||||
{ "glutSetWindowTitle", (const GLUTproc) glutSetWindowTitle },
|
||||
{ "glutSetIconTitle", (const GLUTproc) glutSetIconTitle },
|
||||
{ "glutPositionWindow", (const GLUTproc) glutPositionWindow },
|
||||
{ "glutReshapeWindow", (const GLUTproc) glutReshapeWindow },
|
||||
{ "glutPopWindow", (const GLUTproc) glutPopWindow },
|
||||
{ "glutPushWindow", (const GLUTproc) glutPushWindow },
|
||||
{ "glutIconifyWindow", (const GLUTproc) glutIconifyWindow },
|
||||
{ "glutShowWindow", (const GLUTproc) glutShowWindow },
|
||||
{ "glutHideWindow", (const GLUTproc) glutHideWindow },
|
||||
{ "glutFullScreen", (const GLUTproc) glutFullScreen },
|
||||
{ "glutSetCursor", (const GLUTproc) glutSetCursor },
|
||||
{ "glutWarpPointer", (const GLUTproc) glutWarpPointer },
|
||||
{ "glutEstablishOverlay", (const GLUTproc) glutEstablishOverlay },
|
||||
{ "glutRemoveOverlay", (const GLUTproc) glutRemoveOverlay },
|
||||
{ "glutUseLayer", (const GLUTproc) glutUseLayer },
|
||||
{ "glutPostOverlayRedisplay", (const GLUTproc) glutPostOverlayRedisplay },
|
||||
{ "glutPostWindowOverlayRedisplay", (const GLUTproc) glutPostWindowOverlayRedisplay },
|
||||
{ "glutShowOverlay", (const GLUTproc) glutShowOverlay },
|
||||
{ "glutHideOverlay", (const GLUTproc) glutHideOverlay },
|
||||
{ "glutCreateMenu", (const GLUTproc) glutCreateMenu },
|
||||
{ "glutDestroyMenu", (const GLUTproc) glutDestroyMenu },
|
||||
{ "glutGetMenu", (const GLUTproc) glutGetMenu },
|
||||
{ "glutSetMenu", (const GLUTproc) glutSetMenu },
|
||||
{ "glutAddMenuEntry", (const GLUTproc) glutAddMenuEntry },
|
||||
{ "glutAddSubMenu", (const GLUTproc) glutAddSubMenu },
|
||||
{ "glutChangeToMenuEntry", (const GLUTproc) glutChangeToMenuEntry },
|
||||
{ "glutChangeToSubMenu", (const GLUTproc) glutChangeToSubMenu },
|
||||
{ "glutRemoveMenuItem", (const GLUTproc) glutRemoveMenuItem },
|
||||
{ "glutAttachMenu", (const GLUTproc) glutAttachMenu },
|
||||
{ "glutDetachMenu", (const GLUTproc) glutDetachMenu },
|
||||
{ "glutDisplayFunc", (const GLUTproc) glutDisplayFunc },
|
||||
{ "glutReshapeFunc", (const GLUTproc) glutReshapeFunc },
|
||||
{ "glutKeyboardFunc", (const GLUTproc) glutKeyboardFunc },
|
||||
{ "glutMouseFunc", (const GLUTproc) glutMouseFunc },
|
||||
{ "glutMotionFunc", (const GLUTproc) glutMotionFunc },
|
||||
{ "glutPassiveMotionFunc", (const GLUTproc) glutPassiveMotionFunc },
|
||||
{ "glutEntryFunc", (const GLUTproc) glutEntryFunc },
|
||||
{ "glutVisibilityFunc", (const GLUTproc) glutVisibilityFunc },
|
||||
{ "glutIdleFunc", (const GLUTproc) glutIdleFunc },
|
||||
{ "glutTimerFunc", (const GLUTproc) glutTimerFunc },
|
||||
{ "glutMenuStateFunc", (const GLUTproc) glutMenuStateFunc },
|
||||
{ "glutSpecialFunc", (const GLUTproc) glutSpecialFunc },
|
||||
{ "glutSpaceballMotionFunc", (const GLUTproc) glutSpaceballMotionFunc },
|
||||
{ "glutSpaceballRotateFunc", (const GLUTproc) glutSpaceballRotateFunc },
|
||||
{ "glutSpaceballButtonFunc", (const GLUTproc) glutSpaceballButtonFunc },
|
||||
{ "glutButtonBoxFunc", (const GLUTproc) glutButtonBoxFunc },
|
||||
{ "glutDialsFunc", (const GLUTproc) glutDialsFunc },
|
||||
{ "glutTabletMotionFunc", (const GLUTproc) glutTabletMotionFunc },
|
||||
{ "glutTabletButtonFunc", (const GLUTproc) glutTabletButtonFunc },
|
||||
{ "glutMenuStatusFunc", (const GLUTproc) glutMenuStatusFunc },
|
||||
{ "glutOverlayDisplayFunc", (const GLUTproc) glutOverlayDisplayFunc },
|
||||
{ "glutWindowStatusFunc", (const GLUTproc) glutWindowStatusFunc },
|
||||
// { "glutKeyboardUpFunc", (const GLUTproc) glutKeyboardUpFunc },
|
||||
// { "glutSpecialUpFunc", (const GLUTproc) glutSpecialUpFunc },
|
||||
// { "glutJoystickFunc", (const GLUTproc) glutJoystickFunc },
|
||||
{ "glutSetColor", (const GLUTproc) glutSetColor },
|
||||
{ "glutGetColor", (const GLUTproc) glutGetColor },
|
||||
{ "glutCopyColormap", (const GLUTproc) glutCopyColormap },
|
||||
{ "glutGet", (const GLUTproc) glutGet },
|
||||
{ "glutDeviceGet", (const GLUTproc) glutDeviceGet },
|
||||
{ "glutExtensionSupported", (const GLUTproc) glutExtensionSupported },
|
||||
{ "glutGetModifiers", (const GLUTproc) glutGetModifiers },
|
||||
{ "glutLayerGet", (const GLUTproc) glutLayerGet },
|
||||
{ "glutGetProcAddress", (const GLUTproc) glutGetProcAddress },
|
||||
{ "glutBitmapCharacter", (const GLUTproc) glutBitmapCharacter },
|
||||
{ "glutBitmapWidth", (const GLUTproc) glutBitmapWidth },
|
||||
{ "glutStrokeCharacter", (const GLUTproc) glutStrokeCharacter },
|
||||
{ "glutStrokeWidth", (const GLUTproc) glutStrokeWidth },
|
||||
{ "glutBitmapLength", (const GLUTproc) glutBitmapLength },
|
||||
{ "glutStrokeLength", (const GLUTproc) glutStrokeLength },
|
||||
{ "glutWireSphere", (const GLUTproc) glutWireSphere },
|
||||
{ "glutSolidSphere", (const GLUTproc) glutSolidSphere },
|
||||
{ "glutWireCone", (const GLUTproc) glutWireCone },
|
||||
{ "glutSolidCone", (const GLUTproc) glutSolidCone },
|
||||
{ "glutWireCube", (const GLUTproc) glutWireCube },
|
||||
{ "glutSolidCube", (const GLUTproc) glutSolidCube },
|
||||
{ "glutWireTorus", (const GLUTproc) glutWireTorus },
|
||||
{ "glutSolidTorus", (const GLUTproc) glutSolidTorus },
|
||||
{ "glutWireDodecahedron", (const GLUTproc) glutWireDodecahedron },
|
||||
{ "glutSolidDodecahedron", (const GLUTproc) glutSolidDodecahedron },
|
||||
{ "glutWireTeapot", (const GLUTproc) glutWireTeapot },
|
||||
{ "glutSolidTeapot", (const GLUTproc) glutSolidTeapot },
|
||||
{ "glutWireOctahedron", (const GLUTproc) glutWireOctahedron },
|
||||
{ "glutSolidOctahedron", (const GLUTproc) glutSolidOctahedron },
|
||||
{ "glutWireTetrahedron", (const GLUTproc) glutWireTetrahedron },
|
||||
{ "glutSolidTetrahedron", (const GLUTproc) glutSolidTetrahedron },
|
||||
{ "glutWireIcosahedron", (const GLUTproc) glutWireIcosahedron },
|
||||
{ "glutSolidIcosahedron", (const GLUTproc) glutSolidIcosahedron },
|
||||
{ "glutVideoResizeGet", (const GLUTproc) glutVideoResizeGet },
|
||||
{ "glutSetupVideoResizing", (const GLUTproc) glutSetupVideoResizing },
|
||||
{ "glutStopVideoResizing", (const GLUTproc) glutStopVideoResizing },
|
||||
{ "glutVideoResize", (const GLUTproc) glutVideoResize },
|
||||
{ "glutVideoPan", (const GLUTproc) glutVideoPan },
|
||||
{ "glutReportErrors", (const GLUTproc) glutReportErrors },
|
||||
// { "glutIgnoreKeyRepeat", (const GLUTproc) glutIgnoreKeyRepeat },
|
||||
// { "glutSetKeyRepeat", (const GLUTproc) glutSetKeyRepeat },
|
||||
// { "glutForceJoystickFunc", (const GLUTproc) glutForceJoystickFunc },
|
||||
// { "glutGameModeString", (const GLUTproc) glutGameModeString },
|
||||
// { "glutEnterGameMode", (const GLUTproc) glutEnterGameMode },
|
||||
// { "glutLeaveGameMode", (const GLUTproc) glutLeaveGameMode },
|
||||
// { "glutGameModeGet", (const GLUTproc) glutGameModeGet },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
/* XXX This isn't an official GLUT function, yet */
|
||||
void * GLUTAPIENTRY
|
||||
GLUTproc GLUTAPIENTRY
|
||||
glutGetProcAddress(const char *procName)
|
||||
{
|
||||
/* Try GLUT functions first */
|
||||
int i;
|
||||
for (i = 0; glut_functions[i].name; i++) {
|
||||
if (strcmp(glut_functions[i].name, procName) == 0)
|
||||
return (void *) glut_functions[i].address;
|
||||
return glut_functions[i].address;
|
||||
}
|
||||
|
||||
/* Try core GL functions */
|
||||
#if defined(_WIN32)
|
||||
return (void *) wglGetProcAddress((LPCSTR) procName);
|
||||
return (GLUTProc) wglGetProcAddress((LPCSTR) procName);
|
||||
#elif defined(GLX_ARB_get_proc_address)
|
||||
return (void *) glXGetProcAddressARB((const GLubyte *) procName);
|
||||
return (GLUTProc) glXGetProcAddressARB((const GLubyte *) procName);
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
@@ -49,6 +49,7 @@ C_SOURCES = \
|
||||
XF86dri.c \
|
||||
|
||||
X86_SOURCES = $(TOP)/src/mesa/x86/glapi_x86.S
|
||||
X86-64_SOURCES = $(TOP)/src/mesa/x86-64/glapi_x86-64.S
|
||||
|
||||
# ASM_SOURCES = $(X86_SOURCES)
|
||||
|
||||
@@ -67,7 +68,7 @@ INCLUDES = -I. \
|
||||
-I$(TOP)/src/mesa/swrast_setup \
|
||||
-I$(TOP)/src/mesa/drivers/dri/common \
|
||||
-I$(DRM_SOURCE_PATH)/libdrm \
|
||||
-I$(DRM_SOURCE_PATH)/shared \
|
||||
-I$(DRM_SOURCE_PATH)/shared-core \
|
||||
$(X11_INCLUDES)
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -543,10 +543,10 @@ extern HIDDEN void __indirect_glSecondaryColor3usEXT(GLushort red, GLushort gree
|
||||
extern HIDDEN void __indirect_glSecondaryColor3usvEXT(const GLushort * v);
|
||||
extern HIDDEN void __indirect_glSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
|
||||
extern HIDDEN GLboolean __indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, GLboolean * residences);
|
||||
extern HIDDEN void __indirect_glBindProgramNV(GLenum target, GLuint id);
|
||||
extern HIDDEN void __indirect_glDeleteProgramsNV(GLsizei n, const GLuint * ids);
|
||||
extern HIDDEN void __indirect_glBindProgramNV(GLenum target, GLuint program);
|
||||
extern HIDDEN void __indirect_glDeleteProgramsNV(GLsizei n, const GLuint * programs);
|
||||
extern HIDDEN void __indirect_glExecuteProgramNV(GLenum target, GLuint id, const GLfloat * params);
|
||||
extern HIDDEN void __indirect_glGenProgramsNV(GLsizei n, GLuint * ids);
|
||||
extern HIDDEN void __indirect_glGenProgramsNV(GLsizei n, GLuint * programs);
|
||||
extern HIDDEN void __indirect_glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble * params);
|
||||
extern HIDDEN void __indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params);
|
||||
extern HIDDEN void __indirect_glGetProgramivNV(GLuint id, GLenum pname, GLint * params);
|
||||
@@ -555,8 +555,8 @@ extern HIDDEN void __indirect_glGetTrackMatrixivNV(GLenum target, GLuint address
|
||||
extern HIDDEN void __indirect_glGetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble * params);
|
||||
extern HIDDEN void __indirect_glGetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat * params);
|
||||
extern HIDDEN void __indirect_glGetVertexAttribivARB(GLuint index, GLenum pname, GLint * params);
|
||||
extern HIDDEN void __indirect_glGetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid ** pointer);
|
||||
extern HIDDEN GLboolean __indirect_glIsProgramNV(GLuint id);
|
||||
extern HIDDEN void __indirect_glGetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid ** params);
|
||||
extern HIDDEN GLboolean __indirect_glIsProgramNV(GLuint program);
|
||||
extern HIDDEN void __indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte * program);
|
||||
extern HIDDEN void __indirect_glProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
extern HIDDEN void __indirect_glProgramParameter4dvNV(GLenum target, GLuint index, const GLdouble * params);
|
||||
@@ -606,7 +606,7 @@ extern HIDDEN void __indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, cons
|
||||
extern HIDDEN void __indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v);
|
||||
extern HIDDEN void __indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v);
|
||||
extern HIDDEN void __indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte * v);
|
||||
extern HIDDEN void __indirect_glPointParameteriNV(GLenum pname, GLint params);
|
||||
extern HIDDEN void __indirect_glPointParameteriNV(GLenum pname, GLint param);
|
||||
extern HIDDEN void __indirect_glPointParameterivNV(GLenum pname, const GLint * params);
|
||||
extern HIDDEN void __indirect_glMultiDrawArraysEXT(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount);
|
||||
extern HIDDEN void __indirect_glMultiDrawElementsEXT(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount);
|
||||
@@ -682,6 +682,23 @@ extern HIDDEN void __indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshor
|
||||
extern HIDDEN void __indirect_glVertexAttrib4svNV(GLuint index, const GLshort * v);
|
||||
extern HIDDEN void __indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
|
||||
extern HIDDEN void __indirect_glVertexAttrib4ubvNV(GLuint index, const GLubyte * v);
|
||||
extern HIDDEN GLboolean __indirect_glIsRenderbufferEXT(GLuint renderbuffer);
|
||||
extern HIDDEN void __indirect_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer);
|
||||
extern HIDDEN void __indirect_glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers);
|
||||
extern HIDDEN void __indirect_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers);
|
||||
extern HIDDEN void __indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
extern HIDDEN void __indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params);
|
||||
extern HIDDEN GLboolean __indirect_glIsFramebufferEXT(GLuint framebuffer);
|
||||
extern HIDDEN void __indirect_glBindFramebufferEXT(GLenum target, GLuint framebuffer);
|
||||
extern HIDDEN void __indirect_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers);
|
||||
extern HIDDEN void __indirect_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers);
|
||||
extern HIDDEN GLenum __indirect_glCheckFramebufferStatusEXT(GLenum target);
|
||||
extern HIDDEN void __indirect_glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
extern HIDDEN void __indirect_glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
extern HIDDEN void __indirect_glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||
extern HIDDEN void __indirect_glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
extern HIDDEN void __indirect_glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint * params);
|
||||
extern HIDDEN void __indirect_glGenerateMipmapEXT(GLenum target);
|
||||
|
||||
# undef HIDDEN
|
||||
# undef FASTCALL
|
||||
|
||||
@@ -72,7 +72,7 @@ __GLapi * __glXNewIndirectAPI( void )
|
||||
|
||||
/* now, initialize the entries we understand */
|
||||
|
||||
/* GL_VERSION_1_0 */
|
||||
/* 1.0 */
|
||||
|
||||
glAPI->NewList = __indirect_glNewList;
|
||||
glAPI->EndList = __indirect_glEndList;
|
||||
@@ -381,7 +381,7 @@ __GLapi * __glXNewIndirectAPI( void )
|
||||
glAPI->Translatef = __indirect_glTranslatef;
|
||||
glAPI->Viewport = __indirect_glViewport;
|
||||
|
||||
/* GL_VERSION_1_1 */
|
||||
/* 1.1 */
|
||||
|
||||
glAPI->ArrayElement = __indirect_glArrayElement;
|
||||
glAPI->BindTexture = __indirect_glBindTexture;
|
||||
@@ -414,7 +414,7 @@ __GLapi * __glXNewIndirectAPI( void )
|
||||
glAPI->PopClientAttrib = __indirect_glPopClientAttrib;
|
||||
glAPI->PushClientAttrib = __indirect_glPushClientAttrib;
|
||||
|
||||
/* GL_VERSION_1_2 */
|
||||
/* 1.2 */
|
||||
|
||||
glAPI->BlendColor = __indirect_glBlendColor;
|
||||
glAPI->BlendEquation = __indirect_glBlendEquation;
|
||||
@@ -455,18 +455,8 @@ __GLapi * __glXNewIndirectAPI( void )
|
||||
glAPI->TexSubImage3D = __indirect_glTexSubImage3D;
|
||||
glAPI->CopyTexSubImage3D = __indirect_glCopyTexSubImage3D;
|
||||
|
||||
/* GL_ARB_multitexture */
|
||||
/* 1. GL_ARB_multitexture */
|
||||
|
||||
glAPI->ActiveTextureARB = __indirect_glActiveTextureARB;
|
||||
glAPI->ClientActiveTextureARB = __indirect_glClientActiveTextureARB;
|
||||
glAPI->MultiTexCoord1dARB = __indirect_glMultiTexCoord1dARB;
|
||||
glAPI->MultiTexCoord1dvARB = __indirect_glMultiTexCoord1dvARB;
|
||||
glAPI->MultiTexCoord1fARB = __indirect_glMultiTexCoord1fARB;
|
||||
glAPI->MultiTexCoord1fvARB = __indirect_glMultiTexCoord1fvARB;
|
||||
glAPI->MultiTexCoord1iARB = __indirect_glMultiTexCoord1iARB;
|
||||
glAPI->MultiTexCoord1ivARB = __indirect_glMultiTexCoord1ivARB;
|
||||
glAPI->MultiTexCoord1sARB = __indirect_glMultiTexCoord1sARB;
|
||||
glAPI->MultiTexCoord1svARB = __indirect_glMultiTexCoord1svARB;
|
||||
glAPI->MultiTexCoord2dARB = __indirect_glMultiTexCoord2dARB;
|
||||
glAPI->MultiTexCoord2dvARB = __indirect_glMultiTexCoord2dvARB;
|
||||
glAPI->MultiTexCoord2fARB = __indirect_glMultiTexCoord2fARB;
|
||||
@@ -491,79 +481,29 @@ __GLapi * __glXNewIndirectAPI( void )
|
||||
glAPI->MultiTexCoord4ivARB = __indirect_glMultiTexCoord4ivARB;
|
||||
glAPI->MultiTexCoord4sARB = __indirect_glMultiTexCoord4sARB;
|
||||
glAPI->MultiTexCoord4svARB = __indirect_glMultiTexCoord4svARB;
|
||||
glAPI->ActiveTextureARB = __indirect_glActiveTextureARB;
|
||||
glAPI->ClientActiveTextureARB = __indirect_glClientActiveTextureARB;
|
||||
glAPI->MultiTexCoord1dARB = __indirect_glMultiTexCoord1dARB;
|
||||
glAPI->MultiTexCoord1dvARB = __indirect_glMultiTexCoord1dvARB;
|
||||
glAPI->MultiTexCoord1fARB = __indirect_glMultiTexCoord1fARB;
|
||||
glAPI->MultiTexCoord1fvARB = __indirect_glMultiTexCoord1fvARB;
|
||||
glAPI->MultiTexCoord1iARB = __indirect_glMultiTexCoord1iARB;
|
||||
glAPI->MultiTexCoord1ivARB = __indirect_glMultiTexCoord1ivARB;
|
||||
glAPI->MultiTexCoord1sARB = __indirect_glMultiTexCoord1sARB;
|
||||
glAPI->MultiTexCoord1svARB = __indirect_glMultiTexCoord1svARB;
|
||||
|
||||
/* GL_ARB_transpose_matrix */
|
||||
/* 3. GL_ARB_transpose_matrix */
|
||||
|
||||
glAPI->LoadTransposeMatrixfARB = __indirect_glLoadTransposeMatrixfARB;
|
||||
glAPI->LoadTransposeMatrixdARB = __indirect_glLoadTransposeMatrixdARB;
|
||||
glAPI->MultTransposeMatrixfARB = __indirect_glMultTransposeMatrixfARB;
|
||||
glAPI->MultTransposeMatrixdARB = __indirect_glMultTransposeMatrixdARB;
|
||||
|
||||
/* GL_ARB_multisample */
|
||||
/* 5. GL_ARB_multisample */
|
||||
|
||||
glAPI->SampleCoverageARB = __indirect_glSampleCoverageARB;
|
||||
|
||||
/* GL_ARB_draw_buffers */
|
||||
|
||||
glAPI->DrawBuffersARB = __indirect_glDrawBuffersARB;
|
||||
|
||||
/* GL_EXT_texture_object */
|
||||
|
||||
glAPI->AreTexturesResidentEXT = __indirect_glAreTexturesResidentEXT;
|
||||
glAPI->GenTexturesEXT = __indirect_glGenTexturesEXT;
|
||||
glAPI->IsTextureEXT = __indirect_glIsTextureEXT;
|
||||
|
||||
/* GL_SGIS_multisample */
|
||||
|
||||
glAPI->SampleMaskSGIS = __indirect_glSampleMaskSGIS;
|
||||
glAPI->SamplePatternSGIS = __indirect_glSamplePatternSGIS;
|
||||
|
||||
/* GL_EXT_vertex_array */
|
||||
|
||||
glAPI->ColorPointerEXT = __indirect_glColorPointerEXT;
|
||||
glAPI->EdgeFlagPointerEXT = __indirect_glEdgeFlagPointerEXT;
|
||||
glAPI->IndexPointerEXT = __indirect_glIndexPointerEXT;
|
||||
glAPI->NormalPointerEXT = __indirect_glNormalPointerEXT;
|
||||
glAPI->TexCoordPointerEXT = __indirect_glTexCoordPointerEXT;
|
||||
glAPI->VertexPointerEXT = __indirect_glVertexPointerEXT;
|
||||
|
||||
/* GL_EXT_point_parameters */
|
||||
|
||||
glAPI->PointParameterfEXT = __indirect_glPointParameterfEXT;
|
||||
glAPI->PointParameterfvEXT = __indirect_glPointParameterfvEXT;
|
||||
|
||||
/* GL_MESA_window_pos */
|
||||
|
||||
glAPI->WindowPos2dMESA = __indirect_glWindowPos2dMESA;
|
||||
glAPI->WindowPos2dvMESA = __indirect_glWindowPos2dvMESA;
|
||||
glAPI->WindowPos2fMESA = __indirect_glWindowPos2fMESA;
|
||||
glAPI->WindowPos2fvMESA = __indirect_glWindowPos2fvMESA;
|
||||
glAPI->WindowPos2iMESA = __indirect_glWindowPos2iMESA;
|
||||
glAPI->WindowPos2ivMESA = __indirect_glWindowPos2ivMESA;
|
||||
glAPI->WindowPos2sMESA = __indirect_glWindowPos2sMESA;
|
||||
glAPI->WindowPos2svMESA = __indirect_glWindowPos2svMESA;
|
||||
glAPI->WindowPos3dMESA = __indirect_glWindowPos3dMESA;
|
||||
glAPI->WindowPos3dvMESA = __indirect_glWindowPos3dvMESA;
|
||||
glAPI->WindowPos3fMESA = __indirect_glWindowPos3fMESA;
|
||||
glAPI->WindowPos3fvMESA = __indirect_glWindowPos3fvMESA;
|
||||
glAPI->WindowPos3iMESA = __indirect_glWindowPos3iMESA;
|
||||
glAPI->WindowPos3ivMESA = __indirect_glWindowPos3ivMESA;
|
||||
glAPI->WindowPos3sMESA = __indirect_glWindowPos3sMESA;
|
||||
glAPI->WindowPos3svMESA = __indirect_glWindowPos3svMESA;
|
||||
|
||||
/* GL_EXT_blend_func_separate */
|
||||
|
||||
glAPI->BlendFuncSeparateEXT = __indirect_glBlendFuncSeparateEXT;
|
||||
|
||||
/* GL_EXT_fog_coord */
|
||||
|
||||
glAPI->FogCoordfEXT = __indirect_glFogCoordfEXT;
|
||||
glAPI->FogCoordfvEXT = __indirect_glFogCoordfvEXT;
|
||||
glAPI->FogCoorddEXT = __indirect_glFogCoorddEXT;
|
||||
glAPI->FogCoorddvEXT = __indirect_glFogCoorddvEXT;
|
||||
glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointerEXT;
|
||||
|
||||
/* GL_ARB_texture_compression */
|
||||
/* 12. GL_ARB_texture_compression */
|
||||
|
||||
glAPI->CompressedTexImage3DARB = __indirect_glCompressedTexImage3DARB;
|
||||
glAPI->CompressedTexImage2DARB = __indirect_glCompressedTexImage2DARB;
|
||||
@@ -573,120 +513,7 @@ __GLapi * __glXNewIndirectAPI( void )
|
||||
glAPI->CompressedTexSubImage1DARB = __indirect_glCompressedTexSubImage1DARB;
|
||||
glAPI->GetCompressedTexImageARB = __indirect_glGetCompressedTexImageARB;
|
||||
|
||||
/* GL_EXT_secondary_color */
|
||||
|
||||
glAPI->SecondaryColor3bEXT = __indirect_glSecondaryColor3bEXT;
|
||||
glAPI->SecondaryColor3bvEXT = __indirect_glSecondaryColor3bvEXT;
|
||||
glAPI->SecondaryColor3dEXT = __indirect_glSecondaryColor3dEXT;
|
||||
glAPI->SecondaryColor3dvEXT = __indirect_glSecondaryColor3dvEXT;
|
||||
glAPI->SecondaryColor3fEXT = __indirect_glSecondaryColor3fEXT;
|
||||
glAPI->SecondaryColor3fvEXT = __indirect_glSecondaryColor3fvEXT;
|
||||
glAPI->SecondaryColor3iEXT = __indirect_glSecondaryColor3iEXT;
|
||||
glAPI->SecondaryColor3ivEXT = __indirect_glSecondaryColor3ivEXT;
|
||||
glAPI->SecondaryColor3sEXT = __indirect_glSecondaryColor3sEXT;
|
||||
glAPI->SecondaryColor3svEXT = __indirect_glSecondaryColor3svEXT;
|
||||
glAPI->SecondaryColor3ubEXT = __indirect_glSecondaryColor3ubEXT;
|
||||
glAPI->SecondaryColor3ubvEXT = __indirect_glSecondaryColor3ubvEXT;
|
||||
glAPI->SecondaryColor3uiEXT = __indirect_glSecondaryColor3uiEXT;
|
||||
glAPI->SecondaryColor3uivEXT = __indirect_glSecondaryColor3uivEXT;
|
||||
glAPI->SecondaryColor3usEXT = __indirect_glSecondaryColor3usEXT;
|
||||
glAPI->SecondaryColor3usvEXT = __indirect_glSecondaryColor3usvEXT;
|
||||
glAPI->SecondaryColorPointerEXT = __indirect_glSecondaryColorPointerEXT;
|
||||
|
||||
/* GL_NV_vertex_program */
|
||||
|
||||
glAPI->AreProgramsResidentNV = __indirect_glAreProgramsResidentNV;
|
||||
glAPI->BindProgramNV = __indirect_glBindProgramNV;
|
||||
glAPI->DeleteProgramsNV = __indirect_glDeleteProgramsNV;
|
||||
glAPI->ExecuteProgramNV = __indirect_glExecuteProgramNV;
|
||||
glAPI->GenProgramsNV = __indirect_glGenProgramsNV;
|
||||
glAPI->GetProgramParameterdvNV = __indirect_glGetProgramParameterdvNV;
|
||||
glAPI->GetProgramParameterfvNV = __indirect_glGetProgramParameterfvNV;
|
||||
glAPI->GetProgramivNV = __indirect_glGetProgramivNV;
|
||||
glAPI->GetProgramStringNV = __indirect_glGetProgramStringNV;
|
||||
glAPI->GetTrackMatrixivNV = __indirect_glGetTrackMatrixivNV;
|
||||
|
||||
/* GL_ARB_vertex_program */
|
||||
|
||||
glAPI->GetVertexAttribdvARB = __indirect_glGetVertexAttribdvARB;
|
||||
glAPI->GetVertexAttribfvARB = __indirect_glGetVertexAttribfvARB;
|
||||
glAPI->GetVertexAttribivARB = __indirect_glGetVertexAttribivARB;
|
||||
|
||||
/* GL_NV_vertex_program */
|
||||
|
||||
glAPI->GetVertexAttribPointervNV = __indirect_glGetVertexAttribPointervNV;
|
||||
glAPI->IsProgramNV = __indirect_glIsProgramNV;
|
||||
glAPI->LoadProgramNV = __indirect_glLoadProgramNV;
|
||||
glAPI->ProgramParameter4dNV = __indirect_glProgramParameter4dNV;
|
||||
glAPI->ProgramParameter4dvNV = __indirect_glProgramParameter4dvNV;
|
||||
glAPI->ProgramParameter4fNV = __indirect_glProgramParameter4fNV;
|
||||
glAPI->ProgramParameter4fvNV = __indirect_glProgramParameter4fvNV;
|
||||
glAPI->ProgramParameters4dvNV = __indirect_glProgramParameters4dvNV;
|
||||
glAPI->ProgramParameters4fvNV = __indirect_glProgramParameters4fvNV;
|
||||
glAPI->RequestResidentProgramsNV = __indirect_glRequestResidentProgramsNV;
|
||||
glAPI->TrackMatrixNV = __indirect_glTrackMatrixNV;
|
||||
glAPI->VertexAttribPointerNV = __indirect_glVertexAttribPointerNV;
|
||||
|
||||
/* GL_ARB_vertex_program */
|
||||
|
||||
glAPI->VertexAttrib1dARB = __indirect_glVertexAttrib1dARB;
|
||||
glAPI->VertexAttrib1dvARB = __indirect_glVertexAttrib1dvARB;
|
||||
glAPI->VertexAttrib1fARB = __indirect_glVertexAttrib1fARB;
|
||||
glAPI->VertexAttrib1fvARB = __indirect_glVertexAttrib1fvARB;
|
||||
glAPI->VertexAttrib1sARB = __indirect_glVertexAttrib1sARB;
|
||||
glAPI->VertexAttrib1svARB = __indirect_glVertexAttrib1svARB;
|
||||
glAPI->VertexAttrib2dARB = __indirect_glVertexAttrib2dARB;
|
||||
glAPI->VertexAttrib2dvARB = __indirect_glVertexAttrib2dvARB;
|
||||
glAPI->VertexAttrib2fARB = __indirect_glVertexAttrib2fARB;
|
||||
glAPI->VertexAttrib2fvARB = __indirect_glVertexAttrib2fvARB;
|
||||
glAPI->VertexAttrib2sARB = __indirect_glVertexAttrib2sARB;
|
||||
glAPI->VertexAttrib2svARB = __indirect_glVertexAttrib2svARB;
|
||||
glAPI->VertexAttrib3dARB = __indirect_glVertexAttrib3dARB;
|
||||
glAPI->VertexAttrib3dvARB = __indirect_glVertexAttrib3dvARB;
|
||||
glAPI->VertexAttrib3fARB = __indirect_glVertexAttrib3fARB;
|
||||
glAPI->VertexAttrib3fvARB = __indirect_glVertexAttrib3fvARB;
|
||||
glAPI->VertexAttrib3sARB = __indirect_glVertexAttrib3sARB;
|
||||
glAPI->VertexAttrib3svARB = __indirect_glVertexAttrib3svARB;
|
||||
glAPI->VertexAttrib4dARB = __indirect_glVertexAttrib4dARB;
|
||||
glAPI->VertexAttrib4dvARB = __indirect_glVertexAttrib4dvARB;
|
||||
glAPI->VertexAttrib4fARB = __indirect_glVertexAttrib4fARB;
|
||||
glAPI->VertexAttrib4fvARB = __indirect_glVertexAttrib4fvARB;
|
||||
glAPI->VertexAttrib4sARB = __indirect_glVertexAttrib4sARB;
|
||||
glAPI->VertexAttrib4svARB = __indirect_glVertexAttrib4svARB;
|
||||
glAPI->VertexAttrib4NubARB = __indirect_glVertexAttrib4NubARB;
|
||||
glAPI->VertexAttrib4NubvARB = __indirect_glVertexAttrib4NubvARB;
|
||||
|
||||
/* GL_NV_vertex_program */
|
||||
|
||||
glAPI->VertexAttribs1dvNV = __indirect_glVertexAttribs1dvNV;
|
||||
glAPI->VertexAttribs1fvNV = __indirect_glVertexAttribs1fvNV;
|
||||
glAPI->VertexAttribs1svNV = __indirect_glVertexAttribs1svNV;
|
||||
glAPI->VertexAttribs2dvNV = __indirect_glVertexAttribs2dvNV;
|
||||
glAPI->VertexAttribs2fvNV = __indirect_glVertexAttribs2fvNV;
|
||||
glAPI->VertexAttribs2svNV = __indirect_glVertexAttribs2svNV;
|
||||
glAPI->VertexAttribs3dvNV = __indirect_glVertexAttribs3dvNV;
|
||||
glAPI->VertexAttribs3fvNV = __indirect_glVertexAttribs3fvNV;
|
||||
glAPI->VertexAttribs3svNV = __indirect_glVertexAttribs3svNV;
|
||||
glAPI->VertexAttribs4dvNV = __indirect_glVertexAttribs4dvNV;
|
||||
glAPI->VertexAttribs4fvNV = __indirect_glVertexAttribs4fvNV;
|
||||
glAPI->VertexAttribs4svNV = __indirect_glVertexAttribs4svNV;
|
||||
glAPI->VertexAttribs4ubvNV = __indirect_glVertexAttribs4ubvNV;
|
||||
|
||||
/* GL_NV_point_sprite */
|
||||
|
||||
glAPI->PointParameteriNV = __indirect_glPointParameteriNV;
|
||||
glAPI->PointParameterivNV = __indirect_glPointParameterivNV;
|
||||
|
||||
/* GL_EXT_multi_draw_arrays */
|
||||
|
||||
glAPI->MultiDrawArraysEXT = __indirect_glMultiDrawArraysEXT;
|
||||
glAPI->MultiDrawElementsEXT = __indirect_glMultiDrawElementsEXT;
|
||||
|
||||
/* EXT_stencil_two_side */
|
||||
|
||||
glAPI->ActiveStencilFaceEXT = __indirect_glActiveStencilFaceEXT;
|
||||
|
||||
/* GL_ARB_vertex_program */
|
||||
/* 26. GL_ARB_vertex_program */
|
||||
|
||||
glAPI->VertexAttrib4bvARB = __indirect_glVertexAttrib4bvARB;
|
||||
glAPI->VertexAttrib4ivARB = __indirect_glVertexAttrib4ivARB;
|
||||
@@ -716,8 +543,209 @@ __GLapi * __glXNewIndirectAPI( void )
|
||||
glAPI->GetProgramLocalParameterfvARB = __indirect_glGetProgramLocalParameterfvARB;
|
||||
glAPI->GetProgramivARB = __indirect_glGetProgramivARB;
|
||||
glAPI->GetProgramStringARB = __indirect_glGetProgramStringARB;
|
||||
glAPI->GetVertexAttribdvARB = __indirect_glGetVertexAttribdvARB;
|
||||
glAPI->GetVertexAttribfvARB = __indirect_glGetVertexAttribfvARB;
|
||||
glAPI->GetVertexAttribivARB = __indirect_glGetVertexAttribivARB;
|
||||
glAPI->VertexAttrib1dARB = __indirect_glVertexAttrib1dARB;
|
||||
glAPI->VertexAttrib1dvARB = __indirect_glVertexAttrib1dvARB;
|
||||
glAPI->VertexAttrib1fARB = __indirect_glVertexAttrib1fARB;
|
||||
glAPI->VertexAttrib1fvARB = __indirect_glVertexAttrib1fvARB;
|
||||
glAPI->VertexAttrib1sARB = __indirect_glVertexAttrib1sARB;
|
||||
glAPI->VertexAttrib1svARB = __indirect_glVertexAttrib1svARB;
|
||||
glAPI->VertexAttrib2dARB = __indirect_glVertexAttrib2dARB;
|
||||
glAPI->VertexAttrib2dvARB = __indirect_glVertexAttrib2dvARB;
|
||||
glAPI->VertexAttrib2fARB = __indirect_glVertexAttrib2fARB;
|
||||
glAPI->VertexAttrib2fvARB = __indirect_glVertexAttrib2fvARB;
|
||||
glAPI->VertexAttrib2sARB = __indirect_glVertexAttrib2sARB;
|
||||
glAPI->VertexAttrib2svARB = __indirect_glVertexAttrib2svARB;
|
||||
glAPI->VertexAttrib3dARB = __indirect_glVertexAttrib3dARB;
|
||||
glAPI->VertexAttrib3dvARB = __indirect_glVertexAttrib3dvARB;
|
||||
glAPI->VertexAttrib3fARB = __indirect_glVertexAttrib3fARB;
|
||||
glAPI->VertexAttrib3fvARB = __indirect_glVertexAttrib3fvARB;
|
||||
glAPI->VertexAttrib3sARB = __indirect_glVertexAttrib3sARB;
|
||||
glAPI->VertexAttrib3svARB = __indirect_glVertexAttrib3svARB;
|
||||
glAPI->VertexAttrib4dARB = __indirect_glVertexAttrib4dARB;
|
||||
glAPI->VertexAttrib4dvARB = __indirect_glVertexAttrib4dvARB;
|
||||
glAPI->VertexAttrib4fARB = __indirect_glVertexAttrib4fARB;
|
||||
glAPI->VertexAttrib4fvARB = __indirect_glVertexAttrib4fvARB;
|
||||
glAPI->VertexAttrib4sARB = __indirect_glVertexAttrib4sARB;
|
||||
glAPI->VertexAttrib4svARB = __indirect_glVertexAttrib4svARB;
|
||||
glAPI->VertexAttrib4NubARB = __indirect_glVertexAttrib4NubARB;
|
||||
glAPI->VertexAttrib4NubvARB = __indirect_glVertexAttrib4NubvARB;
|
||||
|
||||
/* GL_NV_fragment_program */
|
||||
/* 29. GL_ARB_occlusion_query */
|
||||
|
||||
glAPI->EndQueryARB = __indirect_glEndQueryARB;
|
||||
glAPI->GetQueryivARB = __indirect_glGetQueryivARB;
|
||||
glAPI->GetQueryObjectivARB = __indirect_glGetQueryObjectivARB;
|
||||
glAPI->GetQueryObjectuivARB = __indirect_glGetQueryObjectuivARB;
|
||||
glAPI->GenQueriesARB = __indirect_glGenQueriesARB;
|
||||
glAPI->DeleteQueriesARB = __indirect_glDeleteQueriesARB;
|
||||
glAPI->IsQueryARB = __indirect_glIsQueryARB;
|
||||
glAPI->BeginQueryARB = __indirect_glBeginQueryARB;
|
||||
|
||||
/* 37. GL_ARB_draw_buffers */
|
||||
|
||||
glAPI->DrawBuffersARB = __indirect_glDrawBuffersARB;
|
||||
|
||||
/* 20. GL_EXT_texture_object */
|
||||
|
||||
glAPI->GenTexturesEXT = __indirect_glGenTexturesEXT;
|
||||
glAPI->IsTextureEXT = __indirect_glIsTextureEXT;
|
||||
glAPI->AreTexturesResidentEXT = __indirect_glAreTexturesResidentEXT;
|
||||
|
||||
/* 25. GL_SGIS_multisample */
|
||||
|
||||
glAPI->SampleMaskSGIS = __indirect_glSampleMaskSGIS;
|
||||
glAPI->SamplePatternSGIS = __indirect_glSamplePatternSGIS;
|
||||
|
||||
/* 30. GL_EXT_vertex_array */
|
||||
|
||||
glAPI->ColorPointerEXT = __indirect_glColorPointerEXT;
|
||||
glAPI->EdgeFlagPointerEXT = __indirect_glEdgeFlagPointerEXT;
|
||||
glAPI->IndexPointerEXT = __indirect_glIndexPointerEXT;
|
||||
glAPI->NormalPointerEXT = __indirect_glNormalPointerEXT;
|
||||
glAPI->TexCoordPointerEXT = __indirect_glTexCoordPointerEXT;
|
||||
glAPI->VertexPointerEXT = __indirect_glVertexPointerEXT;
|
||||
|
||||
/* 54. GL_EXT_point_parameters */
|
||||
|
||||
glAPI->PointParameterfEXT = __indirect_glPointParameterfEXT;
|
||||
glAPI->PointParameterfvEXT = __indirect_glPointParameterfvEXT;
|
||||
|
||||
/* 145. GL_EXT_secondary_color */
|
||||
|
||||
glAPI->SecondaryColor3usvEXT = __indirect_glSecondaryColor3usvEXT;
|
||||
glAPI->SecondaryColorPointerEXT = __indirect_glSecondaryColorPointerEXT;
|
||||
glAPI->SecondaryColor3bEXT = __indirect_glSecondaryColor3bEXT;
|
||||
glAPI->SecondaryColor3bvEXT = __indirect_glSecondaryColor3bvEXT;
|
||||
glAPI->SecondaryColor3dEXT = __indirect_glSecondaryColor3dEXT;
|
||||
glAPI->SecondaryColor3dvEXT = __indirect_glSecondaryColor3dvEXT;
|
||||
glAPI->SecondaryColor3fEXT = __indirect_glSecondaryColor3fEXT;
|
||||
glAPI->SecondaryColor3fvEXT = __indirect_glSecondaryColor3fvEXT;
|
||||
glAPI->SecondaryColor3iEXT = __indirect_glSecondaryColor3iEXT;
|
||||
glAPI->SecondaryColor3ivEXT = __indirect_glSecondaryColor3ivEXT;
|
||||
glAPI->SecondaryColor3sEXT = __indirect_glSecondaryColor3sEXT;
|
||||
glAPI->SecondaryColor3svEXT = __indirect_glSecondaryColor3svEXT;
|
||||
glAPI->SecondaryColor3ubEXT = __indirect_glSecondaryColor3ubEXT;
|
||||
glAPI->SecondaryColor3ubvEXT = __indirect_glSecondaryColor3ubvEXT;
|
||||
glAPI->SecondaryColor3uiEXT = __indirect_glSecondaryColor3uiEXT;
|
||||
glAPI->SecondaryColor3uivEXT = __indirect_glSecondaryColor3uivEXT;
|
||||
glAPI->SecondaryColor3usEXT = __indirect_glSecondaryColor3usEXT;
|
||||
|
||||
/* 148. GL_EXT_multi_draw_arrays */
|
||||
|
||||
glAPI->MultiDrawArraysEXT = __indirect_glMultiDrawArraysEXT;
|
||||
glAPI->MultiDrawElementsEXT = __indirect_glMultiDrawElementsEXT;
|
||||
|
||||
/* 149. GL_EXT_fog_coord */
|
||||
|
||||
glAPI->FogCoordfEXT = __indirect_glFogCoordfEXT;
|
||||
glAPI->FogCoordfvEXT = __indirect_glFogCoordfvEXT;
|
||||
glAPI->FogCoorddEXT = __indirect_glFogCoorddEXT;
|
||||
glAPI->FogCoorddvEXT = __indirect_glFogCoorddvEXT;
|
||||
glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointerEXT;
|
||||
|
||||
/* 173. GL_EXT_blend_func_separate */
|
||||
|
||||
glAPI->BlendFuncSeparateEXT = __indirect_glBlendFuncSeparateEXT;
|
||||
|
||||
/* 197. GL_MESA_window_pos */
|
||||
|
||||
glAPI->WindowPos2dMESA = __indirect_glWindowPos2dMESA;
|
||||
glAPI->WindowPos2dvMESA = __indirect_glWindowPos2dvMESA;
|
||||
glAPI->WindowPos2fMESA = __indirect_glWindowPos2fMESA;
|
||||
glAPI->WindowPos2fvMESA = __indirect_glWindowPos2fvMESA;
|
||||
glAPI->WindowPos2iMESA = __indirect_glWindowPos2iMESA;
|
||||
glAPI->WindowPos2ivMESA = __indirect_glWindowPos2ivMESA;
|
||||
glAPI->WindowPos2sMESA = __indirect_glWindowPos2sMESA;
|
||||
glAPI->WindowPos2svMESA = __indirect_glWindowPos2svMESA;
|
||||
glAPI->WindowPos3dMESA = __indirect_glWindowPos3dMESA;
|
||||
glAPI->WindowPos3dvMESA = __indirect_glWindowPos3dvMESA;
|
||||
glAPI->WindowPos3fMESA = __indirect_glWindowPos3fMESA;
|
||||
glAPI->WindowPos3fvMESA = __indirect_glWindowPos3fvMESA;
|
||||
glAPI->WindowPos3iMESA = __indirect_glWindowPos3iMESA;
|
||||
glAPI->WindowPos3ivMESA = __indirect_glWindowPos3ivMESA;
|
||||
glAPI->WindowPos3sMESA = __indirect_glWindowPos3sMESA;
|
||||
glAPI->WindowPos3svMESA = __indirect_glWindowPos3svMESA;
|
||||
|
||||
/* 233. GL_NV_vertex_program */
|
||||
|
||||
glAPI->VertexAttribs4svNV = __indirect_glVertexAttribs4svNV;
|
||||
glAPI->VertexAttribs4ubvNV = __indirect_glVertexAttribs4ubvNV;
|
||||
glAPI->VertexAttrib3fNV = __indirect_glVertexAttrib3fNV;
|
||||
glAPI->VertexAttrib3fvNV = __indirect_glVertexAttrib3fvNV;
|
||||
glAPI->VertexAttrib3sNV = __indirect_glVertexAttrib3sNV;
|
||||
glAPI->VertexAttrib3svNV = __indirect_glVertexAttrib3svNV;
|
||||
glAPI->VertexAttrib4dNV = __indirect_glVertexAttrib4dNV;
|
||||
glAPI->VertexAttrib3dvNV = __indirect_glVertexAttrib3dvNV;
|
||||
glAPI->VertexAttrib4fNV = __indirect_glVertexAttrib4fNV;
|
||||
glAPI->VertexAttrib4fvNV = __indirect_glVertexAttrib4fvNV;
|
||||
glAPI->VertexAttrib4sNV = __indirect_glVertexAttrib4sNV;
|
||||
glAPI->VertexAttrib4svNV = __indirect_glVertexAttrib4svNV;
|
||||
glAPI->VertexAttrib4ubNV = __indirect_glVertexAttrib4ubNV;
|
||||
glAPI->VertexAttrib4ubvNV = __indirect_glVertexAttrib4ubvNV;
|
||||
glAPI->VertexAttrib1fvNV = __indirect_glVertexAttrib1fvNV;
|
||||
glAPI->VertexAttrib3dNV = __indirect_glVertexAttrib3dNV;
|
||||
glAPI->VertexAttrib4dvNV = __indirect_glVertexAttrib4dvNV;
|
||||
glAPI->VertexAttrib1sNV = __indirect_glVertexAttrib1sNV;
|
||||
glAPI->VertexAttrib1fNV = __indirect_glVertexAttrib1fNV;
|
||||
glAPI->VertexAttrib1svNV = __indirect_glVertexAttrib1svNV;
|
||||
glAPI->VertexAttrib1dvNV = __indirect_glVertexAttrib1dvNV;
|
||||
glAPI->AreProgramsResidentNV = __indirect_glAreProgramsResidentNV;
|
||||
glAPI->BindProgramNV = __indirect_glBindProgramNV;
|
||||
glAPI->DeleteProgramsNV = __indirect_glDeleteProgramsNV;
|
||||
glAPI->ExecuteProgramNV = __indirect_glExecuteProgramNV;
|
||||
glAPI->GenProgramsNV = __indirect_glGenProgramsNV;
|
||||
glAPI->GetProgramParameterdvNV = __indirect_glGetProgramParameterdvNV;
|
||||
glAPI->GetProgramParameterfvNV = __indirect_glGetProgramParameterfvNV;
|
||||
glAPI->GetProgramivNV = __indirect_glGetProgramivNV;
|
||||
glAPI->GetProgramStringNV = __indirect_glGetProgramStringNV;
|
||||
glAPI->GetTrackMatrixivNV = __indirect_glGetTrackMatrixivNV;
|
||||
glAPI->GetVertexAttribPointervNV = __indirect_glGetVertexAttribPointervNV;
|
||||
glAPI->IsProgramNV = __indirect_glIsProgramNV;
|
||||
glAPI->LoadProgramNV = __indirect_glLoadProgramNV;
|
||||
glAPI->ProgramParameter4dNV = __indirect_glProgramParameter4dNV;
|
||||
glAPI->ProgramParameter4dvNV = __indirect_glProgramParameter4dvNV;
|
||||
glAPI->ProgramParameter4fNV = __indirect_glProgramParameter4fNV;
|
||||
glAPI->ProgramParameter4fvNV = __indirect_glProgramParameter4fvNV;
|
||||
glAPI->ProgramParameters4dvNV = __indirect_glProgramParameters4dvNV;
|
||||
glAPI->ProgramParameters4fvNV = __indirect_glProgramParameters4fvNV;
|
||||
glAPI->RequestResidentProgramsNV = __indirect_glRequestResidentProgramsNV;
|
||||
glAPI->TrackMatrixNV = __indirect_glTrackMatrixNV;
|
||||
glAPI->VertexAttribPointerNV = __indirect_glVertexAttribPointerNV;
|
||||
glAPI->VertexAttrib2dNV = __indirect_glVertexAttrib2dNV;
|
||||
glAPI->VertexAttrib2sNV = __indirect_glVertexAttrib2sNV;
|
||||
glAPI->VertexAttrib2dvNV = __indirect_glVertexAttrib2dvNV;
|
||||
glAPI->VertexAttrib2fNV = __indirect_glVertexAttrib2fNV;
|
||||
glAPI->VertexAttrib2svNV = __indirect_glVertexAttrib2svNV;
|
||||
glAPI->VertexAttrib2fvNV = __indirect_glVertexAttrib2fvNV;
|
||||
glAPI->GetVertexAttribdvNV = __indirect_glGetVertexAttribdvNV;
|
||||
glAPI->GetVertexAttribfvNV = __indirect_glGetVertexAttribfvNV;
|
||||
glAPI->GetVertexAttribivNV = __indirect_glGetVertexAttribivNV;
|
||||
glAPI->VertexAttrib1dNV = __indirect_glVertexAttrib1dNV;
|
||||
glAPI->VertexAttribs1dvNV = __indirect_glVertexAttribs1dvNV;
|
||||
glAPI->VertexAttribs1fvNV = __indirect_glVertexAttribs1fvNV;
|
||||
glAPI->VertexAttribs1svNV = __indirect_glVertexAttribs1svNV;
|
||||
glAPI->VertexAttribs2dvNV = __indirect_glVertexAttribs2dvNV;
|
||||
glAPI->VertexAttribs2fvNV = __indirect_glVertexAttribs2fvNV;
|
||||
glAPI->VertexAttribs2svNV = __indirect_glVertexAttribs2svNV;
|
||||
glAPI->VertexAttribs3dvNV = __indirect_glVertexAttribs3dvNV;
|
||||
glAPI->VertexAttribs3fvNV = __indirect_glVertexAttribs3fvNV;
|
||||
glAPI->VertexAttribs3svNV = __indirect_glVertexAttribs3svNV;
|
||||
glAPI->VertexAttribs4dvNV = __indirect_glVertexAttribs4dvNV;
|
||||
glAPI->VertexAttribs4fvNV = __indirect_glVertexAttribs4fvNV;
|
||||
|
||||
/* 262. GL_NV_point_sprite */
|
||||
|
||||
glAPI->PointParameteriNV = __indirect_glPointParameteriNV;
|
||||
glAPI->PointParameterivNV = __indirect_glPointParameterivNV;
|
||||
|
||||
/* 268. GL_EXT_stencil_two_side */
|
||||
|
||||
glAPI->ActiveStencilFaceEXT = __indirect_glActiveStencilFaceEXT;
|
||||
|
||||
/* 282. GL_NV_fragment_program */
|
||||
|
||||
glAPI->ProgramNamedParameter4fNV = __indirect_glProgramNamedParameter4fNV;
|
||||
glAPI->ProgramNamedParameter4dNV = __indirect_glProgramNamedParameter4dNV;
|
||||
@@ -726,48 +754,25 @@ __GLapi * __glXNewIndirectAPI( void )
|
||||
glAPI->GetProgramNamedParameterfvNV = __indirect_glGetProgramNamedParameterfvNV;
|
||||
glAPI->GetProgramNamedParameterdvNV = __indirect_glGetProgramNamedParameterdvNV;
|
||||
|
||||
/* GL_ARB_occlusion_query */
|
||||
/* 310. GL_EXT_framebuffer_object */
|
||||
|
||||
glAPI->GenQueriesARB = __indirect_glGenQueriesARB;
|
||||
glAPI->DeleteQueriesARB = __indirect_glDeleteQueriesARB;
|
||||
glAPI->IsQueryARB = __indirect_glIsQueryARB;
|
||||
glAPI->BeginQueryARB = __indirect_glBeginQueryARB;
|
||||
glAPI->EndQueryARB = __indirect_glEndQueryARB;
|
||||
glAPI->GetQueryivARB = __indirect_glGetQueryivARB;
|
||||
glAPI->GetQueryObjectivARB = __indirect_glGetQueryObjectivARB;
|
||||
glAPI->GetQueryObjectuivARB = __indirect_glGetQueryObjectuivARB;
|
||||
|
||||
/* GL_NV_vertex_program */
|
||||
|
||||
glAPI->GetVertexAttribdvNV = __indirect_glGetVertexAttribdvNV;
|
||||
glAPI->GetVertexAttribfvNV = __indirect_glGetVertexAttribfvNV;
|
||||
glAPI->GetVertexAttribivNV = __indirect_glGetVertexAttribivNV;
|
||||
glAPI->VertexAttrib1dNV = __indirect_glVertexAttrib1dNV;
|
||||
glAPI->VertexAttrib1dvNV = __indirect_glVertexAttrib1dvNV;
|
||||
glAPI->VertexAttrib1fNV = __indirect_glVertexAttrib1fNV;
|
||||
glAPI->VertexAttrib1fvNV = __indirect_glVertexAttrib1fvNV;
|
||||
glAPI->VertexAttrib1sNV = __indirect_glVertexAttrib1sNV;
|
||||
glAPI->VertexAttrib1svNV = __indirect_glVertexAttrib1svNV;
|
||||
glAPI->VertexAttrib2dNV = __indirect_glVertexAttrib2dNV;
|
||||
glAPI->VertexAttrib2dvNV = __indirect_glVertexAttrib2dvNV;
|
||||
glAPI->VertexAttrib2fNV = __indirect_glVertexAttrib2fNV;
|
||||
glAPI->VertexAttrib2fvNV = __indirect_glVertexAttrib2fvNV;
|
||||
glAPI->VertexAttrib2sNV = __indirect_glVertexAttrib2sNV;
|
||||
glAPI->VertexAttrib2svNV = __indirect_glVertexAttrib2svNV;
|
||||
glAPI->VertexAttrib3dNV = __indirect_glVertexAttrib3dNV;
|
||||
glAPI->VertexAttrib3dvNV = __indirect_glVertexAttrib3dvNV;
|
||||
glAPI->VertexAttrib3fNV = __indirect_glVertexAttrib3fNV;
|
||||
glAPI->VertexAttrib3fvNV = __indirect_glVertexAttrib3fvNV;
|
||||
glAPI->VertexAttrib3sNV = __indirect_glVertexAttrib3sNV;
|
||||
glAPI->VertexAttrib3svNV = __indirect_glVertexAttrib3svNV;
|
||||
glAPI->VertexAttrib4dNV = __indirect_glVertexAttrib4dNV;
|
||||
glAPI->VertexAttrib4dvNV = __indirect_glVertexAttrib4dvNV;
|
||||
glAPI->VertexAttrib4fNV = __indirect_glVertexAttrib4fNV;
|
||||
glAPI->VertexAttrib4fvNV = __indirect_glVertexAttrib4fvNV;
|
||||
glAPI->VertexAttrib4sNV = __indirect_glVertexAttrib4sNV;
|
||||
glAPI->VertexAttrib4svNV = __indirect_glVertexAttrib4svNV;
|
||||
glAPI->VertexAttrib4ubNV = __indirect_glVertexAttrib4ubNV;
|
||||
glAPI->VertexAttrib4ubvNV = __indirect_glVertexAttrib4ubvNV;
|
||||
glAPI->RenderbufferStorageEXT = __indirect_glRenderbufferStorageEXT;
|
||||
glAPI->GetRenderbufferParameterivEXT = __indirect_glGetRenderbufferParameterivEXT;
|
||||
glAPI->IsFramebufferEXT = __indirect_glIsFramebufferEXT;
|
||||
glAPI->BindFramebufferEXT = __indirect_glBindFramebufferEXT;
|
||||
glAPI->DeleteFramebuffersEXT = __indirect_glDeleteFramebuffersEXT;
|
||||
glAPI->GenFramebuffersEXT = __indirect_glGenFramebuffersEXT;
|
||||
glAPI->CheckFramebufferStatusEXT = __indirect_glCheckFramebufferStatusEXT;
|
||||
glAPI->FramebufferTexture1DEXT = __indirect_glFramebufferTexture1DEXT;
|
||||
glAPI->FramebufferTexture2DEXT = __indirect_glFramebufferTexture2DEXT;
|
||||
glAPI->FramebufferTexture3DEXT = __indirect_glFramebufferTexture3DEXT;
|
||||
glAPI->FramebufferRenderbufferEXT = __indirect_glFramebufferRenderbufferEXT;
|
||||
glAPI->GetFramebufferAttachmentParameterivEXT = __indirect_glGetFramebufferAttachmentParameterivEXT;
|
||||
glAPI->GenerateMipmapEXT = __indirect_glGenerateMipmapEXT;
|
||||
glAPI->IsRenderbufferEXT = __indirect_glIsRenderbufferEXT;
|
||||
glAPI->BindRenderbufferEXT = __indirect_glBindRenderbufferEXT;
|
||||
glAPI->DeleteRenderbuffersEXT = __indirect_glDeleteRenderbuffersEXT;
|
||||
glAPI->GenRenderbuffersEXT = __indirect_glGenRenderbuffersEXT;
|
||||
|
||||
return glAPI;
|
||||
}
|
||||
|
||||
@@ -334,22 +334,18 @@ __glPointParameterfvEXT_size( GLenum e )
|
||||
switch( e ) {
|
||||
case GL_POINT_SIZE_MIN:
|
||||
/* case GL_POINT_SIZE_MIN_ARB:*/
|
||||
/* case GL_POINT_SIZE_MIN_EXT:*/
|
||||
/* case GL_POINT_SIZE_MIN_SGIS:*/
|
||||
case GL_POINT_SIZE_MAX:
|
||||
/* case GL_POINT_SIZE_MAX_ARB:*/
|
||||
/* case GL_POINT_SIZE_MAX_EXT:*/
|
||||
/* case GL_POINT_SIZE_MAX_SGIS:*/
|
||||
case GL_POINT_FADE_THRESHOLD_SIZE:
|
||||
/* case GL_POINT_FADE_THRESHOLD_SIZE_ARB:*/
|
||||
/* case GL_POINT_FADE_THRESHOLD_SIZE_EXT:*/
|
||||
/* case GL_POINT_FADE_THRESHOLD_SIZE_SGIS:*/
|
||||
case GL_POINT_SPRITE_R_MODE_NV:
|
||||
case GL_POINT_SPRITE_COORD_ORIGIN:
|
||||
return 1;
|
||||
case GL_POINT_DISTANCE_ATTENUATION:
|
||||
/* case GL_POINT_DISTANCE_ATTENUATION_ARB:*/
|
||||
/* case GL_POINT_DISTANCE_ATTENUATION_EXT:*/
|
||||
/* case GL_POINT_DISTANCE_ATTENUATION_SGIS:*/
|
||||
return 3;
|
||||
default: return 0;
|
||||
@@ -369,3 +365,8 @@ ALIAS( Map2f, Map2d )
|
||||
ALIAS( ColorTableParameteriv, ColorTableParameterfv )
|
||||
ALIAS( ConvolutionParameteriv, ConvolutionParameterfv )
|
||||
ALIAS( PointParameterivNV, PointParameterfvEXT )
|
||||
|
||||
# undef HAVE_ALIAS
|
||||
# undef PURE
|
||||
# undef FASTCALL
|
||||
# undef INTERNAL
|
||||
|
||||
@@ -220,6 +220,7 @@ tags:
|
||||
|
||||
clean:
|
||||
-rm -f */*.o
|
||||
-rm -f */*/*.o
|
||||
-rm -f depend depend.bak mesa.a
|
||||
-rm -f drivers/*/*.o
|
||||
(cd drivers/dri ; $(MAKE) clean)
|
||||
|
||||
@@ -45,7 +45,8 @@ install:
|
||||
echo "*** Installation aborted."; \
|
||||
exit 1; \
|
||||
fi;
|
||||
install -m 0755 $(DIRECTFBGL_MESA) $(DFB_MODULEDIR)/interfaces/IDirectFBGL/
|
||||
test -d $(DFB_MODULEDIR)/interfaces/IDirectFBGL/ || mkdir $(DFB_MODULEDIR)/interfaces/IDirectFBGL/
|
||||
install -m 755 $(DIRECTFBGL_MESA) $(DFB_MODULEDIR)/interfaces/IDirectFBGL/
|
||||
|
||||
|
||||
clean:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2004 Claudio Ciccani <klan@users.sf.net>
|
||||
* Copyright (C) 2004-2005 Claudio Ciccani <klan@users.sf.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
@@ -38,6 +38,8 @@
|
||||
#include "buffers.h"
|
||||
#include "context.h"
|
||||
#include "extensions.h"
|
||||
#include "framebuffer.h"
|
||||
#include "renderbuffer.h"
|
||||
#include "imports.h"
|
||||
#include "texformat.h"
|
||||
#include "teximage.h"
|
||||
@@ -84,6 +86,7 @@ typedef struct {
|
||||
GLvisual visual;
|
||||
GLframebuffer framebuffer;
|
||||
GLcontext context;
|
||||
struct gl_renderbuffer render;
|
||||
} IDirectFBGL_data;
|
||||
|
||||
|
||||
@@ -93,7 +96,7 @@ static bool dfb_mesa_create_context ( GLcontext *context,
|
||||
GLframebuffer *framebuffer,
|
||||
GLvisual *visual,
|
||||
DFBSurfacePixelFormat format,
|
||||
void *data );
|
||||
IDirectFBGL_data *data );
|
||||
static void dfb_mesa_destroy_context( GLcontext *context,
|
||||
GLframebuffer *framebuffer );
|
||||
|
||||
@@ -155,6 +158,8 @@ IDirectFBGL_Lock( IDirectFBGL *thiz )
|
||||
return err;
|
||||
}
|
||||
data->video.end = data->video.start + (height-1) * data->video.pitch;
|
||||
|
||||
data->render.Data = data->video.start;
|
||||
|
||||
if (data->width != width || data->height != height) {
|
||||
data->width = width;
|
||||
@@ -248,7 +253,7 @@ Construct( IDirectFBGL *thiz,
|
||||
|
||||
/* Create context. */
|
||||
if (!dfb_mesa_create_context( &data->context, &data->framebuffer,
|
||||
&data->visual, data->format, (void*) data )) {
|
||||
&data->visual, data->format, data )) {
|
||||
D_ERROR( "DirectFBGL/Mesa: failed to create context.\n" );
|
||||
surface->Release( surface );
|
||||
return DFB_UNSUPPORTED;
|
||||
@@ -312,134 +317,144 @@ set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
delete_renderbuffer( struct gl_renderbuffer *render )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static GLboolean
|
||||
renderbuffer_storage( GLcontext *ctx, struct gl_renderbuffer *render,
|
||||
GLenum internalFormat, GLuint width, GLuint height )
|
||||
{
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* RGB332 */
|
||||
#define NAME(PREFIX) PREFIX##_RGB332
|
||||
#define FORMAT GL_RGBA8
|
||||
#define SPAN_VARS \
|
||||
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
|
||||
#define INIT_PIXEL_PTR(P, X, Y) \
|
||||
GLubyte *P = data->video.end - (Y) * data->video.pitch + (X)
|
||||
GLubyte *P = data->video.end - (Y) * data->video.pitch + (X);
|
||||
#define INC_PIXEL_PTR(P) P += 1
|
||||
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
|
||||
*P = ( (((R) & 0xe0)) | (((G) & 0xe0) >> 3) | ((B) >> 6) )
|
||||
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
|
||||
*P = ( (((R) & 0xe0)) | (((G) & 0xe0) >> 3) | ((B) >> 6) )
|
||||
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
|
||||
R = ((*P & 0xe0) ); \
|
||||
G = ((*P & 0x1c) << 3); \
|
||||
B = ((*P & 0x03) << 6); \
|
||||
A = CHAN_MAX
|
||||
#define STORE_PIXEL(P, X, Y, S) \
|
||||
*P = ( (((S[RCOMP]) & 0xe0)) | (((S[GCOMP]) & 0xe0) >> 3) | ((S[BCOMP]) >> 6) )
|
||||
#define FETCH_PIXEL(D, P) \
|
||||
D[RCOMP] = ((*P & 0xe0) ); \
|
||||
D[GCOMP] = ((*P & 0x1c) << 3); \
|
||||
D[BCOMP] = ((*P & 0x03) << 6); \
|
||||
D[ACOMP] = 0xff
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
/* ARGB1555 */
|
||||
#define NAME(PREFIX) PREFIX##_ARGB1555
|
||||
#define FORMAT GL_RGBA8
|
||||
#define SPAN_VARS \
|
||||
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
|
||||
#define INIT_PIXEL_PTR(P, X, Y) \
|
||||
GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2)
|
||||
GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2);
|
||||
#define INC_PIXEL_PTR(P) P += 1
|
||||
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
|
||||
*P = ( (((R) & 0xf8) << 7) | (((G) & 0xf8) << 2) | ((B) >> 3) )
|
||||
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
|
||||
*P = ( (((A) & 0x80) << 8) | (((R) & 0xf8) << 7) | (((G) & 0xf8) << 2) | ((B) >> 3) )
|
||||
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
|
||||
R = ((*P & 0x7c00) >> 7); \
|
||||
G = ((*P & 0x03e0) >> 2); \
|
||||
B = ((*P & 0x001f) << 3); \
|
||||
A = ((*P & 0x8000) ? 0xff : 0)
|
||||
#define STORE_PIXEL(P, X, Y, S) \
|
||||
*P = ( (((S[RCOMP]) & 0xf8) << 7) | (((S[GCOMP]) & 0xf8) << 2) | ((S[BCOMP]) >> 3) )
|
||||
#define FETCH_PIXEL(D, P) \
|
||||
D[RCOMP] = ((*P & 0x7c00) >> 7); \
|
||||
D[GCOMP] = ((*P & 0x03e0) >> 2); \
|
||||
D[BCOMP] = ((*P & 0x001f) << 3); \
|
||||
D[ACOMP] = ((*P & 0x8000) ? 0xff : 0)
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
/* RGB16 */
|
||||
#define NAME(PREFIX) PREFIX##_RGB16
|
||||
#define FORMAT GL_RGBA8
|
||||
#define SPAN_VARS \
|
||||
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
|
||||
#define INIT_PIXEL_PTR(P, X, Y) \
|
||||
GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2)
|
||||
GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2);
|
||||
#define INC_PIXEL_PTR(P) P += 1
|
||||
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
|
||||
*P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) )
|
||||
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
|
||||
*P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) )
|
||||
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
|
||||
R = ((*P & 0xf800) >> 8); \
|
||||
G = ((*P & 0x07e0) >> 3); \
|
||||
B = ((*P & 0x001f) << 3); \
|
||||
A = CHAN_MAX
|
||||
#define STORE_PIXEL(P, X, Y, S) \
|
||||
*P = ( (((S[RCOMP]) & 0xf8) << 8) | (((S[GCOMP]) & 0xfc) << 3) | ((S[BCOMP]) >> 3) )
|
||||
#define FETCH_PIXEL(D, P) \
|
||||
D[RCOMP] = ((*P & 0xf800) >> 8); \
|
||||
D[GCOMP] = ((*P & 0x07e0) >> 3); \
|
||||
D[BCOMP] = ((*P & 0x001f) << 3); \
|
||||
D[ACOMP] = 0xff
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
/* RGB24 */
|
||||
#define NAME(PREFIX) PREFIX##_RGB24
|
||||
#define FORMAT GL_RGBA8
|
||||
#define SPAN_VARS \
|
||||
IDirectFBGL_data *data = ctx->DriverCtx;
|
||||
#define INIT_PIXEL_PTR(P, X, Y) \
|
||||
GLubyte *P = data->video.end - (Y) * data->video.pitch + (X) * 3
|
||||
GLubyte *P = data->video.end - (Y) * data->video.pitch + (X) * 3;
|
||||
#define INC_PIXEL_PTR(P) P += 3
|
||||
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
|
||||
P[0] = B; P[1] = G; P[2] = R
|
||||
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
|
||||
P[0] = B; P[1] = G; P[2] = R
|
||||
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
|
||||
R = P[2]; G = P[1]; B = P[0]; A = CHAN_MAX
|
||||
#define STORE_PIXEL(P, X, Y, S) \
|
||||
P[0] = S[BCOMP]; P[1] = S[GCOMP]; P[2] = S[BCOMP]
|
||||
#define FETCH_PIXEL(D, P) \
|
||||
D[RCOMP] = P[2]; D[GCOMP] = P[1]; D[BCOMP] = P[0]; D[ACOMP] = 0xff
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
/* RGB32 */
|
||||
#define NAME(PREFIX) PREFIX##_RGB32
|
||||
#define FORMAT GL_RGBA8
|
||||
#define SPAN_VARS \
|
||||
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
|
||||
#define INIT_PIXEL_PTR(P, X, Y) \
|
||||
GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4)
|
||||
GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4);
|
||||
#define INC_PIXEL_PTR(P) P += 1
|
||||
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
|
||||
*P = ( ((R) << 16) | ((G) << 8) | (B) )
|
||||
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
|
||||
*P = ( ((R) << 16) | ((G) << 8) | (B) )
|
||||
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
|
||||
R = ((*P & 0x00ff0000) >> 16); \
|
||||
G = ((*P & 0x0000ff00) >> 8); \
|
||||
B = ((*P & 0x000000ff) ); \
|
||||
A = CHAN_MAX
|
||||
#define STORE_PIXEL(P, X, Y, S) \
|
||||
*P = ( ((S[RCOMP]) << 16) | ((S[GCOMP]) << 8) | (S[BCOMP]) )
|
||||
#define FETCH_PIXEL(D, P) \
|
||||
D[RCOMP] = ((*P & 0x00ff0000) >> 16); \
|
||||
D[GCOMP] = ((*P & 0x0000ff00) >> 8); \
|
||||
D[BCOMP] = ((*P & 0x000000ff) ); \
|
||||
D[ACOMP] = 0xff
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
/* ARGB */
|
||||
#define NAME(PREFIX) PREFIX##_ARGB
|
||||
#define FORMAT GL_RGBA8
|
||||
#define SPAN_VARS \
|
||||
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
|
||||
#define INIT_PIXEL_PTR(P, X, Y) \
|
||||
GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4)
|
||||
GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4);
|
||||
#define INC_PIXEL_PTR(P) P += 1
|
||||
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
|
||||
*P = ( 0xff000000 | ((R) << 16) | ((G) << 8) | (B) )
|
||||
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
|
||||
*P = ( ((A) << 24) | ((R) << 16) | ((G) << 8) | (B) )
|
||||
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
|
||||
R = ((*P & 0x00ff0000) >> 16); \
|
||||
G = ((*P & 0x0000ff00) >> 8); \
|
||||
B = ((*P & 0x000000ff) ); \
|
||||
A = ((*P & 0xff000000) >> 24)
|
||||
#define STORE_PIXEL_RGB(P, X, Y, S) \
|
||||
*P = ( 0xff000000 | ((S[RCOMP]) << 16) | ((S[GCOMP]) << 8) | (S[BCOMP]) )
|
||||
#define STORE_PIXEL(P, X, Y, S) \
|
||||
*P = ( ((S[ACOMP]) << 24) | ((S[RCOMP]) << 16) | ((S[GCOMP]) << 8) | (S[BCOMP]) )
|
||||
#define FETCH_PIXEL(D, P) \
|
||||
D[RCOMP] = ((*P & 0x00ff0000) >> 16); \
|
||||
D[GCOMP] = ((*P & 0x0000ff00) >> 8); \
|
||||
D[BCOMP] = ((*P & 0x000000ff) ); \
|
||||
D[ACOMP] = ((*P & 0xff000000) >> 24)
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
/* AiRGB */
|
||||
#define NAME(PREFIX) PREFIX##_AiRGB
|
||||
#define FORMAT GL_RGBA8
|
||||
#define SPAN_VARS \
|
||||
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
|
||||
#define INIT_PIXEL_PTR(P, X, Y) \
|
||||
GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4)
|
||||
GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4);
|
||||
#define INC_PIXEL_PTR(P) P += 1
|
||||
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
|
||||
*P = ( ((R) << 16) | ((G) << 8) | (B) )
|
||||
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
|
||||
*P = ( ((0xff - (A)) << 24) | ((R) << 16) | ((G) << 8) | (B) )
|
||||
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
|
||||
R = ((*P & 0x00ff0000) >> 16); \
|
||||
G = ((*P & 0x0000ff00) >> 8); \
|
||||
B = ((*P & 0x000000ff) ); \
|
||||
A = (0xff - ((*P & 0xff000000) >> 24))
|
||||
#define STORE_PIXEL_RGB(P, X, Y, S) \
|
||||
*P = ( ((S[RCOMP]) << 16) | ((S[GCOMP]) << 8) | (S[BCOMP]) )
|
||||
#define STORE_PIXEL(P, X, Y, S) \
|
||||
*P = ( ((0xff - (S[ACOMP])) << 24) | ((S[RCOMP]) << 16) | ((S[GCOMP]) << 8) | (S[BCOMP]) )
|
||||
#define FETCH_PIXEL(D, P) \
|
||||
D[RCOMP] = ((*P & 0x00ff0000) >> 16); \
|
||||
D[GCOMP] = ((*P & 0x0000ff00) >> 8); \
|
||||
D[BCOMP] = ((*P & 0x000000ff) ); \
|
||||
D[ACOMP] = (0xff - ((*P & 0xff000000) >> 24))
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
@@ -520,16 +535,12 @@ dfb_mesa_create_context( GLcontext *context,
|
||||
GLframebuffer *framebuffer,
|
||||
GLvisual *visual,
|
||||
DFBSurfacePixelFormat format,
|
||||
void *data )
|
||||
IDirectFBGL_data *data )
|
||||
{
|
||||
struct dd_function_table functions;
|
||||
struct swrast_device_driver *swdd;
|
||||
|
||||
_mesa_initialize_framebuffer( framebuffer, visual,
|
||||
visual->haveDepthBuffer,
|
||||
visual->haveStencilBuffer,
|
||||
visual->haveAccumBuffer,
|
||||
visual->accumAlphaBits > 0 );
|
||||
_mesa_initialize_framebuffer( framebuffer, visual );
|
||||
|
||||
_mesa_init_driver_functions( &functions );
|
||||
functions.GetString = get_string;
|
||||
@@ -538,7 +549,7 @@ dfb_mesa_create_context( GLcontext *context,
|
||||
functions.Viewport = set_viewport;
|
||||
|
||||
if (!_mesa_initialize_context( context, visual, NULL,
|
||||
&functions, data )) {
|
||||
&functions, (void*) data )) {
|
||||
D_DEBUG( "DirectFBGL/Mesa: _mesa_initialize_context() failed.\n" );
|
||||
_mesa_free_framebuffer_data( framebuffer );
|
||||
return false;
|
||||
@@ -552,80 +563,92 @@ dfb_mesa_create_context( GLcontext *context,
|
||||
|
||||
swdd = _swrast_GetDeviceDriverReference( context );
|
||||
swdd->SetBuffer = set_buffer;
|
||||
|
||||
_mesa_init_renderbuffer( &data->render, 0 );
|
||||
data->render.InternalFormat = GL_RGBA;
|
||||
data->render._BaseFormat = GL_RGBA;
|
||||
data->render.DataType = GL_UNSIGNED_BYTE;
|
||||
data->render.Data = data->video.start;
|
||||
data->render.Delete = delete_renderbuffer;
|
||||
data->render.AllocStorage = renderbuffer_storage;
|
||||
|
||||
switch (format) {
|
||||
case DSPF_RGB332:
|
||||
swdd->WriteRGBASpan = write_rgba_span_RGB332;
|
||||
swdd->WriteRGBSpan = write_rgb_span_RGB332;
|
||||
swdd->WriteMonoRGBASpan = write_monorgba_span_RGB332;
|
||||
swdd->WriteRGBAPixels = write_rgba_pixels_RGB332;
|
||||
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB332;
|
||||
swdd->ReadRGBASpan = read_rgba_span_RGB332;
|
||||
swdd->ReadRGBAPixels = read_rgba_pixels_RGB332;
|
||||
case DSPF_RGB332:
|
||||
data->render.GetRow = get_row_RGB332;
|
||||
data->render.GetValues = get_values_RGB332;
|
||||
data->render.PutRow = put_row_RGB332;
|
||||
data->render.PutMonoRow = put_mono_row_RGB332;
|
||||
data->render.PutValues = put_values_RGB332;
|
||||
data->render.PutMonoValues = put_mono_values_RGB332;
|
||||
break;
|
||||
case DSPF_ARGB1555:
|
||||
swdd->WriteRGBASpan = write_rgba_span_ARGB1555;
|
||||
swdd->WriteRGBSpan = write_rgb_span_ARGB1555;
|
||||
swdd->WriteMonoRGBASpan = write_monorgba_span_ARGB1555;
|
||||
swdd->WriteRGBAPixels = write_rgba_pixels_ARGB1555;
|
||||
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_ARGB1555;
|
||||
swdd->ReadRGBASpan = read_rgba_span_ARGB1555;
|
||||
swdd->ReadRGBAPixels = read_rgba_pixels_ARGB1555;
|
||||
data->render.GetRow = get_row_ARGB1555;
|
||||
data->render.GetValues = get_values_ARGB1555;
|
||||
data->render.PutRow = put_row_ARGB1555;
|
||||
data->render.PutMonoRow = put_mono_row_ARGB1555;
|
||||
data->render.PutValues = put_values_ARGB1555;
|
||||
data->render.PutMonoValues = put_mono_values_ARGB1555;
|
||||
break;
|
||||
case DSPF_RGB16:
|
||||
swdd->WriteRGBASpan = write_rgba_span_RGB16;
|
||||
swdd->WriteRGBSpan = write_rgb_span_RGB16;
|
||||
swdd->WriteMonoRGBASpan = write_monorgba_span_RGB16;
|
||||
swdd->WriteRGBAPixels = write_rgba_pixels_RGB16;
|
||||
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB16;
|
||||
swdd->ReadRGBASpan = read_rgba_span_RGB16;
|
||||
swdd->ReadRGBAPixels = read_rgba_pixels_RGB16;
|
||||
data->render.GetRow = get_row_RGB16;
|
||||
data->render.GetValues = get_values_RGB16;
|
||||
data->render.PutRow = put_row_RGB16;
|
||||
data->render.PutMonoRow = put_mono_row_RGB16;
|
||||
data->render.PutValues = put_values_RGB16;
|
||||
data->render.PutMonoValues = put_mono_values_RGB16;
|
||||
break;
|
||||
case DSPF_RGB24:
|
||||
swdd->WriteRGBASpan = write_rgba_span_RGB24;
|
||||
swdd->WriteRGBSpan = write_rgb_span_RGB24;
|
||||
swdd->WriteMonoRGBASpan = write_monorgba_span_RGB24;
|
||||
swdd->WriteRGBAPixels = write_rgba_pixels_RGB24;
|
||||
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB24;
|
||||
swdd->ReadRGBASpan = read_rgba_span_RGB24;
|
||||
swdd->ReadRGBAPixels = read_rgba_pixels_RGB24;
|
||||
case DSPF_RGB24:
|
||||
data->render.GetRow = get_row_RGB24;
|
||||
data->render.GetValues = get_values_RGB24;
|
||||
data->render.PutRow = put_row_RGB24;
|
||||
data->render.PutMonoRow = put_mono_row_RGB24;
|
||||
data->render.PutValues = put_values_RGB24;
|
||||
data->render.PutMonoValues = put_mono_values_RGB24;
|
||||
break;
|
||||
case DSPF_RGB32:
|
||||
swdd->WriteRGBASpan = write_rgba_span_RGB32;
|
||||
swdd->WriteRGBSpan = write_rgb_span_RGB32;
|
||||
swdd->WriteMonoRGBASpan = write_monorgba_span_RGB32;
|
||||
swdd->WriteRGBAPixels = write_rgba_pixels_RGB32;
|
||||
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB32;
|
||||
swdd->ReadRGBASpan = read_rgba_span_RGB32;
|
||||
swdd->ReadRGBAPixels = read_rgba_pixels_RGB32;
|
||||
data->render.GetRow = get_row_RGB32;
|
||||
data->render.GetValues = get_values_RGB32;
|
||||
data->render.PutRow = put_row_RGB32;
|
||||
data->render.PutMonoRow = put_mono_row_RGB32;
|
||||
data->render.PutValues = put_values_RGB32;
|
||||
data->render.PutMonoValues = put_mono_values_RGB32;
|
||||
break;
|
||||
case DSPF_ARGB:
|
||||
swdd->WriteRGBASpan = write_rgba_span_ARGB;
|
||||
swdd->WriteRGBSpan = write_rgb_span_ARGB;
|
||||
swdd->WriteMonoRGBASpan = write_monorgba_span_ARGB;
|
||||
swdd->WriteRGBAPixels = write_rgba_pixels_ARGB;
|
||||
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_ARGB;
|
||||
swdd->ReadRGBASpan = read_rgba_span_ARGB;
|
||||
swdd->ReadRGBAPixels = read_rgba_pixels_ARGB;
|
||||
data->render.GetRow = get_row_ARGB;
|
||||
data->render.GetValues = get_values_ARGB;
|
||||
data->render.PutRow = put_row_ARGB;
|
||||
data->render.PutMonoRow = put_mono_row_ARGB;
|
||||
data->render.PutValues = put_values_ARGB;
|
||||
data->render.PutMonoValues = put_mono_values_ARGB;
|
||||
break;
|
||||
case DSPF_AiRGB:
|
||||
swdd->WriteRGBASpan = write_rgba_span_AiRGB;
|
||||
swdd->WriteRGBSpan = write_rgb_span_AiRGB;
|
||||
swdd->WriteMonoRGBASpan = write_monorgba_span_AiRGB;
|
||||
swdd->WriteRGBAPixels = write_rgba_pixels_AiRGB;
|
||||
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_AiRGB;
|
||||
swdd->ReadRGBASpan = read_rgba_span_AiRGB;
|
||||
swdd->ReadRGBAPixels = read_rgba_pixels_AiRGB;
|
||||
data->render.GetRow = get_row_AiRGB;
|
||||
data->render.GetValues = get_values_AiRGB;
|
||||
data->render.PutRow = put_row_AiRGB;
|
||||
data->render.PutMonoRow = put_mono_row_AiRGB;
|
||||
data->render.PutValues = put_values_AiRGB;
|
||||
data->render.PutMonoValues = put_mono_values_AiRGB;
|
||||
break;
|
||||
default:
|
||||
D_BUG( "unexpected pixelformat" );
|
||||
return false;
|
||||
}
|
||||
|
||||
_mesa_add_renderbuffer( framebuffer, BUFFER_FRONT_LEFT, &data->render );
|
||||
|
||||
_mesa_add_soft_renderbuffers( framebuffer,
|
||||
GL_FALSE,
|
||||
visual->haveDepthBuffer,
|
||||
visual->haveStencilBuffer,
|
||||
visual->haveAccumBuffer,
|
||||
GL_FALSE,
|
||||
GL_FALSE );
|
||||
|
||||
TNL_CONTEXT( context )->Driver.RunPipeline = _tnl_run_pipeline;
|
||||
|
||||
_mesa_enable_sw_extensions( context );
|
||||
|
||||
_mesa_make_current( context, framebuffer );
|
||||
_mesa_make_current( context, framebuffer, framebuffer );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -634,7 +657,7 @@ static void
|
||||
dfb_mesa_destroy_context( GLcontext *context,
|
||||
GLframebuffer *framebuffer )
|
||||
{
|
||||
_mesa_make_current( NULL, NULL );
|
||||
_mesa_make_current( NULL, NULL, NULL );
|
||||
_mesa_free_framebuffer_data( framebuffer );
|
||||
_mesa_notifyDestroy( context );
|
||||
_mesa_free_context_data( context );
|
||||
|
||||
@@ -16,7 +16,7 @@ COMMON_SOURCES = \
|
||||
ifeq ($(WINDOW_SYSTEM),dri)
|
||||
WINOBJ=../dri_client/dri.a
|
||||
WINLIB=
|
||||
INCLUDES = $(SHARED_INCLUDES) \
|
||||
INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) \
|
||||
-I../dri_client \
|
||||
-I../dri_client/imports
|
||||
|
||||
@@ -38,9 +38,6 @@ OBJECTS = $(C_SOURCES:.c=.o) \
|
||||
endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Include directories
|
||||
SHARED_INCLUDES = \
|
||||
-I. \
|
||||
@@ -78,9 +75,10 @@ default: depend symlinks $(LIBNAME) $(LIB_DIR)/$(LIBNAME)
|
||||
# $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
|
||||
# $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
|
||||
|
||||
# XXX we should use the mklib script here
|
||||
$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
|
||||
rm -f $@
|
||||
gcc $(ARCH_FLAGS) -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
|
||||
$(CC) $(ARCH_FLAGS) -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
|
||||
|
||||
|
||||
$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
|
||||
|
||||
@@ -7,25 +7,20 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "spantmp_common.h"
|
||||
|
||||
#ifndef DBG
|
||||
#define DBG 0
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_HW_DEPTH_SPANS
|
||||
#define HAVE_HW_DEPTH_SPANS 0
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_HW_DEPTH_PIXELS
|
||||
#define HAVE_HW_DEPTH_PIXELS 0
|
||||
#endif
|
||||
|
||||
#ifndef HW_READ_LOCK
|
||||
#define HW_READ_LOCK() HW_LOCK()
|
||||
#endif
|
||||
#ifndef HW_READ_UNLOCK
|
||||
#define HW_READ_UNLOCK() HW_UNLOCK()
|
||||
#endif
|
||||
|
||||
static void TAG(WriteDepthSpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
/**
|
||||
* This will get called when a window is resized.
|
||||
* Just update width, height and internal format fields for now.
|
||||
* There's usually no memory allocation above because the present
|
||||
* DRI drivers use statically-allocated full-screen buffers.
|
||||
*/
|
||||
static GLboolean
|
||||
driRenderbufferStorage(GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
|
||||
5886
src/mesa/drivers/dri/common/extension_helper.h
Normal file
5886
src/mesa/drivers/dri/common/extension_helper.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -27,26 +27,12 @@
|
||||
* Gareth Hughes <gareth@nvidia.com>
|
||||
*/
|
||||
|
||||
#include "spantmp_common.h"
|
||||
|
||||
#ifndef DBG
|
||||
#define DBG 0
|
||||
#endif
|
||||
|
||||
#ifndef HW_WRITE_LOCK
|
||||
#define HW_WRITE_LOCK() HW_LOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_WRITE_UNLOCK
|
||||
#define HW_WRITE_UNLOCK() HW_UNLOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_READ_LOCK
|
||||
#define HW_READ_LOCK() HW_LOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_READ_UNLOCK
|
||||
#define HW_READ_UNLOCK() HW_UNLOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_READ_CLIPLOOP
|
||||
#define HW_READ_CLIPLOOP() HW_CLIPLOOP()
|
||||
#endif
|
||||
|
||||
@@ -34,27 +34,12 @@
|
||||
*/
|
||||
|
||||
#include "colormac.h"
|
||||
#include "spantmp_common.h"
|
||||
|
||||
#ifndef DBG
|
||||
#define DBG 0
|
||||
#endif
|
||||
|
||||
#ifndef HW_WRITE_LOCK
|
||||
#define HW_WRITE_LOCK() HW_LOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_WRITE_UNLOCK
|
||||
#define HW_WRITE_UNLOCK() HW_UNLOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_READ_LOCK
|
||||
#define HW_READ_LOCK() HW_LOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_READ_UNLOCK
|
||||
#define HW_READ_UNLOCK() HW_UNLOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_READ_CLIPLOOP
|
||||
#define HW_READ_CLIPLOOP() HW_CLIPLOOP()
|
||||
#endif
|
||||
@@ -65,6 +50,14 @@
|
||||
|
||||
#if (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)
|
||||
|
||||
#ifndef GET_SRC_PTR
|
||||
#define GET_SRC_PTR(_x, _y) (read_buf + (_x) * 2 + (_y) * pitch)
|
||||
#endif
|
||||
|
||||
#ifndef GET_DST_PTR
|
||||
#define GET_DST_PTR(_x, _y) ( buf + (_x) * 2 + (_y) * pitch)
|
||||
#endif
|
||||
|
||||
#define INIT_MONO_PIXEL(p, color) \
|
||||
p = PACK_COLOR_565( color[0], color[1], color[2] )
|
||||
|
||||
@@ -92,9 +85,17 @@
|
||||
|
||||
#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
|
||||
|
||||
#ifndef GET_SRC_PTR
|
||||
#define GET_SRC_PTR(_x, _y) (read_buf + (_x) * 4 + (_y) * pitch)
|
||||
#endif
|
||||
|
||||
#ifndef GET_DST_PTR
|
||||
#define GET_DST_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch)
|
||||
#endif
|
||||
|
||||
# define INIT_MONO_PIXEL(p, color) \
|
||||
p = PACK_COLOR_8888(color[3], color[0], color[1], color[2])
|
||||
|
||||
|
||||
# define WRITE_RGBA(_x, _y, r, g, b, a) \
|
||||
do { \
|
||||
GLuint * _p = (GLuint *) GET_DST_PTR(_x, _y); \
|
||||
|
||||
81
src/mesa/drivers/dri/common/spantmp_common.h
Normal file
81
src/mesa/drivers/dri/common/spantmp_common.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright 2000-2001 VA Linux Systems, Inc.
|
||||
* (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
|
||||
* VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file spantmp_common.h
|
||||
*
|
||||
* common macros for span read / write functions to be used in the depth,
|
||||
* stencil and pixel span templates.
|
||||
*/
|
||||
|
||||
#ifndef HW_WRITE_LOCK
|
||||
#define HW_WRITE_LOCK() HW_LOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_WRITE_UNLOCK
|
||||
#define HW_WRITE_UNLOCK() HW_UNLOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_READ_LOCK
|
||||
#define HW_READ_LOCK() HW_LOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_READ_UNLOCK
|
||||
#define HW_READ_UNLOCK() HW_UNLOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_CLIPLOOP
|
||||
#define HW_CLIPLOOP() \
|
||||
do { \
|
||||
int _nc = dPriv->numClipRects; \
|
||||
while ( _nc-- ) { \
|
||||
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
|
||||
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
|
||||
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
|
||||
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
|
||||
#endif
|
||||
|
||||
#ifndef HW_ENDCLIPLOOP
|
||||
#define HW_ENDCLIPLOOP() \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#ifndef CLIPPIXEL
|
||||
#define CLIPPIXEL( _x, _y ) \
|
||||
((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy))
|
||||
#endif
|
||||
|
||||
#ifndef CLIPSPAN
|
||||
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
|
||||
if ( _y < miny || _y >= maxy /*|| _x + n < minx || _x >=maxx*/ ) { \
|
||||
_n1 = 0, _x1 = x; \
|
||||
} else { \
|
||||
_n1 = _n; \
|
||||
_x1 = _x; \
|
||||
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
|
||||
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
|
||||
}
|
||||
#endif
|
||||
@@ -1,23 +1,11 @@
|
||||
/* $XFree86: xc/lib/GL/mesa/src/drv/common/stenciltmp.h,v 1.3 2001/03/21 16:14:20 dawes Exp $ */
|
||||
|
||||
#include "spantmp_common.h"
|
||||
|
||||
#ifndef DBG
|
||||
#define DBG 0
|
||||
#endif
|
||||
|
||||
#ifndef HW_WRITE_LOCK
|
||||
#define HW_WRITE_LOCK() HW_LOCK()
|
||||
#endif
|
||||
#ifndef HW_WRITE_UNLOCK
|
||||
#define HW_WRITE_UNLOCK() HW_UNLOCK()
|
||||
#endif
|
||||
|
||||
#ifndef HW_READ_LOCK
|
||||
#define HW_READ_LOCK() HW_LOCK()
|
||||
#endif
|
||||
#ifndef HW_READ_UNLOCK
|
||||
#define HW_READ_UNLOCK() HW_UNLOCK()
|
||||
#endif
|
||||
|
||||
static void TAG(WriteStencilSpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
|
||||
@@ -180,9 +180,18 @@ driGetRendererString( char * buffer, const char * hardware_name,
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Enable extensions supported by the driver.
|
||||
*
|
||||
* \bug
|
||||
* ARB_imaging isn't handled properly. In Mesa, enabling ARB_imaging also
|
||||
* enables all the sub-extensions that are folded into it. This means that
|
||||
* we need to add entry-points (via \c driInitSingleExtension) for those
|
||||
* new functions here.
|
||||
*/
|
||||
void driInitExtensions( GLcontext * ctx,
|
||||
const char * const extensions_to_enable[],
|
||||
GLboolean enable_imaging )
|
||||
const struct dri_extension * extensions_to_enable,
|
||||
GLboolean enable_imaging )
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
@@ -190,14 +199,84 @@ void driInitExtensions( GLcontext * ctx,
|
||||
_mesa_enable_imaging_extensions( ctx );
|
||||
}
|
||||
|
||||
for ( i = 0 ; extensions_to_enable[i] != NULL ; i++ ) {
|
||||
_mesa_enable_extension( ctx, extensions_to_enable[i] );
|
||||
for ( i = 0 ; extensions_to_enable[i].name != NULL ; i++ ) {
|
||||
driInitSingleExtension( ctx, & extensions_to_enable[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Enable and add dispatch functions for a single extension
|
||||
*
|
||||
* \param ctx Context where extension is to be enabled.
|
||||
* \param ext Extension that is to be enabled.
|
||||
*
|
||||
* \sa driInitExtensions, _mesa_enable_extension, _glapi_add_entrypoint
|
||||
*
|
||||
* \todo
|
||||
* Determine if it would be better to use \c strlen instead of the hardcoded
|
||||
* for-loops.
|
||||
*/
|
||||
void driInitSingleExtension( GLcontext * ctx,
|
||||
const struct dri_extension * ext )
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
if ( ext->functions != NULL ) {
|
||||
for ( i = 0 ; ext->functions[i].strings != NULL ; i++ ) {
|
||||
const char * functions[16];
|
||||
const char * parameter_signature;
|
||||
const char * str = ext->functions[i].strings;
|
||||
unsigned j;
|
||||
|
||||
|
||||
/* Separate the parameter signature from the rest of the string.
|
||||
* If the parameter signature is empty (i.e., the string starts
|
||||
* with a NUL character), then the function has a void parameter
|
||||
* list.
|
||||
*/
|
||||
parameter_signature = str;
|
||||
while ( str[0] != '\0' ) {
|
||||
str++;
|
||||
}
|
||||
str++;
|
||||
|
||||
|
||||
/* Divide the string into the substrings that name each
|
||||
* entry-point for the function.
|
||||
*/
|
||||
for ( j = 0 ; j < 16 ; j++ ) {
|
||||
if ( str[0] == '\0' ) {
|
||||
functions[j] = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
functions[j] = str;
|
||||
|
||||
while ( str[0] != '\0' ) {
|
||||
str++;
|
||||
}
|
||||
str++;
|
||||
}
|
||||
|
||||
|
||||
/* Add each entry-point to the dispatch table.
|
||||
*/
|
||||
for ( j = 0 ; functions[j] != NULL ; j++ ) {
|
||||
_glapi_add_entrypoint( functions[j],
|
||||
ext->functions[i].offset );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_mesa_enable_extension( ctx, ext->name );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef DRI_NEW_INTERFACE_ONLY
|
||||
/**
|
||||
* Utility function used by drivers to test the verions of other components.
|
||||
|
||||
@@ -32,12 +32,52 @@
|
||||
#include "context.h"
|
||||
#include "dri_util.h"
|
||||
|
||||
struct dri_debug_control
|
||||
{
|
||||
struct dri_debug_control {
|
||||
const char * string;
|
||||
unsigned flag;
|
||||
};
|
||||
|
||||
/**
|
||||
* Description of the entry-points and parameters for an OpenGL function.
|
||||
*/
|
||||
struct dri_extension_function {
|
||||
/**
|
||||
* \brief
|
||||
* Packed string describing the parameter signature and the entry-point
|
||||
* names.
|
||||
*
|
||||
* The parameter signature and the names of the entry-points for this
|
||||
* function are packed into a single string. The substrings are
|
||||
* separated by NUL characters. The whole string is terminated by
|
||||
* two consecutive NUL characters.
|
||||
*/
|
||||
const char * strings;
|
||||
|
||||
|
||||
/**
|
||||
* Offset of the function in the dispatch table.
|
||||
*/
|
||||
unsigned offset;
|
||||
};
|
||||
|
||||
/**
|
||||
* Description of the API for an extension to OpenGL.
|
||||
*/
|
||||
struct dri_extension {
|
||||
/**
|
||||
* Name of the extension.
|
||||
*/
|
||||
const char * name;
|
||||
|
||||
|
||||
/**
|
||||
* Pointer to a list of \c dri_extension_function structures. The list
|
||||
* is terminated by a structure with a \c NULL
|
||||
* \c dri_extension_function::strings pointer.
|
||||
*/
|
||||
const struct dri_extension_function * functions;
|
||||
};
|
||||
|
||||
extern unsigned driParseDebugString( const char * debug,
|
||||
const struct dri_debug_control * control );
|
||||
|
||||
@@ -45,7 +85,10 @@ extern unsigned driGetRendererString( char * buffer,
|
||||
const char * hardware_name, const char * driver_date, GLuint agp_mode );
|
||||
|
||||
extern void driInitExtensions( GLcontext * ctx,
|
||||
const char * const card_extensions[], GLboolean enable_imaging );
|
||||
const struct dri_extension * card_extensions, GLboolean enable_imaging );
|
||||
|
||||
extern void driInitSingleExtension( GLcontext * ctx,
|
||||
const struct dri_extension * ext );
|
||||
|
||||
#ifndef DRI_NEW_INTERFACE_ONLY
|
||||
extern GLboolean driCheckDriDdxDrmVersions( __DRIscreenPrivate *sPriv,
|
||||
|
||||
@@ -316,6 +316,13 @@ fbDestroyScreen( __DRIscreenPrivate *sPriv )
|
||||
{
|
||||
}
|
||||
|
||||
void fbSetBuffer( GLcontext *ctx,
|
||||
GLframebuffer *colorBuffer,
|
||||
GLuint bufferBit )
|
||||
{
|
||||
/* NOP until SetBuffer is fully removed */
|
||||
}
|
||||
|
||||
/* Create the device specific context.
|
||||
*/
|
||||
static GLboolean
|
||||
@@ -368,6 +375,7 @@ fbCreateContext( const __GLcontextModes *glVisual,
|
||||
{
|
||||
struct swrast_device_driver *swdd;
|
||||
swdd = _swrast_GetDeviceDriverReference( ctx );
|
||||
swdd->SetBuffer = fbSetBuffer;
|
||||
}
|
||||
|
||||
/* use default TCL pipeline */
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
|
||||
extern void
|
||||
fbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis);
|
||||
extern void
|
||||
fbSetBuffer( GLcontext *ctx, GLframebuffer *colorBuffer, GLuint bufferBit);
|
||||
|
||||
/**
|
||||
* fb driver-specific driver class derived from _EGLDriver
|
||||
@@ -485,6 +487,7 @@ fbCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext sh
|
||||
{
|
||||
struct swrast_device_driver *swdd;
|
||||
swdd = _swrast_GetDeviceDriverReference( ctx );
|
||||
swdd->SetBuffer = fbSetBuffer;
|
||||
}
|
||||
|
||||
/* use default TCL pipeline */
|
||||
@@ -833,7 +836,9 @@ fbSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw)
|
||||
else {
|
||||
/* XXX this shouldn't be an error but we can't handle it for now */
|
||||
_mesa_problem(NULL, "fbSwapBuffers: drawable has no context!\n");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,10 +37,13 @@
|
||||
|
||||
#undef DEPTH_TRACE
|
||||
|
||||
static void
|
||||
FFBWriteDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
const GLdepth depth[], const GLubyte mask[])
|
||||
static void FFBWriteDepthSpan( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const void *values,
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
const GLuint *depth = (const GLuint *) values;
|
||||
#ifdef DEPTH_TRACE
|
||||
fprintf(stderr, "FFBWriteDepthSpan: n(%d) x(%d) y(%d)\n",
|
||||
(int) n, x, y);
|
||||
@@ -81,10 +84,28 @@ FFBWriteDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
FFBWriteDepthPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
|
||||
const GLdepth depth[], const GLubyte mask[])
|
||||
static void FFBWriteMonoDepthSpan( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const void *value, const GLubyte mask[] )
|
||||
{
|
||||
const GLuint depthVal = *((GLuint *) value);
|
||||
GLuint depths[MAX_WIDTH];
|
||||
GLuint i;
|
||||
for (i = 0; i < n; i++)
|
||||
depths[i] = depthVal;
|
||||
FFBWriteDepthSpan(ctx, rb, n, x, y, depths, mask);
|
||||
}
|
||||
|
||||
static void FFBWriteDepthPixels( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n,
|
||||
const GLint x[],
|
||||
const GLint y[],
|
||||
const void *values,
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
const GLuint *depth = (const GLuint *) values;
|
||||
#ifdef DEPTH_TRACE
|
||||
fprintf(stderr, "FFBWriteDepthPixels: n(%d)\n", (int) n);
|
||||
#endif
|
||||
@@ -126,9 +147,12 @@ FFBWriteDepthPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
FFBReadDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y, GLdepth depth[])
|
||||
static void FFBReadDepthSpan( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
void *values )
|
||||
{
|
||||
GLuint *depth = (GLuint *) values;
|
||||
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
|
||||
__DRIdrawablePrivate *dPriv = fmesa->driDrawable;
|
||||
GLuint *zptr;
|
||||
@@ -163,10 +187,13 @@ FFBReadDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y, GLdepth depth[])
|
||||
UNLOCK_HARDWARE(fmesa);
|
||||
}
|
||||
|
||||
static void
|
||||
FFBReadDepthPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
|
||||
GLdepth depth[])
|
||||
static void FFBReadDepthPixels( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
void *values )
|
||||
{
|
||||
GLuint *depth = (GLuint *) values;
|
||||
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
|
||||
__DRIdrawablePrivate *dPriv = fmesa->driDrawable;
|
||||
char *zbase;
|
||||
@@ -202,13 +229,17 @@ FFBReadDepthPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
|
||||
UNLOCK_HARDWARE(fmesa);
|
||||
}
|
||||
|
||||
void ffbDDInitDepthFuncs(GLcontext *ctx)
|
||||
/**
|
||||
* Plug in the Get/Put routines for the given driRenderbuffer.
|
||||
*/
|
||||
void
|
||||
ffbSetDepthFunctions(driRenderbuffer *drb, const GLvisual *vis)
|
||||
{
|
||||
struct swrast_device_driver *swdd =
|
||||
_swrast_GetDeviceDriverReference(ctx);
|
||||
|
||||
swdd->WriteDepthSpan = FFBWriteDepthSpan;
|
||||
swdd->ReadDepthSpan = FFBReadDepthSpan;
|
||||
swdd->WriteDepthPixels = FFBWriteDepthPixels;
|
||||
swdd->ReadDepthPixels = FFBReadDepthPixels;
|
||||
assert(drb->Base.InternalFormat == GL_DEPTH_COMPONENT16);
|
||||
drb->Base.GetRow = FFBReadDepthSpan;
|
||||
drb->Base.GetValues = FFBReadDepthPixels;
|
||||
drb->Base.PutRow = FFBWriteDepthSpan;
|
||||
drb->Base.PutMonoRow = FFBWriteMonoDepthSpan;
|
||||
drb->Base.PutValues = FFBWriteDepthPixels;
|
||||
drb->Base.PutMonoValues = NULL;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
#ifndef _FFB_DEPTH_H
|
||||
#define _FFB_DEPTH_H
|
||||
|
||||
extern void ffbDDInitDepthFuncs(GLcontext *ctx);
|
||||
void ffbSetDepthFunctions(driRenderbuffer *drb, const GLvisual *vis);
|
||||
|
||||
#endif /* !(_FFB_DEPTH_H) */
|
||||
|
||||
@@ -116,27 +116,20 @@ do { GLuint p = *(GLuint *)(buf + ((__x)<<2) + ((__y)<<13)); \
|
||||
|
||||
#include <spantmp.h>
|
||||
|
||||
void ffbDDInitSpanFuncs(GLcontext *ctx)
|
||||
/**
|
||||
* Plug in the Get/Put routines for the given driRenderbuffer.
|
||||
*/
|
||||
void
|
||||
ffbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
|
||||
{
|
||||
struct swrast_device_driver *swdd =
|
||||
_swrast_GetDeviceDriverReference(ctx);
|
||||
|
||||
swdd->WriteRGBASpan = ffbWriteRGBASpan_888;
|
||||
swdd->WriteRGBSpan = ffbWriteRGBSpan_888;
|
||||
swdd->WriteRGBAPixels = ffbWriteRGBAPixels_888;
|
||||
swdd->WriteMonoRGBASpan = ffbWriteMonoRGBASpan_888;
|
||||
swdd->WriteMonoRGBAPixels = ffbWriteMonoRGBAPixels_888;
|
||||
swdd->ReadRGBASpan = ffbReadRGBASpan_888;
|
||||
swdd->ReadRGBAPixels = ffbReadRGBAPixels_888;
|
||||
|
||||
/* We don't support color index mode yet, but it will be
|
||||
* very easy to do. -DaveM
|
||||
*/
|
||||
swdd->WriteCI8Span = NULL;
|
||||
swdd->WriteCI32Span = NULL;
|
||||
swdd->WriteMonoCISpan = NULL;
|
||||
swdd->WriteCI32Pixels = NULL;
|
||||
swdd->WriteMonoCIPixels = NULL;
|
||||
swdd->ReadCI32Span = NULL;
|
||||
swdd->ReadCI32Pixels = NULL;
|
||||
assert(vis->redBits == 8);
|
||||
assert(vis->greenBits == 8);
|
||||
assert(vis->blueBits == 8);
|
||||
drb->Base.GetRow = ffbReadRGBASpan_888;
|
||||
drb->Base.GetValues = ffbReadRGBAPixels_888;
|
||||
drb->Base.PutRow = ffbWriteRGBASpan_888;
|
||||
drb->Base.PutRowRGB = ffbWriteRGBSpan_888;
|
||||
drb->Base.PutMonoRow = ffbWriteMonoRGBASpan_888;
|
||||
drb->Base.PutValues = ffbWriteRGBAPixels_888;
|
||||
drb->Base.PutMonoValues = ffbWriteMonoRGBAPixels_888;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#ifndef _FFB_SPAN_H
|
||||
#define _FFB_SPAN_H
|
||||
|
||||
extern void ffbDDInitSpanFuncs(GLcontext *ctx);
|
||||
#include "drirenderbuffer.h"
|
||||
|
||||
void ffbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis);
|
||||
|
||||
#endif /* !(_FFB_SPAN_H) */
|
||||
|
||||
@@ -592,6 +592,8 @@ static void ffbDDColorMask(GLcontext *ctx,
|
||||
new_pmask |= 0x0000ff00;
|
||||
if (b)
|
||||
new_pmask |= 0x00ff0000;
|
||||
if (a)
|
||||
new_pmask |= 0xff000000;
|
||||
|
||||
if (fmesa->pmask != new_pmask) {
|
||||
fmesa->pmask = new_pmask;
|
||||
|
||||
@@ -36,10 +36,12 @@
|
||||
|
||||
#undef STENCIL_TRACE
|
||||
|
||||
static void
|
||||
FFBWriteStencilSpan(GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
const GLstencil stencil[], const GLubyte mask[])
|
||||
static void FFBWriteStencilSpan( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const void *values, const GLubyte mask[] )
|
||||
{
|
||||
const GLubyte *stencil = (const GLubyte *) values;
|
||||
#ifdef STENCIL_TRACE
|
||||
fprintf(stderr, "FFBWriteStencilSpan: n(%d) x(%d) y(%d)\n",
|
||||
(int) n, x, y);
|
||||
@@ -79,10 +81,13 @@ FFBWriteStencilSpan(GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
FFBWriteStencilPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
|
||||
const GLstencil stencil[], const GLubyte mask[])
|
||||
static void FFBWriteStencilPixels( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const void *values, const GLubyte mask[] )
|
||||
{
|
||||
const GLubyte *stencil = (const GLubyte *) values;
|
||||
#ifdef STENCIL_TRACE
|
||||
fprintf(stderr, "FFBWriteStencilPixels: n(%d)\n", (int) n);
|
||||
#endif
|
||||
@@ -124,9 +129,12 @@ FFBWriteStencilPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[]
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
FFBReadStencilSpan(GLcontext *ctx, GLuint n, GLint x, GLint y, GLstencil stencil[])
|
||||
static void FFBReadStencilSpan( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
void *values)
|
||||
{
|
||||
GLubyte *stencil = (GLubyte *) values;
|
||||
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
|
||||
__DRIdrawablePrivate *dPriv = fmesa->driDrawable;
|
||||
GLuint *zptr;
|
||||
@@ -161,10 +169,12 @@ FFBReadStencilSpan(GLcontext *ctx, GLuint n, GLint x, GLint y, GLstencil stencil
|
||||
UNLOCK_HARDWARE(fmesa);
|
||||
}
|
||||
|
||||
static void
|
||||
FFBReadStencilPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
|
||||
GLstencil stencil[])
|
||||
static void FFBReadStencilPixels( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
void *values )
|
||||
{
|
||||
GLubyte *stencil = (GLubyte *) values;
|
||||
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
|
||||
__DRIdrawablePrivate *dPriv = fmesa->driDrawable;
|
||||
char *zbase;
|
||||
@@ -200,22 +210,17 @@ FFBReadStencilPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
|
||||
UNLOCK_HARDWARE(fmesa);
|
||||
}
|
||||
|
||||
void ffbDDInitStencilFuncs(GLcontext *ctx)
|
||||
/**
|
||||
* Plug in the Get/Put routines for the given driRenderbuffer.
|
||||
*/
|
||||
void
|
||||
ffbSetStencilFunctions(driRenderbuffer *drb, const GLvisual *vis)
|
||||
{
|
||||
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
|
||||
|
||||
struct swrast_device_driver *swdd =
|
||||
_swrast_GetDeviceDriverReference(ctx);
|
||||
|
||||
if (fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS) {
|
||||
swdd->WriteStencilSpan = FFBWriteStencilSpan;
|
||||
swdd->ReadStencilSpan = FFBReadStencilSpan;
|
||||
swdd->WriteStencilPixels = FFBWriteStencilPixels;
|
||||
swdd->ReadStencilPixels = FFBReadStencilPixels;
|
||||
} else {
|
||||
swdd->WriteStencilSpan = NULL;
|
||||
swdd->ReadStencilSpan = NULL;
|
||||
swdd->WriteStencilPixels = NULL;
|
||||
swdd->ReadStencilPixels = NULL;
|
||||
}
|
||||
assert(drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT);
|
||||
drb->Base.GetRow = FFBReadStencilSpan;
|
||||
drb->Base.GetValues = FFBReadStencilPixels;
|
||||
drb->Base.PutRow = FFBWriteStencilSpan;
|
||||
/*drb->Base.PutMonoRow = FFBWriteMonoStencilSpan;*/
|
||||
drb->Base.PutValues = FFBWriteStencilPixels;
|
||||
drb->Base.PutMonoValues = NULL;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
#ifndef _FFB_STENCIL_H
|
||||
#define _FFB_STENCIL_H
|
||||
|
||||
extern void ffbDDInitStencilFuncs(GLcontext *ctx);
|
||||
void ffbSetStencilFunctions(driRenderbuffer *drb, const GLvisual *vis);
|
||||
|
||||
#endif /* !(_FFB_STENCIL_H) */
|
||||
|
||||
@@ -146,28 +146,28 @@ static void choose_normals(void)
|
||||
}
|
||||
|
||||
if (ctx->Light.EnabledList.next == ctx->Light.EnabledList.prev) {
|
||||
ctx->Exec->Normal3f = norm_tab[index].normal3f_single;
|
||||
ctx->Exec->Normal3fv = norm_tab[index].normal3fv_single;
|
||||
SET_Normal3f(ctx->Exec, norm_tab[index].normal3f_single);
|
||||
SET_Normal3fv(ctx->Exec, norm_tab[index].normal3fv_single);
|
||||
} else {
|
||||
ctx->Exec->Normal3f = norm_tab[index].normal3f_multi;
|
||||
ctx->Exec->Normal3fv = norm_tab[index].normal3fv_multi;
|
||||
SET_Normal3f(ctx->Exec, norm_tab[index].normal3f_multi);
|
||||
SET_Normal3fv(ctx->Exec, norm_tab[index].normal3fv_multi);
|
||||
}
|
||||
} else {
|
||||
ctx->Exec->Normal3f = _mesa_noop_Normal3f;
|
||||
ctx->Exec->Normal3fv = _mesa_noop_Normal3fv;
|
||||
SET_Normal3f(ctx->Exec, _mesa_noop_Normal3f);
|
||||
SET_Normal3fv(ctx->Exec, _mesa_noop_Normal3fv);
|
||||
}
|
||||
}
|
||||
|
||||
static void ffb_choose_Normal3f(GLfloat x, GLfloat y, GLfloat z)
|
||||
{
|
||||
choose_normals();
|
||||
GL_CALL(Normal3f)(x, y, z);
|
||||
CALL_Normal3f(GET_DISPATCH(), (x, y, z));
|
||||
}
|
||||
|
||||
static void ffb_choose_Normal3fv(const GLfloat *v)
|
||||
{
|
||||
choose_normals();
|
||||
GL_CALL(Normal3fv)(v);
|
||||
CALL_Normal3fv(GET_DISPATCH(), (v));
|
||||
}
|
||||
|
||||
/* Vertex functions: */
|
||||
@@ -267,13 +267,14 @@ static void ffb_do_fallback(GLcontext *ctx)
|
||||
* correctly:
|
||||
*/
|
||||
if (fmesa->imm.prim != PRIM_OUTSIDE_BEGIN_END )
|
||||
GL_CALL(Begin)(fmesa->imm.prim);
|
||||
CALL_Begin(GET_DISPATCH(), (fmesa->imm.prim));
|
||||
|
||||
if (ctx->Light.Enabled) {
|
||||
GL_CALL(Color4fv)(ctx->Current.Color); /* Catch ColorMaterial */
|
||||
GL_CALL(Normal3fv)(current->normal);
|
||||
/* Catch ColorMaterial */
|
||||
CALL_Color4fv(GET_DISPATCH(), (ctx->Current.Color));
|
||||
CALL_Normal3fv(GET_DISPATCH(), (current->normal));
|
||||
} else {
|
||||
GL_CALL(Color4fv)(current->color);
|
||||
CALL_Color4fv(GET_DISPATCH(), (current->color));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,12 @@
|
||||
|
||||
#include "ffb_xmesa.h"
|
||||
#include "context.h"
|
||||
#include "framebuffer.h"
|
||||
#include "matrix.h"
|
||||
#include "renderbuffer.h"
|
||||
#include "simple_list.h"
|
||||
#include "imports.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "swrast/swrast.h"
|
||||
#include "swrast_setup/swrast_setup.h"
|
||||
@@ -276,9 +279,6 @@ ffbCreateContext(const __GLcontextModes *mesaVis,
|
||||
ffbDDExtensionsInit(ctx);
|
||||
ffbDDInitDriverFuncs(ctx);
|
||||
ffbDDInitStateFuncs(ctx);
|
||||
ffbDDInitSpanFuncs(ctx);
|
||||
ffbDDInitDepthFuncs(ctx);
|
||||
ffbDDInitStencilFuncs(ctx);
|
||||
ffbDDInitRenderFuncs(ctx);
|
||||
/*ffbDDInitTexFuncs(ctx); not needed */
|
||||
ffbDDInitBitmapFuncs(ctx);
|
||||
@@ -322,16 +322,63 @@ ffbCreateBuffer(__DRIscreenPrivate *driScrnPriv,
|
||||
const __GLcontextModes *mesaVis,
|
||||
GLboolean isPixmap )
|
||||
{
|
||||
/* Mesa checks for pitch > 0, but ffb doesn't use pitches */
|
||||
int bogusPitch = 1;
|
||||
int bpp = 4; /* we've always got a 32bpp framebuffer */
|
||||
int offset = 0; /* always at 0 for offset */
|
||||
|
||||
if (isPixmap) {
|
||||
return GL_FALSE; /* not implemented */
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
GLboolean swStencil = (mesaVis->stencilBits > 0 &&
|
||||
mesaVis->depthBits != 24);
|
||||
#if 0
|
||||
driDrawPriv->driverPrivate = (void *)
|
||||
_mesa_create_framebuffer(mesaVis,
|
||||
GL_FALSE, /* software depth buffer? */
|
||||
_mesa_create_framebuffer(mesaVis,
|
||||
GL_FALSE, /* software depth buffer? */
|
||||
mesaVis->stencilBits > 0,
|
||||
mesaVis->accumRedBits > 0,
|
||||
mesaVis->alphaBits > 0);
|
||||
#else
|
||||
struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
|
||||
|
||||
{
|
||||
driRenderbuffer *frontRb
|
||||
= driNewRenderbuffer(GL_RGBA, bpp, offset, bogusPitch);
|
||||
ffbSetSpanFunctions(frontRb, mesaVis);
|
||||
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
|
||||
}
|
||||
|
||||
if (mesaVis->doubleBufferMode) {
|
||||
driRenderbuffer *backRb
|
||||
= driNewRenderbuffer(GL_RGBA, bpp, offset, bogusPitch);
|
||||
ffbSetSpanFunctions(backRb, mesaVis);
|
||||
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
|
||||
}
|
||||
|
||||
if (mesaVis->depthBits == 16) {
|
||||
driRenderbuffer *depthRb
|
||||
= driNewRenderbuffer(GL_DEPTH_COMPONENT16, bpp, offset, bogusPitch);
|
||||
ffbSetDepthFunctions(depthRb, mesaVis);
|
||||
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
|
||||
}
|
||||
|
||||
if (mesaVis->stencilBits > 0 && !swStencil) {
|
||||
driRenderbuffer *stencilRb
|
||||
= driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, bpp, offset,bogusPitch);
|
||||
ffbSetStencilFunctions(stencilRb, mesaVis);
|
||||
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
|
||||
}
|
||||
|
||||
_mesa_add_soft_renderbuffers(fb,
|
||||
GL_FALSE, /* color */
|
||||
GL_FALSE, /* depth */
|
||||
swStencil,
|
||||
mesaVis->accumRedBits > 0,
|
||||
GL_FALSE, /* alpha */
|
||||
GL_FALSE /* aux */);
|
||||
driDrawPriv->driverPrivate = (void *) fb;
|
||||
#endif
|
||||
return (driDrawPriv->driverPrivate != NULL);
|
||||
}
|
||||
}
|
||||
@@ -488,7 +535,7 @@ ffbMakeCurrent(__DRIcontextPrivate *driContextPriv,
|
||||
|
||||
fmesa->driDrawable = driDrawPriv;
|
||||
|
||||
_mesa_make_current2(fmesa->glCtx,
|
||||
_mesa_make_current(fmesa->glCtx,
|
||||
(GLframebuffer *) driDrawPriv->driverPrivate,
|
||||
(GLframebuffer *) driReadPriv->driverPrivate);
|
||||
|
||||
@@ -520,7 +567,7 @@ ffbMakeCurrent(__DRIcontextPrivate *driContextPriv,
|
||||
1, 0, 0, 0, 0);
|
||||
}
|
||||
} else {
|
||||
_mesa_make_current(NULL, NULL);
|
||||
_mesa_make_current(NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
@@ -551,30 +598,172 @@ void ffbXMesaUpdateState(ffbContextPtr fmesa)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static struct __DriverAPIRec ffbAPI = {
|
||||
ffbInitDriver,
|
||||
ffbDestroyScreen,
|
||||
ffbCreateContext,
|
||||
ffbDestroyContext,
|
||||
ffbCreateBuffer,
|
||||
ffbDestroyBuffer,
|
||||
ffbSwapBuffers,
|
||||
ffbMakeCurrent,
|
||||
ffbUnbindContext
|
||||
static const struct __DriverAPIRec ffbAPI = {
|
||||
.InitDriver = ffbInitDriver,
|
||||
.DestroyScreen = ffbDestroyScreen,
|
||||
.CreateContext = ffbCreateContext,
|
||||
.DestroyContext = ffbDestroyContext,
|
||||
.CreateBuffer = ffbCreateBuffer,
|
||||
.DestroyBuffer = ffbDestroyBuffer,
|
||||
.SwapBuffers = ffbSwapBuffers,
|
||||
.MakeCurrent = ffbMakeCurrent,
|
||||
.UnbindContext = ffbUnbindContext,
|
||||
.GetSwapInfo = NULL,
|
||||
.GetMSC = NULL,
|
||||
.WaitForMSC = NULL,
|
||||
.WaitForSBC = NULL,
|
||||
.SwapBuffersMSC = NULL
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* This is the bootstrap function for the driver.
|
||||
* The __driCreateScreen name is the symbol that libGL.so fetches.
|
||||
* Return: pointer to a __DRIscreenPrivate.
|
||||
*/
|
||||
#if !defined(DRI_NEW_INTERFACE_ONLY)
|
||||
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
|
||||
int numConfigs, __GLXvisualConfig *config)
|
||||
int numConfigs, __GLXvisualConfig *config)
|
||||
{
|
||||
__DRIscreenPrivate *psp;
|
||||
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &ffbAPI);
|
||||
return (void *) psp;
|
||||
}
|
||||
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
|
||||
|
||||
|
||||
#ifdef USE_NEW_INTERFACE
|
||||
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
|
||||
|
||||
static __GLcontextModes *
|
||||
ffbFillInModes( unsigned pixel_bits, unsigned depth_bits,
|
||||
unsigned stencil_bits, GLboolean have_back_buffer )
|
||||
{
|
||||
__GLcontextModes * modes;
|
||||
__GLcontextModes * m;
|
||||
unsigned num_modes;
|
||||
unsigned depth_buffer_factor;
|
||||
unsigned back_buffer_factor;
|
||||
GLenum fb_format;
|
||||
GLenum fb_type;
|
||||
|
||||
/* GLX_SWAP_COPY_OML is only supported because the FFB driver doesn't
|
||||
* support pageflipping at all.
|
||||
*/
|
||||
static const GLenum back_buffer_modes[] = {
|
||||
GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
|
||||
};
|
||||
|
||||
u_int8_t depth_bits_array[3];
|
||||
u_int8_t stencil_bits_array[3];
|
||||
|
||||
|
||||
depth_bits_array[0] = 0;
|
||||
depth_bits_array[1] = depth_bits;
|
||||
depth_bits_array[2] = depth_bits;
|
||||
|
||||
/* Just like with the accumulation buffer, always provide some modes
|
||||
* with a stencil buffer. It will be a sw fallback, but some apps won't
|
||||
* care about that.
|
||||
*/
|
||||
stencil_bits_array[0] = 0;
|
||||
stencil_bits_array[1] = 0;
|
||||
stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits;
|
||||
|
||||
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1;
|
||||
back_buffer_factor = (have_back_buffer) ? 3 : 1;
|
||||
|
||||
num_modes = depth_buffer_factor * back_buffer_factor * 4;
|
||||
|
||||
if ( pixel_bits == 16 ) {
|
||||
fb_format = GL_RGB;
|
||||
fb_type = GL_UNSIGNED_SHORT_5_6_5;
|
||||
}
|
||||
else {
|
||||
fb_format = GL_BGRA;
|
||||
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||
}
|
||||
|
||||
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
|
||||
m = modes;
|
||||
if ( ! driFillInModes( & m, fb_format, fb_type,
|
||||
depth_bits_array, stencil_bits_array, depth_buffer_factor,
|
||||
back_buffer_modes, back_buffer_factor,
|
||||
GLX_TRUE_COLOR ) ) {
|
||||
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
|
||||
__func__, __LINE__ );
|
||||
return NULL;
|
||||
}
|
||||
if ( ! driFillInModes( & m, fb_format, fb_type,
|
||||
depth_bits_array, stencil_bits_array, depth_buffer_factor,
|
||||
back_buffer_modes, back_buffer_factor,
|
||||
GLX_DIRECT_COLOR ) ) {
|
||||
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
|
||||
__func__, __LINE__ );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Mark the visual as slow if there are "fake" stencil bits.
|
||||
*/
|
||||
for ( m = modes ; m != NULL ; m = m->next ) {
|
||||
if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) {
|
||||
m->visualRating = GLX_SLOW_CONFIG;
|
||||
}
|
||||
}
|
||||
|
||||
return modes;
|
||||
}
|
||||
#endif /* USE_NEW_INTERFACE */
|
||||
|
||||
|
||||
/**
|
||||
* This is the bootstrap function for the driver. libGL supplies all of the
|
||||
* requisite information about the system, and the driver initializes itself.
|
||||
* This routine also fills in the linked list pointed to by \c driver_modes
|
||||
* with the \c __GLcontextModes that the driver can support for windows or
|
||||
* pbuffers.
|
||||
*
|
||||
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
|
||||
* failure.
|
||||
*/
|
||||
#ifdef USE_NEW_INTERFACE
|
||||
PUBLIC
|
||||
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
|
||||
const __GLcontextModes * modes,
|
||||
const __DRIversion * ddx_version,
|
||||
const __DRIversion * dri_version,
|
||||
const __DRIversion * drm_version,
|
||||
const __DRIframebuffer * frame_buffer,
|
||||
drmAddress pSAREA, int fd,
|
||||
int internal_api_version,
|
||||
__GLcontextModes ** driver_modes )
|
||||
|
||||
{
|
||||
__DRIscreenPrivate *psp;
|
||||
static const __DRIversion ddx_expected = { 0, 0, 1 };
|
||||
static const __DRIversion dri_expected = { 4, 0, 0 };
|
||||
static const __DRIversion drm_expected = { 0, 0, 1 };
|
||||
|
||||
if ( ! driCheckDriDdxDrmVersions2( "ffb",
|
||||
dri_version, & dri_expected,
|
||||
ddx_version, & ddx_expected,
|
||||
drm_version, & drm_expected ) ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
|
||||
ddx_version, dri_version, drm_version,
|
||||
frame_buffer, pSAREA, fd,
|
||||
internal_api_version, &ffbAPI);
|
||||
if ( psp != NULL ) {
|
||||
create_context_modes = (PFNGLXCREATECONTEXTMODES)
|
||||
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
|
||||
if ( create_context_modes != NULL ) {
|
||||
*driver_modes = ffbFillInModes( 32, 16, 0, GL_TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
return (void *) psp;
|
||||
}
|
||||
#endif /* USE_NEW_INTERFACE */
|
||||
|
||||
@@ -40,21 +40,6 @@
|
||||
|
||||
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
|
||||
|
||||
|
||||
#define CLIPPIXEL( _x, _y ) \
|
||||
((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy))
|
||||
|
||||
|
||||
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
|
||||
if ( _y < miny || _y >= maxy ) { \
|
||||
_n1 = 0, _x1 = x; \
|
||||
} else { \
|
||||
_n1 = _n; \
|
||||
_x1 = _x; \
|
||||
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
|
||||
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
|
||||
}
|
||||
|
||||
#define Y_FLIP( _y ) (height - _y - 1)
|
||||
|
||||
#define HW_LOCK() \
|
||||
@@ -63,21 +48,6 @@
|
||||
gammaGetLock( gmesa, DRM_LOCK_FLUSH | DRM_LOCK_QUIESCENT ); \
|
||||
GAMMAHW_LOCK( gmesa );
|
||||
|
||||
#define HW_CLIPLOOP() \
|
||||
do { \
|
||||
__DRIdrawablePrivate *dPriv = gmesa->driDrawable; \
|
||||
int _nc = dPriv->numClipRects; \
|
||||
\
|
||||
while ( _nc-- ) { \
|
||||
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
|
||||
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
|
||||
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
|
||||
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
|
||||
|
||||
#define HW_ENDCLIPLOOP() \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define HW_UNLOCK() GAMMAHW_UNLOCK( gmesa )
|
||||
|
||||
|
||||
@@ -156,7 +126,6 @@ do { \
|
||||
#include "depthtmp.h"
|
||||
|
||||
|
||||
|
||||
#if 0 /* Unused */
|
||||
/* 32 bit depthbuffer functions.
|
||||
*/
|
||||
|
||||
@@ -61,6 +61,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include "i810ioctl.h"
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#define need_GL_ARB_multisample
|
||||
#include "extension_helper.h"
|
||||
|
||||
#ifndef I810_DEBUG
|
||||
int I810_DEBUG = (0);
|
||||
#endif
|
||||
@@ -97,17 +101,18 @@ static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
|
||||
|
||||
/* Extension strings exported by the i810 driver.
|
||||
*/
|
||||
static const char * const card_extensions[] =
|
||||
static const struct dri_extension card_extensions[] =
|
||||
{
|
||||
"GL_ARB_multitexture",
|
||||
"GL_ARB_texture_env_add",
|
||||
"GL_ARB_texture_mirrored_repeat",
|
||||
"GL_EXT_stencil_wrap",
|
||||
"GL_EXT_texture_edge_clamp",
|
||||
"GL_EXT_texture_lod_bias",
|
||||
"GL_MESA_ycbcr_texture",
|
||||
"GL_SGIS_generate_mipmap",
|
||||
NULL
|
||||
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
|
||||
{ "GL_ARB_multitexture", NULL },
|
||||
{ "GL_ARB_texture_env_add", NULL },
|
||||
{ "GL_ARB_texture_mirrored_repeat", NULL },
|
||||
{ "GL_EXT_stencil_wrap", NULL },
|
||||
{ "GL_EXT_texture_edge_clamp", NULL },
|
||||
{ "GL_EXT_texture_lod_bias", NULL },
|
||||
{ "GL_MESA_ycbcr_texture", NULL },
|
||||
{ "GL_SGIS_generate_mipmap", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
extern const struct tnl_pipeline_stage _i810_render_stage;
|
||||
|
||||
@@ -41,39 +41,10 @@
|
||||
#define INIT_MONO_PIXEL(p, color) \
|
||||
p = PACK_COLOR_565( color[0], color[1], color[2] )
|
||||
|
||||
#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
|
||||
_y >= miny && _y < maxy)
|
||||
|
||||
|
||||
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
|
||||
if ( _y < miny || _y >= maxy ) { \
|
||||
_n1 = 0, _x1 = x; \
|
||||
} else { \
|
||||
_n1 = _n; \
|
||||
_x1 = _x; \
|
||||
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
|
||||
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
|
||||
}
|
||||
|
||||
#define Y_FLIP(_y) (height - _y - 1)
|
||||
|
||||
#define HW_LOCK()
|
||||
|
||||
#define HW_CLIPLOOP() \
|
||||
do { \
|
||||
__DRIdrawablePrivate *dPriv = imesa->driDrawable; \
|
||||
int _nc = dPriv->numClipRects; \
|
||||
while (_nc--) { \
|
||||
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
|
||||
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
|
||||
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
|
||||
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
|
||||
|
||||
|
||||
#define HW_ENDCLIPLOOP() \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define HW_UNLOCK()
|
||||
|
||||
/* 16 bit, 565 rgb color spanline and pixel functions
|
||||
@@ -97,8 +68,6 @@ do { \
|
||||
#define TAG(x) i810##x##_565
|
||||
#include "spantmp.h"
|
||||
|
||||
|
||||
|
||||
/* 16 bit depthbuffer functions.
|
||||
*/
|
||||
#define WRITE_DEPTH( _x, _y, d ) \
|
||||
|
||||
@@ -65,6 +65,17 @@
|
||||
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#define need_GL_ARB_multisample
|
||||
#define need_GL_ARB_texture_compression
|
||||
#define need_GL_EXT_blend_color
|
||||
#define need_GL_EXT_blend_equation_separate
|
||||
#define need_GL_EXT_blend_func_separate
|
||||
#define need_GL_EXT_blend_minmax
|
||||
#define need_GL_EXT_fog_coord
|
||||
#define need_GL_EXT_secondary_color
|
||||
#include "extension_helper.h"
|
||||
|
||||
#include "xmlpool.h" /* for symbolic values of enum-type options */
|
||||
#ifndef I830_DEBUG
|
||||
int I830_DEBUG = (0);
|
||||
@@ -138,35 +149,35 @@ static void i830BufferSize(GLframebuffer *buffer,
|
||||
|
||||
/* Extension strings exported by the i830 driver.
|
||||
*/
|
||||
static const char * const card_extensions[] =
|
||||
static const struct dri_extension card_extensions[] =
|
||||
{
|
||||
"GL_ARB_multisample",
|
||||
"GL_ARB_multitexture",
|
||||
"GL_ARB_texture_border_clamp",
|
||||
"GL_ARB_texture_compression",
|
||||
"GL_ARB_texture_env_add",
|
||||
"GL_ARB_texture_env_combine",
|
||||
"GL_ARB_texture_env_crossbar",
|
||||
"GL_ARB_texture_env_dot3",
|
||||
"GL_ARB_texture_mirrored_repeat",
|
||||
"GL_EXT_blend_color",
|
||||
"GL_EXT_blend_equation_separate",
|
||||
"GL_EXT_blend_func_separate",
|
||||
"GL_EXT_blend_minmax",
|
||||
"GL_EXT_blend_subtract",
|
||||
"GL_EXT_fog_coord",
|
||||
"GL_EXT_secondary_color",
|
||||
"GL_EXT_stencil_wrap",
|
||||
"GL_EXT_texture_edge_clamp",
|
||||
"GL_EXT_texture_env_combine",
|
||||
"GL_EXT_texture_env_dot3",
|
||||
"GL_EXT_texture_filter_anisotropic",
|
||||
"GL_EXT_texture_lod_bias",
|
||||
"GL_EXT_texture_rectangle",
|
||||
"GL_NV_blend_square",
|
||||
"GL_MESA_ycbcr_texture",
|
||||
"GL_SGIS_generate_mipmap",
|
||||
NULL
|
||||
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
|
||||
{ "GL_ARB_multitexture", NULL },
|
||||
{ "GL_ARB_texture_border_clamp", NULL },
|
||||
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
|
||||
{ "GL_ARB_texture_env_add", NULL },
|
||||
{ "GL_ARB_texture_env_combine", NULL },
|
||||
{ "GL_ARB_texture_env_crossbar", NULL },
|
||||
{ "GL_ARB_texture_env_dot3", NULL },
|
||||
{ "GL_ARB_texture_mirrored_repeat", NULL },
|
||||
{ "GL_EXT_blend_color", GL_EXT_blend_color_functions },
|
||||
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
|
||||
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
|
||||
{ "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
|
||||
{ "GL_EXT_blend_subtract", NULL },
|
||||
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
|
||||
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
|
||||
{ "GL_EXT_stencil_wrap", NULL },
|
||||
{ "GL_EXT_texture_edge_clamp", NULL },
|
||||
{ "GL_EXT_texture_env_combine", NULL },
|
||||
{ "GL_EXT_texture_env_dot3", NULL },
|
||||
{ "GL_EXT_texture_filter_anisotropic", NULL },
|
||||
{ "GL_EXT_texture_lod_bias", NULL },
|
||||
{ "GL_EXT_texture_rectangle", NULL },
|
||||
{ "GL_MESA_ycbcr_texture", NULL },
|
||||
{ "GL_NV_blend_square", NULL },
|
||||
{ "GL_SGIS_generate_mipmap", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -81,39 +81,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define INIT_MONO_PIXEL(p,color)\
|
||||
p = PACK_COLOR_565(color[0],color[1],color[2])
|
||||
|
||||
#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
|
||||
_y >= miny && _y < maxy)
|
||||
|
||||
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
|
||||
if ( _y < miny || _y >= maxy ) { \
|
||||
_n1 = 0, _x1 = x; \
|
||||
} else { \
|
||||
_n1 = _n; \
|
||||
_x1 = _x; \
|
||||
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
|
||||
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
|
||||
}
|
||||
|
||||
#define Y_FLIP(_y) (height - _y - 1)
|
||||
|
||||
|
||||
#define HW_LOCK()
|
||||
|
||||
#define HW_CLIPLOOP() \
|
||||
do { \
|
||||
__DRIdrawablePrivate *dPriv = imesa->driDrawable; \
|
||||
int _nc = dPriv->numClipRects; \
|
||||
while (_nc--) { \
|
||||
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
|
||||
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
|
||||
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
|
||||
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
|
||||
|
||||
|
||||
#define HW_ENDCLIPLOOP() \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define HW_UNLOCK()
|
||||
|
||||
/* 16 bit, 565 rgb color spanline and pixel functions
|
||||
@@ -137,9 +108,6 @@ do { \
|
||||
#define TAG(x) i830##x##_565
|
||||
#include "spantmp.h"
|
||||
|
||||
|
||||
|
||||
|
||||
/* 15 bit, 555 rgb color spanline and pixel functions
|
||||
*/
|
||||
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
|
||||
|
||||
@@ -38,10 +38,10 @@
|
||||
* Mesa's Driver Functions
|
||||
***************************************/
|
||||
|
||||
static const char * const card_extensions[] =
|
||||
static const struct dri_extension card_extensions[] =
|
||||
{
|
||||
"GL_ARB_texture_env_crossbar",
|
||||
NULL
|
||||
{ "GL_ARB_texture_env_crossbar", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -45,14 +45,15 @@
|
||||
* Mesa's Driver Functions
|
||||
***************************************/
|
||||
|
||||
static const char * const card_extensions[] =
|
||||
static const struct dri_extension card_extensions[] =
|
||||
{
|
||||
"GL_ARB_depth_texture", /* New: alanh 06-Jan-2005 */
|
||||
"GL_ARB_fragment_program",
|
||||
"GL_ARB_shadow", /* New: alanh 06-Jan-2005 */
|
||||
"GL_EXT_shadow_funcs", /* New: alanh 06-Jan-2005 */
|
||||
"GL_SGIX_depth_texture", /* ARB extn won't work if not enabled */
|
||||
NULL
|
||||
{ "GL_ARB_depth_texture", NULL },
|
||||
{ "GL_ARB_fragment_program", NULL },
|
||||
{ "GL_ARB_shadow", NULL },
|
||||
{ "GL_EXT_shadow_funcs", NULL },
|
||||
/* ARB extn won't work if not enabled */
|
||||
{ "GL_SGIX_depth_texture", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
/* Override intel default.
|
||||
|
||||
@@ -191,6 +191,203 @@ static void i915LayoutTextureImages( i915ContextPtr i915,
|
||||
}
|
||||
|
||||
|
||||
static void i945LayoutTextureImages( i915ContextPtr i915,
|
||||
struct gl_texture_object *tObj )
|
||||
{
|
||||
const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
|
||||
i915TextureObjectPtr t = (i915TextureObjectPtr) tObj->DriverData;
|
||||
GLint firstLevel, lastLevel, numLevels;
|
||||
GLint i, total_height, pitch, sz, max_offset = 0, offset;
|
||||
|
||||
|
||||
/* Compute which mipmap levels we really want to send to the hardware.
|
||||
*/
|
||||
driCalculateTextureFirstLastLevel( (driTextureObject *) t );
|
||||
|
||||
/* Figure out the amount of memory required to hold all the mipmap
|
||||
* levels. Choose the smallest pitch to accomodate the largest
|
||||
* mipmap:
|
||||
*/
|
||||
firstLevel = t->intel.base.firstLevel;
|
||||
lastLevel = t->intel.base.lastLevel;
|
||||
numLevels = lastLevel - firstLevel + 1;
|
||||
|
||||
|
||||
|
||||
/* All images must be loaded at this pitch. Count the number of
|
||||
* lines required:
|
||||
*/
|
||||
switch (tObj->Target) {
|
||||
case GL_TEXTURE_CUBE_MAP: {
|
||||
const GLuint dim = tObj->Image[0][firstLevel]->Width;
|
||||
GLuint face;
|
||||
|
||||
/* Depending on the size of the largest images, pitch can be
|
||||
* determined either by the old-style packing of cubemap faces,
|
||||
* or the final row of 4x4, 2x2 and 1x1 faces below this.
|
||||
*/
|
||||
if (dim > 32) {
|
||||
pitch = dim * t->intel.texelBytes;
|
||||
pitch *= 2; /* double pitch for cube layouts */
|
||||
pitch = (pitch + 3) & ~3;
|
||||
}
|
||||
else {
|
||||
pitch = 14 * 8 * t->intel.texelBytes; /* determined by row of
|
||||
* little maps at
|
||||
* bottom */
|
||||
}
|
||||
|
||||
total_height = dim * 4 + 4;
|
||||
|
||||
for ( face = 0 ; face < 6 ; face++) {
|
||||
GLuint x = initial_offsets[face][0] * dim;
|
||||
GLuint y = initial_offsets[face][1] * dim;
|
||||
GLuint d = dim;
|
||||
|
||||
if (dim == 4 && face >= 4) {
|
||||
y = total_height - 4;
|
||||
x = (face - 4) * 8;
|
||||
}
|
||||
else if (dim < 4) {
|
||||
y = total_height - 4;
|
||||
x = face * 8;
|
||||
}
|
||||
|
||||
t->intel.base.dirty_images[face] = ~0;
|
||||
|
||||
assert(tObj->Image[face][firstLevel]->Width == dim);
|
||||
assert(tObj->Image[face][firstLevel]->Height == dim);
|
||||
|
||||
for (i = 0; i < numLevels; i++) {
|
||||
|
||||
|
||||
t->intel.image[face][i].image = tObj->Image[face][firstLevel + i];
|
||||
assert(t->intel.image[face][i].image);
|
||||
|
||||
t->intel.image[face][i].offset =
|
||||
y * pitch + x * t->intel.texelBytes;
|
||||
t->intel.image[face][i].internalFormat = baseImage->Format;
|
||||
|
||||
d >>= 1;
|
||||
|
||||
switch (d) {
|
||||
case 4:
|
||||
switch (face) {
|
||||
case FACE_POS_X:
|
||||
case FACE_NEG_X:
|
||||
x += step_offsets[face][0] * d;
|
||||
y += step_offsets[face][1] * d;
|
||||
break;
|
||||
case FACE_POS_Y:
|
||||
case FACE_NEG_Y:
|
||||
y += 12;
|
||||
x -= 8;
|
||||
break;
|
||||
case FACE_POS_Z:
|
||||
case FACE_NEG_Z:
|
||||
y = total_height - 4;
|
||||
x = (face - 4) * 8;
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
y = total_height - 4;
|
||||
x = 16 + face * 8;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
x += 48;
|
||||
break;
|
||||
|
||||
default:
|
||||
x += step_offsets[face][0] * d;
|
||||
y += step_offsets[face][1] * d;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
max_offset = total_height * pitch;
|
||||
break;
|
||||
}
|
||||
case GL_TEXTURE_3D: {
|
||||
GLuint depth_packing = 0, depth_pack_pitch;
|
||||
GLuint tmp_numLevels = numLevels;
|
||||
pitch = tObj->Image[0][firstLevel]->Width * t->intel.texelBytes;
|
||||
pitch = (pitch + 3) & ~3;
|
||||
depth_pack_pitch = pitch;
|
||||
|
||||
t->intel.base.dirty_images[0] = ~0;
|
||||
|
||||
|
||||
for ( total_height = i = 0 ; i < tmp_numLevels ; i++ ) {
|
||||
t->intel.image[0][i].image = tObj->Image[0][firstLevel + i];
|
||||
if (!t->intel.image[0][i].image)
|
||||
break;
|
||||
|
||||
|
||||
t->intel.image[0][i].offset = total_height * pitch;
|
||||
t->intel.image[0][i].internalFormat = baseImage->Format;
|
||||
|
||||
|
||||
|
||||
total_height += MAX2(2, t->intel.image[0][i].image->Height) *
|
||||
MAX2((t->intel.image[0][i].image->Depth >> depth_packing), 1);
|
||||
|
||||
/* When alignment dominates, can't increase depth packing?
|
||||
* Or does pitch grow??? What are the alignment constraints,
|
||||
* anyway?
|
||||
*/
|
||||
if (depth_pack_pitch > 4) {
|
||||
depth_packing++;
|
||||
depth_pack_pitch <<= 2;
|
||||
}
|
||||
}
|
||||
|
||||
max_offset = total_height * pitch;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
pitch = tObj->Image[0][firstLevel]->Width * t->intel.texelBytes;
|
||||
pitch = (pitch + 3) & ~3;
|
||||
t->intel.base.dirty_images[0] = ~0;
|
||||
max_offset = 0;
|
||||
|
||||
for ( offset = i = 0 ; i < numLevels ; i++ ) {
|
||||
t->intel.image[0][i].image = tObj->Image[0][firstLevel + i];
|
||||
if (!t->intel.image[0][i].image)
|
||||
break;
|
||||
|
||||
t->intel.image[0][i].offset = offset;
|
||||
t->intel.image[0][i].internalFormat = baseImage->Format;
|
||||
|
||||
if (t->intel.image[0][i].image->IsCompressed)
|
||||
sz = MAX2(1, t->intel.image[0][i].image->Height/4) * pitch;
|
||||
else
|
||||
sz = MAX2(2, t->intel.image[0][i].image->Height) * pitch;
|
||||
|
||||
/* Because the images are packed better, the final offset
|
||||
* might not be the maximal one:
|
||||
*/
|
||||
max_offset = MAX2(max_offset, offset + sz);
|
||||
|
||||
/* LPT change: step right after second mipmap.
|
||||
*/
|
||||
if (i == 1)
|
||||
offset += pitch / 2;
|
||||
else
|
||||
offset += sz;
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
t->intel.Pitch = pitch;
|
||||
t->intel.base.totalSize = max_offset;
|
||||
t->intel.max_level = numLevels-1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void i915SetTexImages( i915ContextPtr i915,
|
||||
struct gl_texture_object *tObj )
|
||||
@@ -298,7 +495,11 @@ static void i915SetTexImages( i915ContextPtr i915,
|
||||
abort();
|
||||
}
|
||||
|
||||
i915LayoutTextureImages( i915, tObj );
|
||||
|
||||
if (i915->intel.intelScreen->deviceID == PCI_CHIP_I945_G)
|
||||
i945LayoutTextureImages( i915, tObj );
|
||||
else
|
||||
i915LayoutTextureImages( i915, tObj );
|
||||
|
||||
t->Setup[I915_TEXREG_MS3] =
|
||||
(((tObj->Image[0][t->intel.base.firstLevel]->Height - 1) << MS3_HEIGHT_SHIFT) |
|
||||
|
||||
@@ -60,6 +60,23 @@
|
||||
int INTEL_DEBUG = (0);
|
||||
#endif
|
||||
|
||||
#define need_GL_ARB_multisample
|
||||
#define need_GL_ARB_point_parameters
|
||||
#define need_GL_ARB_texture_compression
|
||||
#define need_GL_ARB_vertex_buffer_object
|
||||
#define need_GL_ARB_vertex_program
|
||||
#define need_GL_ARB_window_pos
|
||||
#define need_GL_EXT_blend_color
|
||||
#define need_GL_EXT_blend_equation_separate
|
||||
#define need_GL_EXT_blend_func_separate
|
||||
#define need_GL_EXT_blend_minmax
|
||||
#define need_GL_EXT_cull_vertex
|
||||
#define need_GL_EXT_fog_coord
|
||||
#define need_GL_EXT_multi_draw_arrays
|
||||
#define need_GL_EXT_secondary_color
|
||||
#define need_GL_NV_vertex_program
|
||||
#include "extension_helper.h"
|
||||
|
||||
#ifndef VERBOSE
|
||||
int VERBOSE = 0;
|
||||
#endif
|
||||
@@ -73,7 +90,7 @@ int prevLockLine;
|
||||
* Mesa's Driver Functions
|
||||
***************************************/
|
||||
|
||||
#define DRIVER_DATE "20041217"
|
||||
#define DRIVER_DATE "20050225"
|
||||
|
||||
const GLubyte *intelGetString( GLcontext *ctx, GLenum name )
|
||||
{
|
||||
@@ -99,6 +116,8 @@ const GLubyte *intelGetString( GLcontext *ctx, GLenum name )
|
||||
chipset = "Intel(R) 915G"; break;
|
||||
case PCI_CHIP_I915_GM:
|
||||
chipset = "Intel(R) 915GM"; break;
|
||||
case PCI_CHIP_I945_G:
|
||||
chipset = "Intel(R) 945G"; break;
|
||||
default:
|
||||
chipset = "Unknown Intel Chipset"; break;
|
||||
}
|
||||
@@ -134,48 +153,46 @@ static void intelBufferSize(GLframebuffer *buffer,
|
||||
* It appears that ARB_texture_env_crossbar has "disappeared" compared to the
|
||||
* old i830-specific driver.
|
||||
*/
|
||||
static const char * const card_extensions[] =
|
||||
static const struct dri_extension card_extensions[] =
|
||||
{
|
||||
"GL_ARB_multisample",
|
||||
"GL_ARB_multitexture",
|
||||
"GL_ARB_point_parameters",
|
||||
"GL_ARB_texture_border_clamp",
|
||||
"GL_ARB_texture_compression",
|
||||
"GL_ARB_texture_cube_map",
|
||||
"GL_ARB_texture_env_add",
|
||||
"GL_ARB_texture_env_combine",
|
||||
"GL_ARB_texture_env_dot3",
|
||||
"GL_ARB_texture_mirrored_repeat",
|
||||
"GL_ARB_texture_rectangle",
|
||||
"GL_ARB_vertex_buffer_object",
|
||||
"GL_ARB_vertex_program",
|
||||
"GL_ARB_window_pos",
|
||||
"GL_EXT_abgr",
|
||||
"GL_EXT_bgra",
|
||||
"GL_EXT_blend_color",
|
||||
"GL_EXT_blend_equation_separate",
|
||||
"GL_EXT_blend_func_separate",
|
||||
"GL_EXT_blend_minmax",
|
||||
"GL_EXT_blend_subtract",
|
||||
"GL_EXT_cull_vertex", /* New: alanh 06-Jan-2005 */
|
||||
"GL_EXT_fog_coord",
|
||||
"GL_EXT_multi_draw_arrays",
|
||||
"GL_EXT_secondary_color",
|
||||
"GL_EXT_stencil_wrap",
|
||||
"GL_EXT_texture_edge_clamp",
|
||||
"GL_EXT_texture_env_combine",
|
||||
"GL_EXT_texture_env_dot3",
|
||||
"GL_EXT_texture_filter_anisotropic",
|
||||
"GL_EXT_texture_lod_bias",
|
||||
"GL_3DFX_texture_compression_FXT1",
|
||||
"GL_APPLE_client_storage",
|
||||
"GL_MESA_pack_invert",
|
||||
"GL_MESA_ycbcr_texture",
|
||||
"GL_NV_blend_square",
|
||||
"GL_NV_vertex_program",
|
||||
"GL_NV_vertex_program1_1",
|
||||
"GL_SGIS_generate_mipmap",
|
||||
NULL
|
||||
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
|
||||
{ "GL_ARB_multitexture", NULL },
|
||||
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
|
||||
{ "GL_ARB_texture_border_clamp", NULL },
|
||||
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
|
||||
{ "GL_ARB_texture_cube_map", NULL },
|
||||
{ "GL_ARB_texture_env_add", NULL },
|
||||
{ "GL_ARB_texture_env_combine", NULL },
|
||||
{ "GL_ARB_texture_env_dot3", NULL },
|
||||
{ "GL_ARB_texture_mirrored_repeat", NULL },
|
||||
{ "GL_ARB_texture_rectangle", NULL },
|
||||
{ "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
|
||||
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
|
||||
{ "GL_ARB_window_pos", GL_ARB_window_pos_functions },
|
||||
{ "GL_EXT_blend_color", GL_EXT_blend_color_functions },
|
||||
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
|
||||
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
|
||||
{ "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
|
||||
{ "GL_EXT_blend_subtract", NULL },
|
||||
{ "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions },
|
||||
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
|
||||
{ "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
|
||||
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
|
||||
{ "GL_EXT_stencil_wrap", NULL },
|
||||
{ "GL_EXT_texture_edge_clamp", NULL },
|
||||
{ "GL_EXT_texture_env_combine", NULL },
|
||||
{ "GL_EXT_texture_env_dot3", NULL },
|
||||
{ "GL_EXT_texture_filter_anisotropic", NULL },
|
||||
{ "GL_EXT_texture_lod_bias", NULL },
|
||||
{ "GL_3DFX_texture_compression_FXT1", NULL },
|
||||
{ "GL_APPLE_client_storage", NULL },
|
||||
{ "GL_MESA_pack_invert", NULL },
|
||||
{ "GL_MESA_ycbcr_texture", NULL },
|
||||
{ "GL_NV_blend_square", NULL },
|
||||
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
|
||||
{ "GL_NV_vertex_program1_1", NULL },
|
||||
{ "GL_SGIS_generate_mipmap", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
extern const struct tnl_pipeline_stage _intel_render_stage;
|
||||
|
||||
@@ -412,6 +412,7 @@ extern int INTEL_DEBUG;
|
||||
#define PCI_CHIP_I865_G 0x2572
|
||||
#define PCI_CHIP_I915_G 0x2582
|
||||
#define PCI_CHIP_I915_GM 0x2592
|
||||
#define PCI_CHIP_I945_G 0x2772
|
||||
|
||||
|
||||
/* ================================================================
|
||||
|
||||
@@ -349,6 +349,7 @@ static GLboolean intelCreateContext( const __GLcontextModes *mesaVis,
|
||||
|
||||
case PCI_CHIP_I915_G:
|
||||
case PCI_CHIP_I915_GM:
|
||||
case PCI_CHIP_I945_G:
|
||||
return i915CreateContext( mesaVis, driContextPriv,
|
||||
sharedContextPrivate );
|
||||
|
||||
|
||||
@@ -69,39 +69,10 @@
|
||||
#define INIT_MONO_PIXEL(p,color)\
|
||||
p = INTEL_PACKCOLOR565(color[0],color[1],color[2])
|
||||
|
||||
#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
|
||||
_y >= miny && _y < maxy)
|
||||
|
||||
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
|
||||
if ( _y < miny || _y >= maxy ) { \
|
||||
_n1 = 0, _x1 = x; \
|
||||
} else { \
|
||||
_n1 = _n; \
|
||||
_x1 = _x; \
|
||||
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
|
||||
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
|
||||
}
|
||||
|
||||
#define Y_FLIP(_y) (height - _y - 1)
|
||||
|
||||
|
||||
#define HW_LOCK()
|
||||
|
||||
#define HW_CLIPLOOP() \
|
||||
do { \
|
||||
__DRIdrawablePrivate *dPriv = intel->driDrawable; \
|
||||
int _nc = dPriv->numClipRects; \
|
||||
while (_nc--) { \
|
||||
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \
|
||||
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \
|
||||
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \
|
||||
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y;
|
||||
|
||||
|
||||
#define HW_ENDCLIPLOOP() \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define HW_UNLOCK()
|
||||
|
||||
/* 16 bit, 565 rgb color spanline and pixel functions
|
||||
@@ -125,9 +96,6 @@ do { \
|
||||
#define TAG(x) intel##x##_565
|
||||
#include "spantmp.h"
|
||||
|
||||
|
||||
|
||||
|
||||
/* 15 bit, 555 rgb color spanline and pixel functions
|
||||
*/
|
||||
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
|
||||
|
||||
@@ -57,6 +57,9 @@
|
||||
#include "utils.h"
|
||||
#include "vblank.h"
|
||||
|
||||
#define need_GL_ARB_multisample
|
||||
#include "extension_helper.h"
|
||||
|
||||
#ifndef MACH64_DEBUG
|
||||
int MACH64_DEBUG = (0);
|
||||
#endif
|
||||
@@ -72,17 +75,18 @@ static const struct dri_debug_control debug_control[] =
|
||||
{ "prims", DEBUG_VERBOSE_PRIMS },
|
||||
{ "count", DEBUG_VERBOSE_COUNT },
|
||||
{ "nowait", DEBUG_NOWAIT },
|
||||
{ "fall", DEBUG_VERBOSE_FALLBACK },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
static const char * const card_extensions[] =
|
||||
static const struct dri_extension card_extensions[] =
|
||||
{
|
||||
"GL_ARB_multitexture",
|
||||
"GL_EXT_texture_edge_clamp",
|
||||
"GL_MESA_ycbcr_texture",
|
||||
"GL_SGIS_generate_mipmap",
|
||||
"GL_SGIS_texture_edge_clamp",
|
||||
NULL
|
||||
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
|
||||
{ "GL_ARB_multitexture", NULL },
|
||||
{ "GL_EXT_texture_edge_clamp", NULL },
|
||||
{ "GL_MESA_ycbcr_texture", NULL },
|
||||
{ "GL_SGIS_generate_mipmap", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
@@ -230,6 +234,11 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
|
||||
|
||||
driContextPriv->driverPrivate = (void *)mmesa;
|
||||
|
||||
if (driQueryOptionb(&mmesa->optionCache, "no_rast")) {
|
||||
fprintf(stderr, "disabling 3D acceleration\n");
|
||||
FALLBACK(mmesa, MACH64_FALLBACK_DISABLE, 1);
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,11 +79,11 @@ typedef struct mach64_context *mach64ContextPtr;
|
||||
#define MACH64_FALLBACK_READ_BUFFER 0x0004
|
||||
#define MACH64_FALLBACK_STENCIL 0x0008
|
||||
#define MACH64_FALLBACK_RENDER_MODE 0x0010
|
||||
#define MACH64_FALLBACK_MULTIDRAW 0x0020
|
||||
#define MACH64_FALLBACK_LOGICOP 0x0040
|
||||
#define MACH64_FALLBACK_SEP_SPECULAR 0x0080
|
||||
#define MACH64_FALLBACK_BLEND_EQ 0x0100
|
||||
#define MACH64_FALLBACK_BLEND_FUNC 0x0200
|
||||
#define MACH64_FALLBACK_LOGICOP 0x0020
|
||||
#define MACH64_FALLBACK_SEP_SPECULAR 0x0040
|
||||
#define MACH64_FALLBACK_BLEND_EQ 0x0080
|
||||
#define MACH64_FALLBACK_BLEND_FUNC 0x0100
|
||||
#define MACH64_FALLBACK_DISABLE 0x0200
|
||||
|
||||
#define CARD32 GLuint /* KW: For building in mesa tree */
|
||||
|
||||
@@ -401,4 +401,5 @@ extern int MACH64_DEBUG;
|
||||
#define DEBUG_VERBOSE_PRIMS 0x040
|
||||
#define DEBUG_VERBOSE_COUNT 0x080
|
||||
#define DEBUG_NOWAIT 0x100
|
||||
#define DEBUG_VERBOSE_FALLBACK 0x200
|
||||
#endif /* __MACH64_CONTEXT_H__ */
|
||||
|
||||
@@ -54,16 +54,17 @@ DRI_CONF_BEGIN
|
||||
DRI_CONF_SECTION_PERFORMANCE
|
||||
DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
|
||||
DRI_CONF_SECTION_END
|
||||
#if ENABLE_PERF_BOXES
|
||||
DRI_CONF_SECTION_DEBUG
|
||||
DRI_CONF_NO_RAST(false)
|
||||
#if ENABLE_PERF_BOXES
|
||||
DRI_CONF_PERFORMANCE_BOXES(false)
|
||||
DRI_CONF_SECTION_END
|
||||
#endif
|
||||
DRI_CONF_SECTION_END
|
||||
DRI_CONF_END;
|
||||
#if ENABLE_PERF_BOXES
|
||||
static const GLuint __driNConfigOptions = 2;
|
||||
static const GLuint __driNConfigOptions = 3;
|
||||
#else
|
||||
static const GLuint __driNConfigOptions = 1;
|
||||
static const GLuint __driNConfigOptions = 2;
|
||||
#endif
|
||||
|
||||
#ifdef USE_NEW_INTERFACE
|
||||
|
||||
@@ -26,14 +26,13 @@
|
||||
* Authors:
|
||||
* Gareth Hughes <gareth@valinux.com>
|
||||
* Leif Delgass <ldelgass@retinalburn.net>
|
||||
* Jos<6F> Fonseca <j_r_fonseca@yahoo.co.uk>
|
||||
* Jos<6F>Fonseca <j_r_fonseca@yahoo.co.uk>
|
||||
*/
|
||||
|
||||
#include "mach64_context.h"
|
||||
#include "mach64_ioctl.h"
|
||||
#include "mach64_state.h"
|
||||
#include "mach64_span.h"
|
||||
#include "mach64_tex.h"
|
||||
|
||||
#include "swrast/swrast.h"
|
||||
|
||||
@@ -58,6 +57,7 @@
|
||||
(void) read_buf; (void) buf; (void) p
|
||||
|
||||
#define LOCAL_DEPTH_VARS \
|
||||
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); \
|
||||
mach64ScreenRec *mach64Screen = mmesa->mach64Screen; \
|
||||
__DRIdrawablePrivate *dPriv = mmesa->driDrawable; \
|
||||
__DRIscreenPrivate *driScreen = mmesa->driScreen; \
|
||||
@@ -70,28 +70,11 @@
|
||||
|
||||
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
|
||||
|
||||
#define CLIPPIXEL( _x, _y ) \
|
||||
((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy))
|
||||
|
||||
|
||||
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
|
||||
if (( _y < miny) || (_y >= maxy)) { \
|
||||
_n1 = 0, _x1 = x; \
|
||||
} else { \
|
||||
_n1 = _n; \
|
||||
_x1 = _x; \
|
||||
if (_x1 < minx) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
|
||||
if (_x1 + _n1 >= maxx) n1 -= (_x1 + n1 - maxx); \
|
||||
}
|
||||
|
||||
#define Y_FLIP( _y ) (height - _y - 1)
|
||||
|
||||
#define HW_LOCK()
|
||||
|
||||
#define HW_LOCK() \
|
||||
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); \
|
||||
LOCK_HARDWARE( mmesa ); \
|
||||
FINISH_DMA_LOCKED( mmesa ); \
|
||||
|
||||
/* FIXME could/should we use dPriv->numClipRects like the other drivers? */
|
||||
#define HW_CLIPLOOP() \
|
||||
do { \
|
||||
int _nc = mmesa->numClipRects; \
|
||||
@@ -106,8 +89,7 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define HW_UNLOCK() \
|
||||
UNLOCK_HARDWARE( mmesa ) \
|
||||
#define HW_UNLOCK()
|
||||
|
||||
|
||||
|
||||
@@ -117,59 +99,24 @@
|
||||
|
||||
/* 16 bit, RGB565 color spanline and pixel functions
|
||||
*/
|
||||
#undef INIT_MONO_PIXEL
|
||||
#define INIT_MONO_PIXEL(p, color) \
|
||||
p = MACH64PACKCOLOR565( color[0], color[1], color[2] )
|
||||
|
||||
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
|
||||
*(GLushort *)(buf + _x*2 + _y*pitch) = ((((int)r & 0xf8) << 8) | \
|
||||
(((int)g & 0xfc) << 3) | \
|
||||
(((int)b & 0xf8) >> 3))
|
||||
|
||||
#define WRITE_PIXEL( _x, _y, p ) \
|
||||
*(GLushort *)(buf + _x*2 + _y*pitch) = p
|
||||
|
||||
#define READ_RGBA( rgba, _x, _y ) \
|
||||
do { \
|
||||
GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \
|
||||
rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \
|
||||
rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \
|
||||
rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
|
||||
rgba[3] = 0xff; \
|
||||
} while (0)
|
||||
|
||||
#define TAG(x) mach64##x##_RGB565
|
||||
#include "spantmp.h"
|
||||
#define SPANTMP_PIXEL_FMT GL_RGB
|
||||
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
|
||||
|
||||
#define TAG(x) mach64##x##_RGB565
|
||||
#define TAG2(x,y) mach64##x##_RGB565##y
|
||||
#include "spantmp2.h"
|
||||
|
||||
|
||||
/* 32 bit, ARGB8888 color spanline and pixel functions
|
||||
*/
|
||||
#undef INIT_MONO_PIXEL
|
||||
#define INIT_MONO_PIXEL(p, color) \
|
||||
p = MACH64PACKCOLOR8888( color[0], color[1], color[2], color[3] )
|
||||
|
||||
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
|
||||
*(GLuint *)(buf + _x*4 + _y*pitch) = ((b << 0) | \
|
||||
(g << 8) | \
|
||||
(r << 16) | \
|
||||
(a << 24) )
|
||||
|
||||
#define WRITE_PIXEL( _x, _y, p ) \
|
||||
*(GLuint *)(buf + _x*4 + _y*pitch) = p
|
||||
|
||||
#define READ_RGBA( rgba, _x, _y ) \
|
||||
do { \
|
||||
GLuint p = *(GLuint *)(read_buf + _x*4 + _y*pitch); \
|
||||
rgba[0] = (p >> 16) & 0xff; \
|
||||
rgba[1] = (p >> 8) & 0xff; \
|
||||
rgba[2] = (p >> 0) & 0xff; \
|
||||
rgba[3] = 0xff; /*(p >> 24) & 0xff;*/ \
|
||||
} while (0)
|
||||
|
||||
#define TAG(x) mach64##x##_ARGB8888
|
||||
#include "spantmp.h"
|
||||
/* FIXME the old code always read back alpha as 0xff, i.e. fully opaque.
|
||||
Was there a reason to do so ? If so that'll won't work with that template... */
|
||||
#define SPANTMP_PIXEL_FMT GL_BGRA
|
||||
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
|
||||
|
||||
#define TAG(x) mach64##x##_ARGB8888
|
||||
#define TAG2(x,y) mach64##x##_ARGB8888##y
|
||||
#include "spantmp2.h"
|
||||
|
||||
|
||||
/* ================================================================
|
||||
@@ -179,10 +126,10 @@ do { \
|
||||
/* 16 bit depthbuffer functions.
|
||||
*/
|
||||
#define WRITE_DEPTH( _x, _y, d ) \
|
||||
*(GLushort *)(buf + _x*2 + _y*pitch) = d;
|
||||
*(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d;
|
||||
|
||||
#define READ_DEPTH( d, _x, _y ) \
|
||||
d = *(GLushort *)(buf + _x*2 + _y*pitch);
|
||||
d = *(GLushort *)(buf + (_x)*2 + (_y)*pitch);
|
||||
|
||||
#define TAG(x) mach64##x##_16
|
||||
#include "depthtmp.h"
|
||||
@@ -217,64 +164,27 @@ static void mach64DDSetBuffer( GLcontext *ctx,
|
||||
}
|
||||
}
|
||||
|
||||
static void mach64SpanRenderStart( GLcontext *ctx )
|
||||
{
|
||||
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
|
||||
LOCK_HARDWARE( mmesa );
|
||||
FINISH_DMA_LOCKED( mmesa );
|
||||
}
|
||||
|
||||
static void mach64SpanRenderFinish( GLcontext *ctx )
|
||||
{
|
||||
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
|
||||
_swrast_flush( ctx );
|
||||
UNLOCK_HARDWARE( mmesa );
|
||||
}
|
||||
|
||||
void mach64DDInitSpanFuncs( GLcontext *ctx )
|
||||
{
|
||||
#if 0
|
||||
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
|
||||
#endif
|
||||
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
|
||||
|
||||
swdd->SetBuffer = mach64DDSetBuffer;
|
||||
|
||||
#if 0
|
||||
switch ( mmesa->mach64Screen->cpp ) {
|
||||
case 2:
|
||||
swdd->WriteRGBASpan = mach64WriteRGBASpan_RGB565;
|
||||
swdd->WriteRGBSpan = mach64WriteRGBSpan_RGB565;
|
||||
swdd->WriteMonoRGBASpan = mach64WriteMonoRGBASpan_RGB565;
|
||||
swdd->WriteRGBAPixels = mach64WriteRGBAPixels_RGB565;
|
||||
swdd->WriteMonoRGBAPixels = mach64WriteMonoRGBAPixels_RGB565;
|
||||
swdd->ReadRGBASpan = mach64ReadRGBASpan_RGB565;
|
||||
swdd->ReadRGBAPixels = mach64ReadRGBAPixels_RGB565;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
swdd->WriteRGBASpan = mach64WriteRGBASpan_ARGB8888;
|
||||
swdd->WriteRGBSpan = mach64WriteRGBSpan_ARGB8888;
|
||||
swdd->WriteMonoRGBASpan = mach64WriteMonoRGBASpan_ARGB8888;
|
||||
swdd->WriteRGBAPixels = mach64WriteRGBAPixels_ARGB8888;
|
||||
swdd->WriteMonoRGBAPixels = mach64WriteMonoRGBAPixels_ARGB8888;
|
||||
swdd->ReadRGBASpan = mach64ReadRGBASpan_ARGB8888;
|
||||
swdd->ReadRGBAPixels = mach64ReadRGBAPixels_ARGB8888;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Depth buffer is always 16 bit */
|
||||
#if 0
|
||||
swdd->ReadDepthSpan = mach64ReadDepthSpan_16;
|
||||
swdd->WriteDepthSpan = mach64WriteDepthSpan_16;
|
||||
swdd->ReadDepthPixels = mach64ReadDepthPixels_16;
|
||||
swdd->WriteDepthPixels = mach64WriteDepthPixels_16;
|
||||
#endif
|
||||
/* No hardware stencil buffer */
|
||||
swdd->ReadStencilSpan = NULL;
|
||||
swdd->WriteStencilSpan = NULL;
|
||||
swdd->ReadStencilPixels = NULL;
|
||||
swdd->WriteStencilPixels = NULL;
|
||||
|
||||
swdd->WriteCI8Span = NULL;
|
||||
swdd->WriteCI32Span = NULL;
|
||||
swdd->WriteMonoCISpan = NULL;
|
||||
swdd->WriteCI32Pixels = NULL;
|
||||
swdd->WriteMonoCIPixels = NULL;
|
||||
swdd->ReadCI32Span = NULL;
|
||||
swdd->ReadCI32Pixels = NULL;
|
||||
swdd->SpanRenderStart = mach64SpanRenderStart;
|
||||
swdd->SpanRenderFinish = mach64SpanRenderFinish;
|
||||
}
|
||||
|
||||
|
||||
@@ -286,22 +196,10 @@ mach64SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
|
||||
{
|
||||
if (drb->Base.InternalFormat == GL_RGBA) {
|
||||
if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
|
||||
drb->Base.GetRow = mach64ReadRGBASpan_RGB565;
|
||||
drb->Base.GetValues = mach64ReadRGBAPixels_RGB565;
|
||||
drb->Base.PutRow = mach64WriteRGBASpan_RGB565;
|
||||
drb->Base.PutRowRGB = mach64WriteRGBSpan_RGB565;
|
||||
drb->Base.PutMonoRow = mach64WriteMonoRGBASpan_RGB565;
|
||||
drb->Base.PutValues = mach64WriteRGBAPixels_RGB565;
|
||||
drb->Base.PutMonoValues = mach64WriteMonoRGBAPixels_RGB565;
|
||||
mach64InitPointers_RGB565(&drb->Base);
|
||||
}
|
||||
else {
|
||||
drb->Base.GetRow = mach64ReadRGBASpan_ARGB8888;
|
||||
drb->Base.GetValues = mach64ReadRGBAPixels_ARGB8888;
|
||||
drb->Base.PutRow = mach64WriteRGBASpan_ARGB8888;
|
||||
drb->Base.PutRowRGB = mach64WriteRGBSpan_ARGB8888;
|
||||
drb->Base.PutMonoRow = mach64WriteMonoRGBASpan_ARGB8888;
|
||||
drb->Base.PutValues = mach64WriteRGBAPixels_ARGB8888;
|
||||
drb->Base.PutMonoValues = mach64WriteMonoRGBAPixels_ARGB8888;
|
||||
mach64InitPointers_ARGB8888(&drb->Base);
|
||||
}
|
||||
}
|
||||
else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
|
||||
|
||||
@@ -1838,6 +1838,30 @@ static void mach64RenderFinish( GLcontext *ctx )
|
||||
/* Transition to/from hardware rasterization. */
|
||||
/**********************************************************************/
|
||||
|
||||
static const char * const fallbackStrings[] = {
|
||||
"Texture mode",
|
||||
"glDrawBuffer(GL_FRONT_AND_BACK)",
|
||||
"glReadBuffer",
|
||||
"glEnable(GL_STENCIL) without hw stencil buffer",
|
||||
"glRenderMode(selection or feedback)",
|
||||
"glLogicOp (mode != GL_COPY)",
|
||||
"GL_SEPARATE_SPECULAR_COLOR",
|
||||
"glBlendEquation (mode != ADD)",
|
||||
"glBlendFunc",
|
||||
"Rasterization disable",
|
||||
};
|
||||
|
||||
|
||||
static const char *getFallbackString(GLuint bit)
|
||||
{
|
||||
int i = 0;
|
||||
while (bit > 1) {
|
||||
i++;
|
||||
bit >>= 1;
|
||||
}
|
||||
return fallbackStrings[i];
|
||||
}
|
||||
|
||||
void mach64Fallback( GLcontext *ctx, GLuint bit, GLboolean mode )
|
||||
{
|
||||
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
||||
@@ -1845,18 +1869,18 @@ void mach64Fallback( GLcontext *ctx, GLuint bit, GLboolean mode )
|
||||
GLuint oldfallback = mmesa->Fallback;
|
||||
|
||||
if (mode) {
|
||||
if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
|
||||
fprintf(stderr,"Set Fallback: %d\n", bit);
|
||||
mmesa->Fallback |= bit;
|
||||
if (oldfallback == 0) {
|
||||
FLUSH_BATCH( mmesa );
|
||||
_swsetup_Wakeup( ctx );
|
||||
mmesa->RenderIndex = ~0;
|
||||
if (MACH64_DEBUG & DEBUG_VERBOSE_FALLBACK) {
|
||||
fprintf(stderr, "Mach64 begin rasterization fallback: 0x%x %s\n",
|
||||
bit, getFallbackString(bit));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
|
||||
fprintf(stderr,"Clear Fallback: %d\n", bit);
|
||||
mmesa->Fallback &= ~bit;
|
||||
if (oldfallback == bit) {
|
||||
_swrast_flush( ctx );
|
||||
@@ -1866,6 +1890,10 @@ void mach64Fallback( GLcontext *ctx, GLuint bit, GLboolean mode )
|
||||
tnl->Driver.Render.BuildVertices = mach64BuildVertices;
|
||||
mmesa->NewGLState |= (_MACH64_NEW_RENDER_STATE|
|
||||
_MACH64_NEW_VERTEX_STATE);
|
||||
if (MACH64_DEBUG & DEBUG_VERBOSE_FALLBACK) {
|
||||
fprintf(stderr, "Mach64 end rasterization fallback: 0x%x %s\n",
|
||||
bit, getFallbackString(bit));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1890,6 +1918,4 @@ void mach64InitTriFuncs( GLcontext *ctx )
|
||||
tnl->Driver.Render.PrimitiveNotify = mach64RenderPrimitive;
|
||||
tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
|
||||
tnl->Driver.Render.BuildVertices = mach64BuildVertices;
|
||||
|
||||
/* mach64Fallback( ctx, 0x100000, 1 ); */
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "drm.h"
|
||||
#include "mga_drm.h"
|
||||
#include "mga_xmesa.h"
|
||||
@@ -68,6 +69,18 @@
|
||||
|
||||
#include "GL/internal/dri_interface.h"
|
||||
|
||||
#define need_GL_ARB_multisample
|
||||
#define need_GL_ARB_texture_compression
|
||||
#define need_GL_ARB_vertex_program
|
||||
#define need_GL_EXT_fog_coord
|
||||
#define need_GL_EXT_multi_draw_arrays
|
||||
#define need_GL_EXT_secondary_color
|
||||
#if 0
|
||||
#define need_GL_EXT_paletted_texture
|
||||
#endif
|
||||
#define need_GL_NV_vertex_program
|
||||
#include "extension_helper.h"
|
||||
|
||||
/* MGA configuration
|
||||
*/
|
||||
#include "xmlpool.h"
|
||||
@@ -85,8 +98,11 @@ DRI_CONF_BEGIN
|
||||
DRI_CONF_ARB_VERTEX_PROGRAM(true)
|
||||
DRI_CONF_NV_VERTEX_PROGRAM(true)
|
||||
DRI_CONF_SECTION_END
|
||||
DRI_CONF_SECTION_DEBUG
|
||||
DRI_CONF_NO_RAST(false)
|
||||
DRI_CONF_SECTION_END
|
||||
DRI_CONF_END;
|
||||
static const GLuint __driNConfigOptions = 5;
|
||||
static const GLuint __driNConfigOptions = 6;
|
||||
|
||||
#ifdef USE_NEW_INTERFACE
|
||||
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
|
||||
@@ -261,22 +277,30 @@ mgaInitDriver(__DRIscreenPrivate *sPriv)
|
||||
* primary DMA region base address needs to be known is so that the driver
|
||||
* can busy wait for certain DMA operations to complete (see
|
||||
* mgaWaitForFrameCompletion in mgaioctl.c).
|
||||
*
|
||||
* Starting with MGA DRM version 3.2, these are completely unneeded as
|
||||
* there is a new, in-kernel mechanism for handling the wait.
|
||||
*/
|
||||
|
||||
mgaScreen->mmio.handle = serverInfo->registers.handle;
|
||||
mgaScreen->mmio.size = serverInfo->registers.size;
|
||||
if ( drmMap( sPriv->fd,
|
||||
mgaScreen->mmio.handle, mgaScreen->mmio.size,
|
||||
&mgaScreen->mmio.map ) < 0 ) {
|
||||
FREE( mgaScreen );
|
||||
sPriv->private = NULL;
|
||||
__driUtilMessage( "Couldn't map MMIO registers" );
|
||||
return GL_FALSE;
|
||||
if (mgaScreen->sPriv->drmMinor < 2) {
|
||||
mgaScreen->mmio.handle = serverInfo->registers.handle;
|
||||
mgaScreen->mmio.size = serverInfo->registers.size;
|
||||
if ( drmMap( sPriv->fd,
|
||||
mgaScreen->mmio.handle, mgaScreen->mmio.size,
|
||||
&mgaScreen->mmio.map ) < 0 ) {
|
||||
FREE( mgaScreen );
|
||||
sPriv->private = NULL;
|
||||
__driUtilMessage( "Couldn't map MMIO registers" );
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
mgaScreen->primary.handle = serverInfo->primary.handle;
|
||||
mgaScreen->primary.size = serverInfo->primary.size;
|
||||
}
|
||||
else {
|
||||
(void) memset( & mgaScreen->primary, 0, sizeof( mgaScreen->primary ) );
|
||||
(void) memset( & mgaScreen->mmio, 0, sizeof( mgaScreen->mmio ) );
|
||||
}
|
||||
|
||||
mgaScreen->primary.handle = serverInfo->primary.handle;
|
||||
mgaScreen->primary.size = serverInfo->primary.size;
|
||||
|
||||
|
||||
mgaScreen->textureOffset[MGA_CARD_HEAP] = serverInfo->textureOffset;
|
||||
mgaScreen->textureOffset[MGA_AGP_HEAP] = (serverInfo->agpTextureOffset |
|
||||
@@ -368,39 +392,47 @@ static const struct tnl_pipeline_stage *mga_pipeline[] = {
|
||||
};
|
||||
|
||||
|
||||
static const char * const g400_extensions[] =
|
||||
static const struct dri_extension g400_extensions[] =
|
||||
{
|
||||
"GL_ARB_multitexture",
|
||||
"GL_ARB_texture_env_add",
|
||||
"GL_ARB_texture_env_combine",
|
||||
"GL_ARB_texture_env_crossbar",
|
||||
"GL_EXT_texture_env_combine",
|
||||
"GL_EXT_texture_edge_clamp",
|
||||
"GL_ATI_texture_env_combine3",
|
||||
#if defined (MESA_packed_depth_stencil)
|
||||
"GL_MESA_packed_depth_stencil",
|
||||
#endif
|
||||
NULL
|
||||
{ "GL_ARB_multitexture", NULL },
|
||||
{ "GL_ARB_texture_env_add", NULL },
|
||||
{ "GL_ARB_texture_env_combine", NULL },
|
||||
{ "GL_ARB_texture_env_crossbar", NULL },
|
||||
{ "GL_EXT_texture_env_combine", NULL },
|
||||
{ "GL_EXT_texture_edge_clamp", NULL },
|
||||
{ "GL_ATI_texture_env_combine3", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
static const char * const card_extensions[] =
|
||||
static const struct dri_extension card_extensions[] =
|
||||
{
|
||||
"GL_ARB_multisample",
|
||||
"GL_ARB_texture_compression",
|
||||
"GL_ARB_texture_rectangle",
|
||||
"GL_EXT_blend_logic_op",
|
||||
"GL_EXT_fog_coord",
|
||||
"GL_EXT_multi_draw_arrays",
|
||||
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
|
||||
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
|
||||
{ "GL_ARB_texture_rectangle", NULL },
|
||||
{ "GL_EXT_blend_logic_op", NULL },
|
||||
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
|
||||
{ "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
|
||||
/* paletted_textures currently doesn't work, but we could fix them later */
|
||||
#if 0
|
||||
"GL_EXT_shared_texture_palette",
|
||||
"GL_EXT_paletted_texture",
|
||||
#if defined( need_GL_EXT_paletted_texture )
|
||||
{ "GL_EXT_shared_texture_palette", NULL },
|
||||
{ "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions },
|
||||
#endif
|
||||
"GL_EXT_secondary_color",
|
||||
"GL_EXT_stencil_wrap",
|
||||
"GL_MESA_ycbcr_texture",
|
||||
"GL_SGIS_generate_mipmap",
|
||||
NULL
|
||||
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
|
||||
{ "GL_EXT_stencil_wrap", NULL },
|
||||
{ "GL_MESA_ycbcr_texture", NULL },
|
||||
{ "GL_SGIS_generate_mipmap", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
static const struct dri_extension ARB_vp_extension[] = {
|
||||
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
static const struct dri_extension NV_vp_extensions[] = {
|
||||
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
|
||||
{ "GL_NV_vertex_program1_1", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
static const struct dri_debug_control debug_control[] =
|
||||
@@ -605,12 +637,11 @@ mgaCreateContext( const __GLcontextModes *mesaVis,
|
||||
}
|
||||
|
||||
if ( driQueryOptionb( &mmesa->optionCache, "arb_vertex_program" ) ) {
|
||||
_mesa_enable_extension( ctx, "GL_ARB_vertex_program" );
|
||||
driInitSingleExtension( ctx, ARB_vp_extension );
|
||||
}
|
||||
|
||||
if ( driQueryOptionb( &mmesa->optionCache, "nv_vertex_program" ) ) {
|
||||
_mesa_enable_extension( ctx, "GL_NV_vertex_program" );
|
||||
_mesa_enable_extension( ctx, "GL_NV_vertex_program1_1" );
|
||||
driInitExtensions( ctx, NV_vp_extensions, GL_FALSE );
|
||||
}
|
||||
|
||||
|
||||
@@ -640,6 +671,11 @@ mgaCreateContext( const __GLcontextModes *mesaVis,
|
||||
|
||||
(*mmesa->get_ust)( & mmesa->swap_ust );
|
||||
|
||||
if (driQueryOptionb(&mmesa->optionCache, "no_rast")) {
|
||||
fprintf(stderr, "disabling 3D acceleration\n");
|
||||
FALLBACK(mmesa->glCtx, MGA_FALLBACK_DISABLE, 1);
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#ifndef MGALIB_INC
|
||||
#define MGALIB_INC
|
||||
|
||||
#include <stdint.h>
|
||||
#include "drm.h"
|
||||
#include "mga_drm.h"
|
||||
#include "dri_util.h"
|
||||
@@ -62,6 +63,7 @@
|
||||
#define MGA_FALLBACK_STENCIL 0x20
|
||||
#define MGA_FALLBACK_DEPTH 0x40
|
||||
#define MGA_FALLBACK_BORDER_MODE 0x80
|
||||
#define MGA_FALLBACK_DISABLE 0x100
|
||||
|
||||
|
||||
/* Use the templated vertex formats:
|
||||
@@ -267,6 +269,8 @@ struct mga_context_t {
|
||||
GLuint swap_count;
|
||||
GLuint swap_missed_count;
|
||||
|
||||
uint32_t last_frame_fence;
|
||||
|
||||
PFNGLXGETUSTPROC get_ust;
|
||||
|
||||
/* Drawable, cliprect and scissor information
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "mga_xmesa.h"
|
||||
#include "utils.h"
|
||||
|
||||
#define DRIVER_DATE "20030328"
|
||||
#define DRIVER_DATE "20050609"
|
||||
|
||||
|
||||
/***************************************
|
||||
|
||||
@@ -50,6 +50,49 @@
|
||||
#include "vblank.h"
|
||||
|
||||
|
||||
int
|
||||
mgaSetFence( mgaContextPtr mmesa, uint32_t * fence )
|
||||
{
|
||||
int ret = ENOSYS;
|
||||
|
||||
if ( mmesa->driScreen->drmMinor >= 2 ) {
|
||||
ret = drmCommandWriteRead( mmesa->driScreen->fd, DRM_MGA_SET_FENCE,
|
||||
fence, sizeof( uint32_t ));
|
||||
if (ret) {
|
||||
fprintf(stderr, "drmMgaSetFence: %d\n", ret);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mgaWaitFence( mgaContextPtr mmesa, uint32_t fence, uint32_t * curr_fence )
|
||||
{
|
||||
int ret = ENOSYS;
|
||||
|
||||
if ( mmesa->driScreen->drmMinor >= 2 ) {
|
||||
uint32_t temp = fence;
|
||||
|
||||
ret = drmCommandWriteRead( mmesa->driScreen->fd,
|
||||
DRM_MGA_WAIT_FENCE,
|
||||
& temp, sizeof( uint32_t ));
|
||||
if (ret) {
|
||||
fprintf(stderr, "drmMgaSetFence: %d\n", ret);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ( curr_fence ) {
|
||||
*curr_fence = temp;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static void mga_iload_dma_ioctl(mgaContextPtr mmesa,
|
||||
unsigned long dest,
|
||||
int length)
|
||||
@@ -294,58 +337,64 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
|
||||
* \bug
|
||||
* The loop in this function should have some sort of a timeout mechanism.
|
||||
*
|
||||
* \todo
|
||||
* This routine should be modified to wait on a semaphore. To do this,
|
||||
* the DRM would have to queue an interrupt when the swap command was
|
||||
* put in the DMA buffer. When the interrupt occured, the DRM would UP
|
||||
* the semaphore. This function would then just DOWN the semaphore.
|
||||
* \warning
|
||||
* This routine used to assume that the hardware lock was held on entry. It
|
||||
* now assumes that the lock is \b not held on entry.
|
||||
*/
|
||||
|
||||
static void mgaWaitForFrameCompletion( mgaContextPtr mmesa )
|
||||
{
|
||||
unsigned wait = 0;
|
||||
const GLuint last_frame = mmesa->sarea->last_frame.head;
|
||||
const GLuint last_wrap = mmesa->sarea->last_frame.wrap;
|
||||
if ( mgaWaitFence( mmesa, mmesa->last_frame_fence, NULL ) == ENOSYS ) {
|
||||
unsigned wait = 0;
|
||||
GLuint last_frame;
|
||||
GLuint last_wrap;
|
||||
|
||||
|
||||
/* The DMA routines in the kernel track a couple values in the SAREA that
|
||||
* we use here. The number of times that the primary DMA buffer has
|
||||
* "wrapped" around is tracked in last_wrap. In addition, the wrap count
|
||||
* and the buffer position at the end of the last frame are stored in
|
||||
* last_frame.wrap and last_frame.head.
|
||||
*
|
||||
* By comparing the wrap counts and the current DMA pointer value (read
|
||||
* directly from the hardware) to last_frame.head, we can determine when
|
||||
* the graphics processor has processed all of the commands for the last
|
||||
* frame.
|
||||
*
|
||||
* In this case "last frame" means the frame of the *previous* swap-
|
||||
* buffers call. This is done to prevent queuing a second buffer swap
|
||||
* before the previous swap is executed.
|
||||
*/
|
||||
while ( 1 ) {
|
||||
if ( last_wrap < mmesa->sarea->last_wrap ||
|
||||
( last_wrap == mmesa->sarea->last_wrap &&
|
||||
last_frame <= (MGA_READ( MGAREG_PRIMADDRESS ) -
|
||||
mmesa->primary_offset) ) ) {
|
||||
break;
|
||||
}
|
||||
if ( 0 ) {
|
||||
wait++;
|
||||
fprintf( stderr, " last: head=0x%06x wrap=%d\n",
|
||||
last_frame, last_wrap );
|
||||
fprintf( stderr, " head: head=0x%06lx wrap=%d\n",
|
||||
(long)(MGA_READ( MGAREG_PRIMADDRESS ) - mmesa->primary_offset),
|
||||
mmesa->sarea->last_wrap );
|
||||
}
|
||||
UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH );
|
||||
LOCK_HARDWARE( mmesa );
|
||||
last_frame = mmesa->sarea->last_frame.head;
|
||||
last_wrap = mmesa->sarea->last_frame.wrap;
|
||||
|
||||
UNLOCK_HARDWARE( mmesa );
|
||||
DO_USLEEP( 1 );
|
||||
LOCK_HARDWARE( mmesa );
|
||||
}
|
||||
if ( wait )
|
||||
fprintf( stderr, "\n" );
|
||||
/* The DMA routines in the kernel track a couple values in the SAREA
|
||||
* that we use here. The number of times that the primary DMA buffer
|
||||
* has "wrapped" around is tracked in last_wrap. In addition, the
|
||||
* wrap count and the buffer position at the end of the last frame are
|
||||
* stored in last_frame.wrap and last_frame.head.
|
||||
*
|
||||
* By comparing the wrap counts and the current DMA pointer value
|
||||
* (read directly from the hardware) to last_frame.head, we can
|
||||
* determine when the graphics processor has processed all of the
|
||||
* commands for the last frame.
|
||||
*
|
||||
* In this case "last frame" means the frame of the *previous* swap-
|
||||
* buffers call. This is done to prevent queuing a second buffer swap
|
||||
* before the previous swap is executed.
|
||||
*/
|
||||
while ( 1 ) {
|
||||
if ( last_wrap < mmesa->sarea->last_wrap ||
|
||||
( last_wrap == mmesa->sarea->last_wrap &&
|
||||
last_frame <= (MGA_READ( MGAREG_PRIMADDRESS ) -
|
||||
mmesa->primary_offset) ) ) {
|
||||
break;
|
||||
}
|
||||
if ( 0 ) {
|
||||
wait++;
|
||||
fprintf( stderr, " last: head=0x%06x wrap=%d\n",
|
||||
last_frame, last_wrap );
|
||||
fprintf( stderr, " head: head=0x%06lx wrap=%d\n",
|
||||
(long)(MGA_READ( MGAREG_PRIMADDRESS ) - mmesa->primary_offset),
|
||||
mmesa->sarea->last_wrap );
|
||||
}
|
||||
UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH );
|
||||
|
||||
UNLOCK_HARDWARE( mmesa );
|
||||
DO_USLEEP( 1 );
|
||||
LOCK_HARDWARE( mmesa );
|
||||
}
|
||||
if ( wait )
|
||||
fprintf( stderr, "\n" );
|
||||
|
||||
UNLOCK_HARDWARE( mmesa );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -370,9 +419,7 @@ void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv )
|
||||
|
||||
FLUSH_BATCH( mmesa );
|
||||
|
||||
LOCK_HARDWARE( mmesa );
|
||||
mgaWaitForFrameCompletion( mmesa );
|
||||
UNLOCK_HARDWARE( mmesa );
|
||||
driWaitForVBlank( dPriv, & mmesa->vbl_seq, mmesa->vblank_flags,
|
||||
& missed_target );
|
||||
if ( missed_target ) {
|
||||
@@ -410,6 +457,7 @@ void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv )
|
||||
}
|
||||
}
|
||||
|
||||
(void) mgaSetFence( mmesa, & mmesa->last_frame_fence );
|
||||
UNLOCK_HARDWARE( mmesa );
|
||||
|
||||
mmesa->dirty |= MGA_UPLOAD_CLIPRECTS;
|
||||
@@ -425,17 +473,12 @@ void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv )
|
||||
*
|
||||
* \param ctx Context where the \c glFinish command was issued.
|
||||
*
|
||||
* \todo
|
||||
* This is overkill. The lock, update-lock, unlock sequence grabs the
|
||||
* hardware, waits for \b all hardware activity to finish, then releases the
|
||||
* hardware. A better way would be to flush the pending DMA buffers, emit
|
||||
* a SOFTRAP, and wait for the SOFTRAP.
|
||||
*
|
||||
* \sa glFinish, mgaFlush, mgaFlushDMA
|
||||
*/
|
||||
static void mgaFinish( GLcontext *ctx )
|
||||
{
|
||||
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
|
||||
uint32_t fence;
|
||||
|
||||
|
||||
LOCK_HARDWARE( mmesa );
|
||||
@@ -443,12 +486,18 @@ static void mgaFinish( GLcontext *ctx )
|
||||
mgaFlushVerticesLocked( mmesa );
|
||||
}
|
||||
|
||||
if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL) {
|
||||
fprintf(stderr, "mgaRegetLockQuiescent\n");
|
||||
if ( mgaSetFence( mmesa, & fence ) == 0 ) {
|
||||
UNLOCK_HARDWARE( mmesa );
|
||||
(void) mgaWaitFence( mmesa, fence, NULL );
|
||||
}
|
||||
else {
|
||||
if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL) {
|
||||
fprintf(stderr, "mgaRegetLockQuiescent\n");
|
||||
}
|
||||
|
||||
UPDATE_LOCK( mmesa, DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH );
|
||||
UNLOCK_HARDWARE( mmesa );
|
||||
UPDATE_LOCK( mmesa, DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH );
|
||||
UNLOCK_HARDWARE( mmesa );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#define DBG 0
|
||||
|
||||
#define LOCAL_VARS \
|
||||
mgaContextPtr mmesa = MGA_CONTEXT(ctx); \
|
||||
__DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \
|
||||
mgaScreenPrivate *mgaScreen = mmesa->mgaScreen; \
|
||||
__DRIscreenPrivate *sPriv = mmesa->driScreen; \
|
||||
@@ -51,10 +52,11 @@
|
||||
dPriv->y * pitch); \
|
||||
GLuint p; \
|
||||
(void) read_buf; (void) buf; (void) p
|
||||
|
||||
|
||||
|
||||
|
||||
#define LOCAL_DEPTH_VARS \
|
||||
mgaContextPtr mmesa = MGA_CONTEXT(ctx); \
|
||||
__DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \
|
||||
mgaScreenPrivate *mgaScreen = mmesa->mgaScreen; \
|
||||
__DRIscreenPrivate *sPriv = mmesa->driScreen; \
|
||||
@@ -67,26 +69,9 @@
|
||||
|
||||
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
|
||||
|
||||
#define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \
|
||||
_y >= miny && _y < maxy)
|
||||
|
||||
#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
|
||||
if ( _y < miny || _y >= maxy ) { \
|
||||
_n1 = 0, _x1 = x; \
|
||||
} else { \
|
||||
_n1 = _n; \
|
||||
_x1 = _x; \
|
||||
if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \
|
||||
if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
|
||||
}
|
||||
|
||||
|
||||
#define HW_LOCK() \
|
||||
mgaContextPtr mmesa = MGA_CONTEXT(ctx); \
|
||||
FLUSH_BATCH(mmesa); \
|
||||
LOCK_HARDWARE_QUIESCENT(mmesa);
|
||||
|
||||
#define HW_LOCK()
|
||||
|
||||
/* FIXME could/should we use dPriv->numClipRects like the other drivers? */
|
||||
#define HW_CLIPLOOP() \
|
||||
do { \
|
||||
int _nc = mmesa->numClipRects; \
|
||||
@@ -100,11 +85,7 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define HW_UNLOCK() \
|
||||
UNLOCK_HARDWARE(mmesa);
|
||||
|
||||
|
||||
|
||||
#define HW_UNLOCK()
|
||||
|
||||
|
||||
|
||||
@@ -112,9 +93,6 @@
|
||||
|
||||
/* 16 bit, RGB565 color spanline and pixel functions
|
||||
*/
|
||||
|
||||
#define GET_SRC_PTR(_x, _y) (read_buf + _x * 2 + _y * pitch)
|
||||
#define GET_DST_PTR(_x, _y) ( buf + _x * 2 + _y * pitch)
|
||||
#define SPANTMP_PIXEL_FMT GL_RGB
|
||||
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
|
||||
|
||||
@@ -124,9 +102,6 @@
|
||||
|
||||
/* 32 bit, ARGB8888 color spanline and pixel functions
|
||||
*/
|
||||
|
||||
#define GET_SRC_PTR(_x, _y) (read_buf + _x * 4 + _y * pitch)
|
||||
#define GET_DST_PTR(_x, _y) ( buf + _x * 4 + _y * pitch)
|
||||
#define SPANTMP_PIXEL_FMT GL_BGRA
|
||||
#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
|
||||
|
||||
@@ -220,6 +195,20 @@ static void mgaDDSetBuffer(GLcontext *ctx, GLframebuffer *buffer,
|
||||
? mmesa->driDrawable : mmesa->driReadable;
|
||||
}
|
||||
|
||||
void mgaSpanRenderStart( GLcontext *ctx )
|
||||
{
|
||||
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
|
||||
FLUSH_BATCH( mmesa );
|
||||
LOCK_HARDWARE_QUIESCENT( mmesa );
|
||||
}
|
||||
|
||||
void mgaSpanRenderFinish( GLcontext *ctx )
|
||||
{
|
||||
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
|
||||
_swrast_flush( ctx );
|
||||
UNLOCK_HARDWARE( mmesa );
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the driver callbacks for the read / write span functions.
|
||||
*
|
||||
@@ -249,7 +238,7 @@ void mgaDDInitSpanFuncs( GLcontext *ctx )
|
||||
case 4:
|
||||
#if 0
|
||||
mgaInitPointers_8888( swdd );
|
||||
|
||||
|
||||
if (!mmesa->hw_stencil) {
|
||||
swdd->ReadDepthSpan = mgaReadDepthSpan_32;
|
||||
swdd->WriteDepthSpan = mgaWriteDepthSpan_32;
|
||||
@@ -269,10 +258,11 @@ void mgaDDInitSpanFuncs( GLcontext *ctx )
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
swdd->SpanRenderStart = mgaSpanRenderStart;
|
||||
swdd->SpanRenderFinish = mgaSpanRenderFinish;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Plug in the Get/Put routines for the given driRenderbuffer.
|
||||
*/
|
||||
|
||||
@@ -839,7 +839,8 @@ static const char * const fallbackStrings[] = {
|
||||
"glRenderMode(selection or feedback)",
|
||||
"No hardware stencil",
|
||||
"glDepthFunc( GL_NEVER )",
|
||||
"Mixing GL_CLAMP_TO_EDGE and GL_CLAMP"
|
||||
"Mixing GL_CLAMP_TO_EDGE and GL_CLAMP",
|
||||
"rasterization fallback option"
|
||||
};
|
||||
|
||||
static const char *getFallbackString(GLuint bit)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user