Compare commits
237 Commits
mesa_7_1_r
...
mesa_7_1_r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d762e1613 | ||
|
|
35479fd4b4 | ||
|
|
7970b2a908 | ||
|
|
c0dd9122fd | ||
|
|
ce00d232f3 | ||
|
|
db1103ebe8 | ||
|
|
1f4997c2aa | ||
|
|
1b39b92e6d | ||
|
|
37f452096b | ||
|
|
2e79b491fc | ||
|
|
57acb0fad9 | ||
|
|
505606349e | ||
|
|
b9c6f2b133 | ||
|
|
60b92129b1 | ||
|
|
f911ca0834 | ||
|
|
98e7c1cf38 | ||
|
|
c61f4e2cce | ||
|
|
8c51e0002a | ||
|
|
7536f39622 | ||
|
|
d80d0bb4d6 | ||
|
|
3a428aca93 | ||
|
|
ac0d19601c | ||
|
|
1724334d7c | ||
|
|
53675e5c05 | ||
|
|
d2796939f1 | ||
|
|
527e1cf172 | ||
|
|
501338d70e | ||
|
|
919ec22ecf | ||
|
|
ec770150ed | ||
|
|
01ac4540f0 | ||
|
|
ee8dfdf4c9 | ||
|
|
523ee3ddbe | ||
|
|
5f46093938 | ||
|
|
fb71a48413 | ||
|
|
f1e4ca776f | ||
|
|
c20a173656 | ||
|
|
8e8019b49a | ||
|
|
a3024caff1 | ||
|
|
62fb5f7b9a | ||
|
|
61b3ce8f97 | ||
|
|
ded9414024 | ||
|
|
e9bf3e4cc9 | ||
|
|
c9120a0d19 | ||
|
|
3e8e292db0 | ||
|
|
b068ab62a0 | ||
|
|
1bdb134570 | ||
|
|
40f7e5f674 | ||
|
|
ff916d718a | ||
|
|
016701f686 | ||
|
|
b26a80aa12 | ||
|
|
a7dd701421 | ||
|
|
6045f17138 | ||
|
|
a75015ef03 | ||
|
|
1638edb325 | ||
|
|
6225e51a73 | ||
|
|
d9b6425e00 | ||
|
|
91e1918f48 | ||
|
|
6f1abb9c21 | ||
|
|
1b465f287f | ||
|
|
16dc993d4f | ||
|
|
3d500f00d2 | ||
|
|
56bac7a35c | ||
|
|
5d9b33095a | ||
|
|
d4c73c619a | ||
|
|
01c0558f70 | ||
|
|
fb3422a241 | ||
|
|
7af8dddf27 | ||
|
|
a9412ca2e8 | ||
|
|
b36749d066 | ||
|
|
b7eea9a1ce | ||
|
|
ff9b6a0ae2 | ||
|
|
65db8c9518 | ||
|
|
19d44b95fe | ||
|
|
be50c48101 | ||
|
|
bc985b5790 | ||
|
|
ffbc66bf61 | ||
|
|
74a19b0abd | ||
|
|
38a62ede6c | ||
|
|
378017417a | ||
|
|
f45ed0eb8d | ||
|
|
5bfbcf7265 | ||
|
|
c3ad176158 | ||
|
|
153407f72d | ||
|
|
527e1357b5 | ||
|
|
1a5c99f4b5 | ||
|
|
44c7f37b44 | ||
|
|
b5095ab97f | ||
|
|
57aea290e1 | ||
|
|
c1fb448ce8 | ||
|
|
c117d0efd2 | ||
|
|
e88be7d375 | ||
|
|
322677b878 | ||
|
|
0973d348d7 | ||
|
|
1bdf5e09a0 | ||
|
|
902e401a38 | ||
|
|
85e44fcd51 | ||
|
|
477fa8fe12 | ||
|
|
1e645b3659 | ||
|
|
e5022c3fdf | ||
|
|
ff60e3fa03 | ||
|
|
9bc9e0ecb0 | ||
|
|
04c98089d1 | ||
|
|
d4244683a6 | ||
|
|
94979950e8 | ||
|
|
948f6e302c | ||
|
|
d8ababdcc2 | ||
|
|
51bfb6aa99 | ||
|
|
9a4be9785f | ||
|
|
6118d830a6 | ||
|
|
7c2d7f8cf5 | ||
|
|
9dd73d58ae | ||
|
|
117533759f | ||
|
|
2e37143800 | ||
|
|
d2d5abfaeb | ||
|
|
f0ca917924 | ||
|
|
1c8791c581 | ||
|
|
bdaa06ad63 | ||
|
|
97988ccc46 | ||
|
|
b993d539a7 | ||
|
|
77497eb73b | ||
|
|
99fe0c222c | ||
|
|
776c60d3c3 | ||
|
|
b4b7326717 | ||
|
|
3bfedb7ed4 | ||
|
|
73b8ee4121 | ||
|
|
d9f4d04111 | ||
|
|
f49d345a51 | ||
|
|
0138435643 | ||
|
|
33a25729e8 | ||
|
|
082cde143b | ||
|
|
29cb89d0c2 | ||
|
|
442c195c4a | ||
|
|
7d13dded5c | ||
|
|
b7c54945fe | ||
|
|
ece7183ff1 | ||
|
|
4c6dcbf091 | ||
|
|
e6218d071d | ||
|
|
546c7fb221 | ||
|
|
461e178806 | ||
|
|
716f70d782 | ||
|
|
b0d173f405 | ||
|
|
8c653f6e09 | ||
|
|
7d7d114e59 | ||
|
|
a5f02368d2 | ||
|
|
27e3f7f21d | ||
|
|
67108adb48 | ||
|
|
f214a848ab | ||
|
|
946abd9b5a | ||
|
|
c62cb6be6c | ||
|
|
4430597bf6 | ||
|
|
0a7df3794c | ||
|
|
f7eb0cec69 | ||
|
|
a63b90712a | ||
|
|
62db707a3d | ||
|
|
5e600209f4 | ||
|
|
93115c4b23 | ||
|
|
4fab47b13c | ||
|
|
e81ba58bf4 | ||
|
|
3b8081603b | ||
|
|
db072baaaf | ||
|
|
4f5d97ee9e | ||
|
|
9eee7f260f | ||
|
|
bfb27b5fc0 | ||
|
|
2d766923c4 | ||
|
|
cf0ae102db | ||
|
|
8774fcd89a | ||
|
|
11d711df36 | ||
|
|
b6765c3499 | ||
|
|
d8d086c20b | ||
|
|
7904c9fad4 | ||
|
|
2e841880cf | ||
|
|
b0ef353b46 | ||
|
|
6c44c6d020 | ||
|
|
99803a4ec9 | ||
|
|
e97ab72b59 | ||
|
|
b52398571b | ||
|
|
ac05da56ec | ||
|
|
4ca0af1882 | ||
|
|
a2e435054c | ||
|
|
75e4db1804 | ||
|
|
def6e4f420 | ||
|
|
a995bdced2 | ||
|
|
4b3ed4d2d1 | ||
|
|
19f585a3cf | ||
|
|
e74f54793e | ||
|
|
f059a33022 | ||
|
|
93f701bc36 | ||
|
|
f6abe8f0f2 | ||
|
|
a42dac1879 | ||
|
|
62d66caeba | ||
|
|
0da9bc6a69 | ||
|
|
bbe80af457 | ||
|
|
654258a4fe | ||
|
|
64adeb163d | ||
|
|
e2baf564d1 | ||
|
|
407ce3da3c | ||
|
|
0227d91a9e | ||
|
|
f5d03af109 | ||
|
|
dbf3c5247c | ||
|
|
4b5b008d54 | ||
|
|
fccc427aac | ||
|
|
d8395f9d9e | ||
|
|
924eaa2f95 | ||
|
|
8ba91b4636 | ||
|
|
200fd13d4a | ||
|
|
a74bf4ef34 | ||
|
|
6cefae5354 | ||
|
|
76286bc76c | ||
|
|
8b49cc104d | ||
|
|
cba90d4a77 | ||
|
|
145523ba3a | ||
|
|
0cb006c1fd | ||
|
|
fda5687241 | ||
|
|
68a9161832 | ||
|
|
ead798eb10 | ||
|
|
ab50ddaa91 | ||
|
|
8b2a7f08bc | ||
|
|
c75b2d74d8 | ||
|
|
a2ec8570ae | ||
|
|
42d4f89264 | ||
|
|
96f52f089f | ||
|
|
537bbe6dec | ||
|
|
df4b49c2ce | ||
|
|
e9a2a67745 | ||
|
|
1decab06d1 | ||
|
|
01d1a292bf | ||
|
|
be59d52ca0 | ||
|
|
5290ec4756 | ||
|
|
1f810b85b1 | ||
|
|
87ccc03736 | ||
|
|
367b1e35dc | ||
|
|
81ec0545c9 | ||
|
|
3d19a095cd | ||
|
|
7349f218b4 | ||
|
|
ef33e76ceb | ||
|
|
eb10cdc838 | ||
|
|
89bba44e96 |
13
Makefile
13
Makefile
@@ -174,10 +174,10 @@ ultrix-gcc:
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
DIRECTORY = Mesa-7.1-rc3
|
||||
LIB_NAME = MesaLib-7.1-rc3
|
||||
DEMO_NAME = MesaDemos-7.1-rc3
|
||||
GLUT_NAME = MesaGLUT-7.1-rc3
|
||||
DIRECTORY = Mesa-7.1-rc4
|
||||
LIB_NAME = MesaLib-7.1-rc4
|
||||
DEMO_NAME = MesaDemos-7.1-rc4
|
||||
GLUT_NAME = MesaGLUT-7.1-rc4
|
||||
|
||||
MAIN_FILES = \
|
||||
$(DIRECTORY)/Makefile* \
|
||||
@@ -340,6 +340,8 @@ SGI_GLU_FILES = \
|
||||
$(DIRECTORY)/src/glu/sgi/glu.def \
|
||||
$(DIRECTORY)/src/glu/sgi/dummy.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/sgi/glu.exports \
|
||||
$(DIRECTORY)/src/glu/sgi/glu.exports.darwin \
|
||||
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
|
||||
$(DIRECTORY)/src/glu/sgi/include/gluos.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \
|
||||
@@ -395,7 +397,8 @@ DEMO_FILES = \
|
||||
$(DIRECTORY)/progs/samples/*.c \
|
||||
$(DIRECTORY)/progs/glsl/Makefile* \
|
||||
$(DIRECTORY)/progs/glsl/*.c \
|
||||
$(DIRECTORY)/progs/glsl/*.txt \
|
||||
$(DIRECTORY)/progs/glsl/*.frag \
|
||||
$(DIRECTORY)/progs/glsl/*.vert \
|
||||
$(DIRECTORY)/progs/windml/Makefile.ugl \
|
||||
$(DIRECTORY)/progs/windml/*.c \
|
||||
$(DIRECTORY)/progs/windml/*.bmp \
|
||||
|
||||
22
bin/mklib
22
bin/mklib
@@ -43,7 +43,7 @@ ARCH="auto"
|
||||
ARCHOPT=""
|
||||
NOPREFIX=0
|
||||
EXPORTS=""
|
||||
|
||||
ID=""
|
||||
|
||||
#
|
||||
# Parse arguments
|
||||
@@ -75,6 +75,7 @@ do
|
||||
echo ' -altopts OPTS alternate options to override all others'
|
||||
echo " -noprefix don't prefix library name with 'lib' nor add any suffix"
|
||||
echo ' -exports FILE only export the symbols listed in FILE'
|
||||
echo ' -id NAME Sets the id of the dylib (Darwin)'
|
||||
echo ' -h, --help display this information and exit'
|
||||
exit 1
|
||||
;;
|
||||
@@ -153,6 +154,10 @@ do
|
||||
shift 1;
|
||||
EXPORTS=$1
|
||||
;;
|
||||
'-id')
|
||||
shift 1;
|
||||
ID=$1
|
||||
;;
|
||||
-*)
|
||||
echo "mklib: Unknown option: " $1 ;
|
||||
exit 1
|
||||
@@ -196,6 +201,7 @@ if [ ] ; then
|
||||
echo PATCH is $PATCH
|
||||
echo DEPS are $DEPS
|
||||
echo "EXPORTS in" $EXPORTS
|
||||
echo ID is $ID
|
||||
echo "-----------------"
|
||||
fi
|
||||
|
||||
@@ -271,7 +277,7 @@ case $ARCH in
|
||||
if [ $EXPORTS ] ; then
|
||||
#OPTS="${OPTS} -Xlinker --retain-symbols-file ${EXPORTS}"
|
||||
# Make the 'exptmp' file for --version-script option
|
||||
echo "VERSION_${MAJOR}.${MINOR} {" > exptmp
|
||||
echo "{" > exptmp
|
||||
echo "global:" >> exptmp
|
||||
sed 's/$/;/' ${EXPORTS} >> exptmp
|
||||
echo "local:" >> exptmp
|
||||
@@ -630,13 +636,19 @@ case $ARCH in
|
||||
LIBSUFFIX="bundle"
|
||||
OPTS="${ARCHOPT} -bundle -multiply_defined suppress"
|
||||
else
|
||||
LIBSUFFIX="dylib"
|
||||
OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
|
||||
LIBSUFFIX="dylib"
|
||||
if [ -z "$ID" ] ; then
|
||||
ID="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
|
||||
fi
|
||||
OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name ${ID}"
|
||||
fi
|
||||
|
||||
if [ ${EXPORTS} ] ; then
|
||||
if [ -f ${EXPORTS}".darwin" ] ; then
|
||||
EXPORTS=$EXPORTS".darwin"
|
||||
fi
|
||||
OPTS="${OPTS} -exported_symbols_list ${EXPORTS}"
|
||||
fi
|
||||
fi
|
||||
|
||||
LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
|
||||
LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}"
|
||||
|
||||
@@ -27,10 +27,10 @@ ASM_API = @ASM_API@
|
||||
|
||||
# Misc tools and flags
|
||||
MAKE = @MAKE@
|
||||
SHELL = @SHELL@
|
||||
MKLIB_OPTIONS = @MKLIB_OPTIONS@
|
||||
MKDEP = @MKDEP@
|
||||
MKDEP_OPTIONS = @MKDEP_OPTIONS@
|
||||
INSTALL = $(TOP)/bin/minstall
|
||||
|
||||
# Python and flags (generally only needed by the developers)
|
||||
PYTHON2 = python
|
||||
@@ -66,6 +66,10 @@ USING_EGL = @USING_EGL@
|
||||
# Dependencies
|
||||
X11_INCLUDES = @X11_INCLUDES@
|
||||
|
||||
# GLw motif setup
|
||||
GLW_SOURCES = @GLW_SOURCES@
|
||||
MOTIF_CFLAGS = @MOTIF_CFLAGS@
|
||||
|
||||
# Library/program dependencies
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) @GL_LIB_DEPS@
|
||||
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
|
||||
@@ -101,6 +105,3 @@ DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@
|
||||
|
||||
# Where libGL will look for DRI hardware drivers
|
||||
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
|
||||
|
||||
# Additional per-platform configuration settings
|
||||
@EXTRA_CONFIG_LINES@
|
||||
|
||||
@@ -4,22 +4,26 @@ include $(TOP)/configs/default
|
||||
|
||||
CONFIG_NAME = darwin
|
||||
|
||||
DEFINES = -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \
|
||||
-D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE \
|
||||
-DPTHREADS -DGLX_ALIAS_UNSUPPORTED -DGLX_INDIRECT_RENDERING
|
||||
INSTALL_DIR = /usr/X11
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = gcc
|
||||
CFLAGS = -I/usr/X11/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin $(DEFINES)
|
||||
CXXFLAGS = -I/usr/X11/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin $(DEFINES)
|
||||
PIC_FLAGS = -fPIC
|
||||
DEFINES = -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \
|
||||
-D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS \
|
||||
-DGLX_INDIRECT_RENDERING \
|
||||
-DGLX_ALIAS_UNSUPPORTED
|
||||
|
||||
CFLAGS += $(RC_CFLAGS)
|
||||
CXXFLAGS += $(RC_CFLAGS)
|
||||
# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx/x11
|
||||
# -DIN_DRI_DRIVER
|
||||
|
||||
# Work around aliasing bugs - developers should comment this out
|
||||
CFLAGS += -fno-strict-aliasing
|
||||
CXXFLAGS += -fno-strict-aliasing
|
||||
ARCH_FLAGS += $(RC_CFLAGS)
|
||||
|
||||
CFLAGS = -g -O2 -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \
|
||||
-I$(INSTALL_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
|
||||
CXXFLAGS = -g -O2 -Wall -fno-strict-aliasing \
|
||||
-I$(INSTALL_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = libGL.dylib
|
||||
@@ -28,13 +32,24 @@ GLUT_LIB_NAME = libglut.dylib
|
||||
GLW_LIB_NAME = libGLw.dylib
|
||||
OSMESA_LIB_NAME = libOSMesa.dylib
|
||||
|
||||
GL_LIB_DEPS = -L/usr/X11/lib -lX11 -lXext -lm -lpthread
|
||||
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL
|
||||
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL
|
||||
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL -lGLU -L/usr/X11R6/lib -lX11 -lXmu -lXi -lXext
|
||||
GLW_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXt $(TOP)/lib/GL.dylib
|
||||
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
# globs used to install the lib and all symlinks
|
||||
GL_LIB_GLOB = libGL.*dylib
|
||||
GLU_LIB_GLOB = libGLU.*dylib
|
||||
GLUT_LIB_GLOB = libglut.*dylib
|
||||
GLW_LIB_GLOB = libGLw.*dylib
|
||||
OSMESA_LIB_GLOB = libOSMesa.*dylib
|
||||
|
||||
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
|
||||
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
|
||||
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
|
||||
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
|
||||
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXt
|
||||
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
|
||||
|
||||
# omit glw lib for now:
|
||||
SRC_DIRS = glx/x11 glu glut/glx mesa
|
||||
SRC_DIRS = glx/x11 mesa glu glw glut/glx
|
||||
GLU_DIRS = sgi
|
||||
DRIVER_DIRS = osmesa
|
||||
#DRIVER_DIRS = dri
|
||||
DRI_DIRS = swrast
|
||||
PROGRAM_DIRS = xdemos
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
# Configuration for Darwin / MacOS X, making static libs
|
||||
|
||||
include $(TOP)/configs/darwin
|
||||
|
||||
CONFIG_NAME = darwin-static
|
||||
|
||||
# Compiler and flags
|
||||
CFLAGS = -I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
|
||||
CXXFLAGS = -I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
|
||||
MKLIB_OPTIONS = -static
|
||||
|
||||
# Work around aliasing bugs - developers should comment this out
|
||||
CFLAGS += -fno-strict-aliasing
|
||||
CXXFLAGS += -fno-strict-aliasing
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = libGL.a
|
||||
GLU_LIB_NAME = libGLU.a
|
||||
GLUT_LIB_NAME = libglut.a
|
||||
GLW_LIB_NAME = libGLw.a
|
||||
OSMESA_LIB_NAME = libOSMesa.a
|
||||
|
||||
GL_LIB_DEPS =
|
||||
OSMESA_LIB_DEPS =
|
||||
GLU_LIB_DEPS =
|
||||
GLUT_LIB_DEPS =
|
||||
GLW_LIB_DEPS =
|
||||
APP_LIB_DEPS = -Wl,-search_paths_first -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lstdc++ -lgcc_s.1 -lm
|
||||
@@ -1,30 +0,0 @@
|
||||
# Configuration for Darwin / MacOS X, making static libs
|
||||
|
||||
include $(TOP)/configs/darwin
|
||||
|
||||
CONFIG_NAME = darwin-static
|
||||
|
||||
# Compiler and flags
|
||||
CFLAGS = -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
|
||||
CXXFLAGS = -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
|
||||
MKLIB_OPTIONS = -static -archopt "-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
|
||||
|
||||
# Work around aliasing bugs - developers should comment this out
|
||||
CFLAGS += -fno-strict-aliasing
|
||||
CXXFLAGS += -fno-strict-aliasing
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = libGL.a
|
||||
GLU_LIB_NAME = libGLU.a
|
||||
GLUT_LIB_NAME = libglut.a
|
||||
GLW_LIB_NAME = libGLw.a
|
||||
OSMESA_LIB_NAME = libOSMesa.a
|
||||
|
||||
GL_LIB_DEPS =
|
||||
OSMESA_LIB_DEPS =
|
||||
GLU_LIB_DEPS =
|
||||
GLUT_LIB_DEPS =
|
||||
GLW_LIB_DEPS =
|
||||
APP_LIB_DEPS = -Wl,-search_paths_first -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lstdc++ -lgcc_s.1 -lm
|
||||
@@ -25,11 +25,13 @@ LDFLAGS =
|
||||
GLU_CFLAGS =
|
||||
|
||||
# Misc tools and flags
|
||||
SHELL = /bin/sh
|
||||
MKLIB = $(SHELL) $(TOP)/bin/mklib
|
||||
MKLIB_OPTIONS =
|
||||
MKDEP = makedepend
|
||||
MKDEP_OPTIONS = -fdepend
|
||||
MAKE = make
|
||||
INSTALL = $(TOP)/bin/minstall
|
||||
INSTALL = $(SHELL) $(TOP)/bin/minstall
|
||||
|
||||
# Tools for regenerating glapi (generally only needed by the developers)
|
||||
PYTHON2 = python
|
||||
@@ -52,6 +54,12 @@ GLUT_LIB_NAME = lib$(GLUT_LIB).so
|
||||
GLW_LIB_NAME = lib$(GLW_LIB).so
|
||||
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
|
||||
|
||||
# globs used to install the lib and all symlinks
|
||||
GL_LIB_GLOB = $(GL_LIB_NAME)*
|
||||
GLU_LIB_GLOB = $(GLU_LIB_NAME)*
|
||||
GLUT_LIB_GLOB = $(GLUT_LIB_NAME)*
|
||||
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
|
||||
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
|
||||
|
||||
# Optional assembly language optimization files for libGL
|
||||
ASM_SOURCES =
|
||||
@@ -59,6 +67,7 @@ ASM_SOURCES =
|
||||
# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in
|
||||
# order to build the Motif widget too)
|
||||
GLW_SOURCES = GLwDrawA.c
|
||||
MOTIF_CFLAGS = -I/usr/include/Motif1.2
|
||||
|
||||
|
||||
# Directories to build
|
||||
|
||||
@@ -70,4 +70,4 @@ WINDOW_SYSTEM=dri
|
||||
# gamma are missing because they have not been converted to use the new
|
||||
# interface.
|
||||
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
|
||||
savage sis tdfx trident unichrome ffb nouveau
|
||||
savage sis tdfx trident unichrome ffb
|
||||
|
||||
69
configure.ac
69
configure.ac
@@ -12,6 +12,10 @@ m4_ifval(mesa_version,[],[
|
||||
m4_exit([1])
|
||||
])
|
||||
|
||||
dnl Tell the user about autoconf.html in the --help output
|
||||
m4_divert_once([HELP_END], [
|
||||
See docs/autoconf.html for more details on the options for Mesa.])
|
||||
|
||||
AC_INIT([Mesa],[mesa_version],
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
|
||||
AC_CONFIG_AUX_DIR([bin])
|
||||
@@ -29,18 +33,16 @@ AC_CHECK_PROGS([MAKE], [gmake make])
|
||||
AC_PATH_PROG([MKDEP], [makedepend])
|
||||
AC_PATH_PROG([SED], [sed])
|
||||
|
||||
dnl Platform-specific program settings
|
||||
EXTRA_CONFIG_LINES=""
|
||||
AC_SUBST([EXTRA_CONFIG_LINES])
|
||||
dnl We need a POSIX shell for parts of the build. Assume we have one
|
||||
dnl in most cases.
|
||||
case "$host_os" in
|
||||
solaris*)
|
||||
# Solaris /bin/sh is too old/non-POSIX compliant
|
||||
AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
|
||||
EXTRA_CONFIG_LINES="SHELL=$POSIX_SHELL"
|
||||
SHELL="$POSIX_SHELL"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
MKDEP_OPTIONS=-fdepend
|
||||
dnl Ask gcc where it's keeping its secret headers
|
||||
if test "x$GCC" = xyes; then
|
||||
@@ -452,7 +454,7 @@ esac
|
||||
|
||||
dnl
|
||||
dnl Find out if X is available. The variable have_x is set if libX11 is
|
||||
dnl to mimic AC_PATH_XTRA.
|
||||
dnl found to mimic AC_PATH_XTRA.
|
||||
dnl
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
AC_MSG_CHECKING([pkg-config files for X11 are available])
|
||||
@@ -471,6 +473,12 @@ if test "$x11_pkgconfig" = no; then
|
||||
AC_PATH_XTRA
|
||||
fi
|
||||
|
||||
dnl Try to tell the user that the --x-* options are only used when
|
||||
dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
|
||||
m4_divert_once([HELP_BEGIN],
|
||||
[These options are only used when the X libraries cannot be found by the
|
||||
pkg-config utility.])
|
||||
|
||||
dnl We need X for xlib and dri, so bomb now if it's not found
|
||||
case "$mesa_driver" in
|
||||
xlib|dri)
|
||||
@@ -616,7 +624,10 @@ dnl If $with_dri_drivers is yes, directories will be added through
|
||||
dnl platform checks
|
||||
DRI_DIRS=""
|
||||
case "$with_dri_drivers" in
|
||||
no|yes) ;;
|
||||
no) ;;
|
||||
yes)
|
||||
DRI_DIRS="yes"
|
||||
;;
|
||||
*)
|
||||
# verify the requested driver directories exist
|
||||
dri_drivers=`IFS=', '; echo $with_dri_drivers`
|
||||
@@ -662,7 +673,7 @@ if test "$mesa_driver" = dri; then
|
||||
# converted to use the new interface. i810 are missing
|
||||
# because there is no x86-64 system where they could *ever*
|
||||
# be used.
|
||||
if test "x$DRI_DIRS" = x; then
|
||||
if test "x$DRI_DIRS" = "xyes"; then
|
||||
DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 radeon \
|
||||
savage tdfx unichrome swrast"
|
||||
fi
|
||||
@@ -670,13 +681,13 @@ if test "$mesa_driver" = dri; then
|
||||
powerpc*)
|
||||
# Build only the drivers for cards that exist on PowerPC.
|
||||
# At some point MGA will be added, but not yet.
|
||||
if test "x$DRI_DIRS" = x; then
|
||||
if test "x$DRI_DIRS" = "xyes"; then
|
||||
DRI_DIRS="mach64 r128 r200 r300 radeon tdfx swrast"
|
||||
fi
|
||||
;;
|
||||
sparc*)
|
||||
# Build only the drivers for cards that exist on sparc`
|
||||
if test "x$DRI_DIRS" = x; then
|
||||
if test "x$DRI_DIRS" = "xyes"; then
|
||||
DRI_DIRS="mach64 r128 r200 r300 radeon ffb swrast"
|
||||
fi
|
||||
;;
|
||||
@@ -695,7 +706,7 @@ if test "$mesa_driver" = dri; then
|
||||
|
||||
# ffb and gamma are missing because they have not been converted
|
||||
# to use the new interface.
|
||||
if test "x$DRI_DIRS" = x; then
|
||||
if test "x$DRI_DIRS" = "xyes"; then
|
||||
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \
|
||||
unichrome savage sis swrast"
|
||||
fi
|
||||
@@ -710,7 +721,7 @@ if test "$mesa_driver" = dri; then
|
||||
esac
|
||||
|
||||
# default drivers
|
||||
if test "x$DRI_DIRS" = x; then
|
||||
if test "x$DRI_DIRS" = "xyes"; then
|
||||
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
|
||||
savage sis tdfx trident unichrome ffb swrast"
|
||||
fi
|
||||
@@ -870,6 +881,12 @@ if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
|
||||
AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
|
||||
enable_glw=no
|
||||
fi
|
||||
AC_ARG_ENABLE([motif],
|
||||
[AS_HELP_STRING([--enable-motif],
|
||||
[use Motif widgets in GLw @<:@default=disabled@:>@])],
|
||||
[enable_motif="$enableval"],
|
||||
[enable_motif=no])
|
||||
|
||||
if test "x$enable_glw" = xyes; then
|
||||
SRC_DIRS="$SRC_DIRS glw"
|
||||
if test "$x11_pkgconfig" = yes; then
|
||||
@@ -877,7 +894,25 @@ if test "x$enable_glw" = xyes; then
|
||||
GLW_LIB_DEPS="$GLW_LIBS"
|
||||
else
|
||||
# should check these...
|
||||
GLW_LIB_DEPS="$X_LIBS -lX11 -lXt"
|
||||
GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
|
||||
fi
|
||||
|
||||
GLW_SOURCES="GLwDrawA.c"
|
||||
MOTIF_CFLAGS=
|
||||
if test "x$enable_motif" = xyes; then
|
||||
GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c"
|
||||
AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
|
||||
if test "x$MOTIF_CONFIG" != xno; then
|
||||
MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
|
||||
MOTIF_LIBS=`$MOTIF_CONFIG --libs`
|
||||
else
|
||||
AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
|
||||
[AC_MSG_ERROR([Can't locate Motif headers])])
|
||||
AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
|
||||
[AC_MSG_ERROR([Can't locate Motif Xm library])])
|
||||
fi
|
||||
# MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
|
||||
GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
|
||||
fi
|
||||
|
||||
# If static, empty GLW_LIB_DEPS and add libs for programs to link
|
||||
@@ -892,6 +927,8 @@ if test "x$enable_glw" = xyes; then
|
||||
fi
|
||||
AC_SUBST([GLW_LIB_DEPS])
|
||||
AC_SUBST([GLW_MESA_DEPS])
|
||||
AC_SUBST([GLW_SOURCES])
|
||||
AC_SUBST([MOTIF_CFLAGS])
|
||||
|
||||
dnl
|
||||
dnl GLUT configuration
|
||||
@@ -1007,7 +1044,11 @@ fi
|
||||
if test "$mesa_driver" = dri; then
|
||||
# cleanup the drivers var
|
||||
dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
|
||||
if test "x$DRI_DIRS" = x; then
|
||||
echo " DRI drivers: no"
|
||||
else
|
||||
echo " DRI drivers: $dri_dirs"
|
||||
fi
|
||||
echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
|
||||
echo " TTM API support: $ttmapi"
|
||||
fi
|
||||
@@ -1017,7 +1058,7 @@ echo ""
|
||||
echo " Shared libs: $enable_shared"
|
||||
echo " Static libs: $enable_static"
|
||||
echo " GLU: $enable_glu"
|
||||
echo " GLw: $enable_glw"
|
||||
echo " GLw: $enable_glw (Motif: $enable_motif)"
|
||||
echo " glut: $enable_glut"
|
||||
|
||||
dnl Programs
|
||||
|
||||
@@ -35,7 +35,7 @@ TBD
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<ul>
|
||||
<li>Fixed a number of minor GLSL intrinsic function/constructor bugs
|
||||
<li>Numerous GLSL fixes
|
||||
<li>Fixed some error code/detection bugs in the GLSL-related API functions
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -25,9 +25,10 @@ Contents
|
||||
<li><a href="#unsup">Unsupported Features</a>
|
||||
<li><a href="#notes">Implementation Notes</a>
|
||||
<li><a href="#hints">Programming Hints</a>
|
||||
<li><a href="#standalone">Stand-alone Compiler</a>
|
||||
<li><a href="#standalone">Stand-alone GLSL Compiler</a>
|
||||
<li><a href="#implementation">Compiler Implementation</a>
|
||||
<li><a href="#validation">Compiler Validation</a>
|
||||
<li><a href="#120">GLSL 1.20 support</a>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -133,7 +134,7 @@ These issues will be addressed/resolved in the future.
|
||||
|
||||
|
||||
<a name="standalone">
|
||||
<h2>Stand-alone Compiler</h2>
|
||||
<h2>Stand-alone GLSL Compiler</h2>
|
||||
|
||||
<p>
|
||||
A unique stand-alone GLSL compiler driver has been added to Mesa.
|
||||
@@ -155,12 +156,10 @@ This tool is useful for:
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
To build the glslcompiler program (this will be improved someday):
|
||||
After building Mesa, the glslcompiler can be built by manually running:
|
||||
</p>
|
||||
<pre>
|
||||
cd src/mesa
|
||||
make libmesa.a
|
||||
cd drivers/glslcompiler
|
||||
cd src/mesa/drivers/glslcompiler
|
||||
make
|
||||
</pre>
|
||||
|
||||
@@ -170,20 +169,31 @@ Here's an example of using the compiler to compile a vertex shader and
|
||||
emit GL_ARB_vertex_program-style instructions:
|
||||
</p>
|
||||
<pre>
|
||||
glslcompiler --arb --linenumbers --vs vertshader.txt
|
||||
bin/glslcompiler --debug --numbers --fs progs/glsl/CH06-brick.frag.txt
|
||||
</pre>
|
||||
<p>
|
||||
The output may look similar to this:
|
||||
results in:
|
||||
</p>
|
||||
<pre>
|
||||
!!ARBvp1.0
|
||||
0: MOV result.texcoord[0], vertex.texcoord[0];
|
||||
1: DP4 temp0.x, state.matrix.mvp.row[0], vertex.position;
|
||||
2: DP4 temp0.y, state.matrix.mvp.row[1], vertex.position;
|
||||
3: DP4 temp0.z, state.matrix.mvp.row[2], vertex.position;
|
||||
4: DP4 temp0.w, state.matrix.mvp.row[3], vertex.position;
|
||||
5: MOV result.position, temp0;
|
||||
6: END
|
||||
# Fragment Program/Shader
|
||||
0: RCP TEMP[4].x, UNIFORM[2].xxxx;
|
||||
1: RCP TEMP[4].y, UNIFORM[2].yyyy;
|
||||
2: MUL TEMP[3].xy, VARYING[0], TEMP[4];
|
||||
3: MOV TEMP[1], TEMP[3];
|
||||
4: MUL TEMP[0].w, TEMP[1].yyyy, CONST[4].xxxx;
|
||||
5: FRC TEMP[1].z, TEMP[0].wwww;
|
||||
6: SGT.C TEMP[0].w, TEMP[1].zzzz, CONST[4].xxxx;
|
||||
7: IF (NE.wwww); # (if false, goto 9);
|
||||
8: ADD TEMP[1].x, TEMP[1].xxxx, CONST[4].xxxx;
|
||||
9: ENDIF;
|
||||
10: FRC TEMP[1].xy, TEMP[1];
|
||||
11: SGT TEMP[2].xy, UNIFORM[3], TEMP[1];
|
||||
12: MUL TEMP[1].z, TEMP[2].xxxx, TEMP[2].yyyy;
|
||||
13: LRP TEMP[0], TEMP[1].zzzz, UNIFORM[0], UNIFORM[1];
|
||||
14: MUL TEMP[0].xyz, TEMP[0], VARYING[1].xxxx;
|
||||
15: MOV OUTPUT[0].xyz, TEMP[0];
|
||||
16: MOV OUTPUT[0].w, CONST[4].yyyy;
|
||||
17: END
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -309,5 +319,39 @@ should be added.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<a name="120">
|
||||
<h2>GLSL 1.20 support</h2>
|
||||
|
||||
<p>
|
||||
Support for GLSL version 1.20 is underway. Status as follows.
|
||||
</p>
|
||||
|
||||
<h3>Supported</h3>
|
||||
<ul>
|
||||
<li><code>mat2x3, mat2x4</code>, etc. types and functions
|
||||
<li><code>transpose(), outerProduct(), matrixCompMult()</code> functions
|
||||
(but untested)
|
||||
<li>precision qualifiers (lowp, mediump, highp)
|
||||
</ul>
|
||||
|
||||
<h3>Partially Complete</h3>
|
||||
<ul>
|
||||
<li><code>invariant</code> qualifier
|
||||
</ul>
|
||||
|
||||
<h3>Not Completed</h3>
|
||||
<ul>
|
||||
<li><code>array.length()</code> method
|
||||
<li><code>float[5] a;</code> array syntax
|
||||
<li><code>centroid</code> qualifier
|
||||
<li>unsized array constructors
|
||||
<li>initializers for uniforms
|
||||
<li>const initializers calling built-in functions
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -46,9 +46,9 @@ extern "C" {
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glext.h last updated 2008/03/24 */
|
||||
/* glext.h last updated 2008/08/10 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GL_GLEXT_VERSION 40
|
||||
#define GL_GLEXT_VERSION 41
|
||||
|
||||
#ifndef GL_VERSION_1_2
|
||||
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
|
||||
@@ -479,6 +479,117 @@ extern "C" {
|
||||
#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_3_0
|
||||
#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB
|
||||
#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0
|
||||
#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1
|
||||
#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2
|
||||
#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3
|
||||
#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4
|
||||
#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5
|
||||
#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES
|
||||
#define GL_MAJOR_VERSION 0x821B
|
||||
#define GL_MINOR_VERSION 0x821C
|
||||
#define GL_NUM_EXTENSIONS 0x821D
|
||||
#define GL_CONTEXT_FLAGS 0x821E
|
||||
#define GL_DEPTH_BUFFER 0x8223
|
||||
#define GL_STENCIL_BUFFER 0x8224
|
||||
#define GL_COMPRESSED_RED 0x8225
|
||||
#define GL_COMPRESSED_RG 0x8226
|
||||
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
|
||||
#define GL_RGBA32F 0x8814
|
||||
#define GL_RGB32F 0x8815
|
||||
#define GL_RGBA16F 0x881A
|
||||
#define GL_RGB16F 0x881B
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
|
||||
#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
|
||||
#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
|
||||
#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
|
||||
#define GL_CLAMP_VERTEX_COLOR 0x891A
|
||||
#define GL_CLAMP_FRAGMENT_COLOR 0x891B
|
||||
#define GL_CLAMP_READ_COLOR 0x891C
|
||||
#define GL_FIXED_ONLY 0x891D
|
||||
#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS
|
||||
#define GL_TEXTURE_RED_TYPE 0x8C10
|
||||
#define GL_TEXTURE_GREEN_TYPE 0x8C11
|
||||
#define GL_TEXTURE_BLUE_TYPE 0x8C12
|
||||
#define GL_TEXTURE_ALPHA_TYPE 0x8C13
|
||||
#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
|
||||
#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
|
||||
#define GL_TEXTURE_DEPTH_TYPE 0x8C16
|
||||
#define GL_UNSIGNED_NORMALIZED 0x8C17
|
||||
#define GL_TEXTURE_1D_ARRAY 0x8C18
|
||||
#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
|
||||
#define GL_TEXTURE_2D_ARRAY 0x8C1A
|
||||
#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
|
||||
#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
|
||||
#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
|
||||
#define GL_R11F_G11F_B10F 0x8C3A
|
||||
#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
|
||||
#define GL_RGB9_E5 0x8C3D
|
||||
#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
|
||||
#define GL_TEXTURE_SHARED_SIZE 0x8C3F
|
||||
#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
|
||||
#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
|
||||
#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
|
||||
#define GL_PRIMITIVES_GENERATED 0x8C87
|
||||
#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
|
||||
#define GL_RASTERIZER_DISCARD 0x8C89
|
||||
#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
|
||||
#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
|
||||
#define GL_INTERLEAVED_ATTRIBS 0x8C8C
|
||||
#define GL_SEPARATE_ATTRIBS 0x8C8D
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
|
||||
#define GL_RGBA32UI 0x8D70
|
||||
#define GL_RGB32UI 0x8D71
|
||||
#define GL_RGBA16UI 0x8D76
|
||||
#define GL_RGB16UI 0x8D77
|
||||
#define GL_RGBA8UI 0x8D7C
|
||||
#define GL_RGB8UI 0x8D7D
|
||||
#define GL_RGBA32I 0x8D82
|
||||
#define GL_RGB32I 0x8D83
|
||||
#define GL_RGBA16I 0x8D88
|
||||
#define GL_RGB16I 0x8D89
|
||||
#define GL_RGBA8I 0x8D8E
|
||||
#define GL_RGB8I 0x8D8F
|
||||
#define GL_RED_INTEGER 0x8D94
|
||||
#define GL_GREEN_INTEGER 0x8D95
|
||||
#define GL_BLUE_INTEGER 0x8D96
|
||||
#define GL_ALPHA_INTEGER 0x8D97
|
||||
#define GL_RGB_INTEGER 0x8D98
|
||||
#define GL_RGBA_INTEGER 0x8D99
|
||||
#define GL_BGR_INTEGER 0x8D9A
|
||||
#define GL_BGRA_INTEGER 0x8D9B
|
||||
#define GL_SAMPLER_1D_ARRAY 0x8DC0
|
||||
#define GL_SAMPLER_2D_ARRAY 0x8DC1
|
||||
#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
|
||||
#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
|
||||
#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
|
||||
#define GL_UNSIGNED_INT_VEC2 0x8DC6
|
||||
#define GL_UNSIGNED_INT_VEC3 0x8DC7
|
||||
#define GL_UNSIGNED_INT_VEC4 0x8DC8
|
||||
#define GL_INT_SAMPLER_1D 0x8DC9
|
||||
#define GL_INT_SAMPLER_2D 0x8DCA
|
||||
#define GL_INT_SAMPLER_3D 0x8DCB
|
||||
#define GL_INT_SAMPLER_CUBE 0x8DCC
|
||||
#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
|
||||
#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
|
||||
#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
|
||||
#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
|
||||
#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
|
||||
#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
|
||||
#define GL_QUERY_WAIT 0x8E13
|
||||
#define GL_QUERY_NO_WAIT 0x8E14
|
||||
#define GL_QUERY_BY_REGION_WAIT 0x8E15
|
||||
#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_multitexture
|
||||
#define GL_TEXTURE0_ARB 0x84C0
|
||||
#define GL_TEXTURE1_ARB 0x84C1
|
||||
@@ -974,6 +1085,175 @@ extern "C" {
|
||||
#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_depth_buffer_float
|
||||
#define GL_DEPTH_COMPONENT32F 0x8CAC
|
||||
#define GL_DEPTH32F_STENCIL8 0x8CAD
|
||||
#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_draw_instanced
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_framebuffer_object
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
|
||||
#define GL_FRAMEBUFFER_DEFAULT 0x8218
|
||||
#define GL_FRAMEBUFFER_UNDEFINED 0x8219
|
||||
#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
|
||||
#define GL_INDEX 0x8222
|
||||
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
|
||||
#define GL_DEPTH_STENCIL 0x84F9
|
||||
#define GL_UNSIGNED_INT_24_8 0x84FA
|
||||
#define GL_DEPTH24_STENCIL8 0x88F0
|
||||
#define GL_TEXTURE_STENCIL_SIZE 0x88F1
|
||||
#define GL_FRAMEBUFFER_BINDING 0x8CA6
|
||||
#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
|
||||
#define GL_RENDERBUFFER_BINDING 0x8CA7
|
||||
#define GL_READ_FRAMEBUFFER 0x8CA8
|
||||
#define GL_DRAW_FRAMEBUFFER 0x8CA9
|
||||
#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
|
||||
#define GL_RENDERBUFFER_SAMPLES 0x8CAB
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
|
||||
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
|
||||
#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
|
||||
#define GL_COLOR_ATTACHMENT0 0x8CE0
|
||||
#define GL_COLOR_ATTACHMENT1 0x8CE1
|
||||
#define GL_COLOR_ATTACHMENT2 0x8CE2
|
||||
#define GL_COLOR_ATTACHMENT3 0x8CE3
|
||||
#define GL_COLOR_ATTACHMENT4 0x8CE4
|
||||
#define GL_COLOR_ATTACHMENT5 0x8CE5
|
||||
#define GL_COLOR_ATTACHMENT6 0x8CE6
|
||||
#define GL_COLOR_ATTACHMENT7 0x8CE7
|
||||
#define GL_COLOR_ATTACHMENT8 0x8CE8
|
||||
#define GL_COLOR_ATTACHMENT9 0x8CE9
|
||||
#define GL_COLOR_ATTACHMENT10 0x8CEA
|
||||
#define GL_COLOR_ATTACHMENT11 0x8CEB
|
||||
#define GL_COLOR_ATTACHMENT12 0x8CEC
|
||||
#define GL_COLOR_ATTACHMENT13 0x8CED
|
||||
#define GL_COLOR_ATTACHMENT14 0x8CEE
|
||||
#define GL_COLOR_ATTACHMENT15 0x8CEF
|
||||
#define GL_DEPTH_ATTACHMENT 0x8D00
|
||||
#define GL_STENCIL_ATTACHMENT 0x8D20
|
||||
#define GL_FRAMEBUFFER 0x8D40
|
||||
#define GL_RENDERBUFFER 0x8D41
|
||||
#define GL_RENDERBUFFER_WIDTH 0x8D42
|
||||
#define GL_RENDERBUFFER_HEIGHT 0x8D43
|
||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
|
||||
#define GL_STENCIL_INDEX1 0x8D46
|
||||
#define GL_STENCIL_INDEX4 0x8D47
|
||||
#define GL_STENCIL_INDEX8 0x8D48
|
||||
#define GL_STENCIL_INDEX16 0x8D49
|
||||
#define GL_RENDERBUFFER_RED_SIZE 0x8D50
|
||||
#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
|
||||
#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
|
||||
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
|
||||
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
|
||||
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
|
||||
#define GL_MAX_SAMPLES 0x8D57
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_framebuffer_sRGB
|
||||
#define GL_FRAMEBUFFER_SRGB 0x8DB9
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_geometry_shader4
|
||||
#define GL_LINES_ADJACENCY_ARB 0x000A
|
||||
#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B
|
||||
#define GL_TRIANGLES_ADJACENCY_ARB 0x000C
|
||||
#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D
|
||||
#define GL_PROGRAM_POINT_SIZE_ARB 0x8642
|
||||
#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9
|
||||
#define GL_GEOMETRY_SHADER_ARB 0x8DD9
|
||||
#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA
|
||||
#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB
|
||||
#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC
|
||||
#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD
|
||||
#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE
|
||||
#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
|
||||
#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
|
||||
#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_half_float_vertex
|
||||
#define GL_HALF_FLOAT 0x140B
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_instanced_arrays
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_map_buffer_range
|
||||
#define GL_MAP_READ_BIT 0x0001
|
||||
#define GL_MAP_WRITE_BIT 0x0002
|
||||
#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
|
||||
#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
|
||||
#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
|
||||
#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_buffer_object
|
||||
#define GL_TEXTURE_BUFFER_ARB 0x8C2A
|
||||
#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B
|
||||
#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C
|
||||
#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D
|
||||
#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_compression_rgtc
|
||||
#define GL_COMPRESSED_RED_RGTC1 0x8DBB
|
||||
#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
|
||||
#define GL_COMPRESSED_RG_RGTC2 0x8DBD
|
||||
#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_rg
|
||||
#define GL_RG 0x8227
|
||||
#define GL_RG_INTEGER 0x8228
|
||||
#define GL_R8 0x8229
|
||||
#define GL_R16 0x822A
|
||||
#define GL_RG8 0x822B
|
||||
#define GL_RG16 0x822C
|
||||
#define GL_R16F 0x822D
|
||||
#define GL_R32F 0x822E
|
||||
#define GL_RG16F 0x822F
|
||||
#define GL_RG32F 0x8230
|
||||
#define GL_R8I 0x8231
|
||||
#define GL_R8UI 0x8232
|
||||
#define GL_R16I 0x8233
|
||||
#define GL_R16UI 0x8234
|
||||
#define GL_R32I 0x8235
|
||||
#define GL_R32UI 0x8236
|
||||
#define GL_RG8I 0x8237
|
||||
#define GL_RG8UI 0x8238
|
||||
#define GL_RG16I 0x8239
|
||||
#define GL_RG16UI 0x823A
|
||||
#define GL_RG32I 0x823B
|
||||
#define GL_RG32UI 0x823C
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_vertex_array_object
|
||||
#define GL_VERTEX_ARRAY_BINDING 0x85B5
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_abgr
|
||||
#define GL_ABGR_EXT 0x8000
|
||||
#endif
|
||||
@@ -3382,6 +3662,40 @@ extern "C" {
|
||||
#ifndef GL_GREMEDY_frame_terminator
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_conditional_render
|
||||
#define GL_QUERY_WAIT_NV 0x8E13
|
||||
#define GL_QUERY_NO_WAIT_NV 0x8E14
|
||||
#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15
|
||||
#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_present_video
|
||||
#define GL_FRAME_NV 0x8E26
|
||||
#define GL_FIELDS_NV 0x8E27
|
||||
#define GL_CURRENT_TIME_NV 0x8E28
|
||||
#define GL_NUM_FILL_STREAMS_NV 0x8E29
|
||||
#define GL_PRESENT_TIME_NV 0x8E2A
|
||||
#define GL_PRESENT_DURATION_NV 0x8E2B
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_transform_feedback
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F
|
||||
#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C
|
||||
#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D
|
||||
#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
|
||||
#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88
|
||||
#define GL_RASTERIZER_DISCARD_EXT 0x8C89
|
||||
#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A
|
||||
#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B
|
||||
#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80
|
||||
#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F
|
||||
#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
@@ -3419,16 +3733,16 @@ typedef unsigned short GLhalfNV;
|
||||
#endif
|
||||
|
||||
#ifndef GLEXT_64_TYPES_DEFINED
|
||||
/* This code block is duplicated in glext.h, so must be protected */
|
||||
/* This code block is duplicated in glxext.h, so must be protected */
|
||||
#define GLEXT_64_TYPES_DEFINED
|
||||
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
|
||||
/* (as used in the GL_EXT_timer_query extension). */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#include <inttypes.h>
|
||||
#elif defined(__sun__)
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
#include <inttypes.h>
|
||||
#if defined(__STDC__)
|
||||
#if defined(__arch64__)
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int int64_t;
|
||||
typedef unsigned long int uint64_t;
|
||||
#else
|
||||
@@ -3436,7 +3750,7 @@ typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#endif /* __STDC__ */
|
||||
#elif defined( __VMS )
|
||||
#elif defined( __VMS ) || defined(__sgi)
|
||||
#include <inttypes.h>
|
||||
#elif defined(__SCO__) || defined(__USLC__)
|
||||
#include <stdint.h>
|
||||
@@ -3990,6 +4304,10 @@ typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei co
|
||||
typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_3_0
|
||||
#define GL_VERSION_3_0 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_multitexture
|
||||
#define GL_ARB_multitexture 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
@@ -4569,6 +4887,54 @@ typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
|
||||
#define GL_ARB_pixel_buffer_object 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_depth_buffer_float
|
||||
#define GL_ARB_depth_buffer_float 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_draw_instanced
|
||||
#define GL_ARB_draw_instanced 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_framebuffer_object
|
||||
#define GL_ARB_framebuffer_object 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_framebuffer_sRGB
|
||||
#define GL_ARB_framebuffer_sRGB 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_geometry_shader4
|
||||
#define GL_ARB_geometry_shader4 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_half_float_vertex
|
||||
#define GL_ARB_half_float_vertex 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_instanced_arrays
|
||||
#define GL_ARB_instanced_arrays 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_map_buffer_range
|
||||
#define GL_ARB_map_buffer_range 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_buffer_object
|
||||
#define GL_ARB_texture_buffer_object 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_compression_rgtc
|
||||
#define GL_ARB_texture_compression_rgtc 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_rg
|
||||
#define GL_ARB_texture_rg 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_vertex_array_object
|
||||
#define GL_ARB_vertex_array_object 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_abgr
|
||||
#define GL_EXT_abgr 1
|
||||
#endif
|
||||
@@ -7263,6 +7629,18 @@ GLAPI void APIENTRY glFrameTerminatorGREMEDY (void);
|
||||
typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_conditional_render
|
||||
#define GL_NV_conditional_render 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_present_video
|
||||
#define GL_NV_present_video 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_transform_feedback
|
||||
#define GL_EXT_transform_feedback 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@ extern "C" {
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glxext.h last updated 2007/04/21 */
|
||||
/* glxext.h last updated 2008/08/10 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GLX_GLXEXT_VERSION 19
|
||||
#define GLX_GLXEXT_VERSION 20
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
@@ -346,6 +346,26 @@ extern "C" {
|
||||
#define GLX_AUX9_EXT 0x20EB
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_present_video
|
||||
#define GLX_GLX_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_video_out
|
||||
#define GLX_GLX_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define GLX_GLX_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
#define GLX_GLX_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||
#define GLX_GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||
#define GLX_GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||
#define GLX_GLX_VIDEO_OUT_FRAME_NV 0x20C8
|
||||
#define GLX_GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
|
||||
#define GLX_GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
|
||||
#define GLX_GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
|
||||
#define GLX_GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_swap_group
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
@@ -380,7 +400,7 @@ typedef struct {
|
||||
#endif
|
||||
|
||||
#ifndef GLEXT_64_TYPES_DEFINED
|
||||
/* This code block is duplicated in glxext.h, so must be protected */
|
||||
/* This code block is duplicated in glext.h, so must be protected */
|
||||
#define GLEXT_64_TYPES_DEFINED
|
||||
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
|
||||
/* (as used in the GLX_OML_sync_control extension). */
|
||||
@@ -389,7 +409,7 @@ typedef struct {
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
#include <inttypes.h>
|
||||
#if defined(__STDC__)
|
||||
#if defined(__arch64__)
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int int64_t;
|
||||
typedef unsigned long int uint64_t;
|
||||
#else
|
||||
@@ -397,7 +417,7 @@ typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#endif /* __STDC__ */
|
||||
#elif defined( __VMS )
|
||||
#elif defined( __VMS ) || defined(__sgi)
|
||||
#include <inttypes.h>
|
||||
#elif defined(__SCO__) || defined(__USLC__)
|
||||
#include <stdint.h>
|
||||
@@ -777,6 +797,18 @@ typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable,
|
||||
typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_present_video
|
||||
#define GLX_NV_present_video 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_video_out
|
||||
#define GLX_NV_video_out 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_swap_group
|
||||
#define GLX_NV_swap_group 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -40,7 +40,14 @@
|
||||
#ifndef DRI_INTERFACE_H
|
||||
#define DRI_INTERFACE_H
|
||||
|
||||
/* Make this something other than __APPLE__ for other arcs with no drm.h */
|
||||
#ifndef __APPLE__
|
||||
#include <drm.h>
|
||||
#else
|
||||
typedef unsigned int drm_context_t;
|
||||
typedef unsigned int drm_drawable_t;
|
||||
typedef struct drm_clip_rect drm_clip_rect_t;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name DRI interface structures
|
||||
|
||||
@@ -27,6 +27,7 @@ PROGS = \
|
||||
cubemap \
|
||||
drawpix \
|
||||
engine \
|
||||
fbo_firecube \
|
||||
fire \
|
||||
fogcoord \
|
||||
fplight \
|
||||
@@ -124,41 +125,41 @@ extfuncs.h: $(TOP)/progs/util/extfuncs.h
|
||||
|
||||
|
||||
reflect: reflect.o showbuffer.o readtex.o
|
||||
$(CC) $(LDFLAGS) reflect.o showbuffer.o readtex.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) reflect.o showbuffer.o readtex.o $(LIBS) -o $@
|
||||
|
||||
reflect.o: reflect.c showbuffer.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) reflect.c
|
||||
|
||||
|
||||
shadowtex: shadowtex.o showbuffer.o
|
||||
$(CC) $(LDFLAGS) shadowtex.o showbuffer.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) shadowtex.o showbuffer.o $(LIBS) -o $@
|
||||
|
||||
shadowtex.o: shadowtex.c showbuffer.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c
|
||||
|
||||
|
||||
gloss: gloss.o trackball.o readtex.o
|
||||
$(CC) $(LDFLAGS) gloss.o trackball.o readtex.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) gloss.o trackball.o readtex.o $(LIBS) -o $@
|
||||
|
||||
gloss.o: gloss.c trackball.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) gloss.c
|
||||
|
||||
|
||||
engine: engine.o trackball.o readtex.o
|
||||
$(CC) $(LDFLAGS) engine.o trackball.o readtex.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) engine.o trackball.o readtex.o $(LIBS) -o $@
|
||||
|
||||
engine.o: engine.c trackball.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) engine.c
|
||||
|
||||
|
||||
fslight: fslight.o
|
||||
$(CC) $(LDFLAGS) fslight.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) fslight.o $(LIBS) -o $@
|
||||
|
||||
fslight.o: fslight.c extfuncs.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) fslight.c
|
||||
|
||||
rain: particles.o rain.o readtex.o
|
||||
$(CXX) $(LDFLAGS) $^ $(LIBS) -o $@
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
|
||||
|
||||
rain.o: rain.cxx readtex.h
|
||||
$(CXX) -c -I$(INCDIR) $(CXXFLAGS) $<
|
||||
|
||||
1041
progs/demos/fbo_firecube.c
Normal file
1041
progs/demos/fbo_firecube.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -264,38 +264,44 @@ draw(void)
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -40.0);
|
||||
|
||||
/* clear whole depth buffer */
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
|
||||
/* draw gears */
|
||||
/* clear upper-left corner of color buffer (unused space) */
|
||||
glScissor(0, TexHeight, TexWidth, WinHeight - TexHeight);
|
||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
/* clear lower-left corner of color buffer */
|
||||
glViewport(0, 0, TexWidth, TexHeight);
|
||||
glScissor(0, 0, TexWidth, TexHeight);
|
||||
glClearColor(0.5, 0.5, 0.8, 0.0);
|
||||
glClearColor(1, 1, 1, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
/* draw gears in lower-left corner */
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 60.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
DrawGears();
|
||||
|
||||
/* copy color buffer to texture */
|
||||
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, TexWidth, TexHeight);
|
||||
|
||||
/* draw textured cube */
|
||||
/* clear right half of color buffer */
|
||||
glViewport(TexWidth, 0, WinWidth - TexWidth, WinHeight);
|
||||
glScissor(TexWidth, 0, WinWidth - TexWidth, WinHeight);
|
||||
glClearColor(0.5, 0.5, 0.8, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
/* draw textured cube in right half of window */
|
||||
ar = (float) (WinWidth - TexWidth) / WinHeight;
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-ar, ar, -1.0, 1.0, 5.0, 60.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
DrawCube();
|
||||
|
||||
/* finish up */
|
||||
|
||||
@@ -72,7 +72,7 @@ UTIL_FILES = readtex.h readtex.c
|
||||
.SUFFIXES: .c
|
||||
|
||||
.c:
|
||||
$(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@
|
||||
$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
@@ -99,13 +99,13 @@ getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.
|
||||
|
||||
|
||||
texrect: texrect.o readtex.o
|
||||
$(CC) texrect.o readtex.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
|
||||
|
||||
texrect.o: texrect.c readtex.h
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
invert: invert.o readtex.o
|
||||
$(CC) invert.o readtex.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
|
||||
|
||||
invert.o: invert.c readtex.h
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
@@ -13,11 +13,13 @@ PROGS = \
|
||||
bitmap \
|
||||
brick \
|
||||
bump \
|
||||
convolutions \
|
||||
deriv \
|
||||
mandelbrot \
|
||||
multitex \
|
||||
noise \
|
||||
points \
|
||||
pointcoord \
|
||||
texdemo1 \
|
||||
toyball \
|
||||
twoside \
|
||||
@@ -89,6 +91,13 @@ bump: bump.o shaderutil.o
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
|
||||
convolutions.o: convolutions.c readtex.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c
|
||||
|
||||
convolutions: convolutions.o readtex.o
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@
|
||||
|
||||
|
||||
deriv.o: deriv.c extfuncs.h shaderutil.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) deriv.c
|
||||
|
||||
@@ -124,6 +133,13 @@ points: points.o shaderutil.o
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
|
||||
pointcoord.o: pointcoord.c readtex.h extfuncs.h shaderutil.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c
|
||||
|
||||
pointcoord: pointcoord.o readtex.o shaderutil.o
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
|
||||
texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#include "shaderutil.h"
|
||||
|
||||
|
||||
static char *FragProgFile = "CH06-brick.frag.txt";
|
||||
static char *VertProgFile = "CH06-brick.vert.txt";
|
||||
static char *FragProgFile = "CH06-brick.frag";
|
||||
static char *VertProgFile = "CH06-brick.vert";
|
||||
|
||||
/* program/shader objects */
|
||||
static GLuint fragShader;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#include "shaderutil.h"
|
||||
|
||||
|
||||
static char *FragProgFile = "CH11-bumpmap.frag.txt";
|
||||
static char *VertProgFile = "CH11-bumpmap.vert.txt";
|
||||
static char *FragProgFile = "CH11-bumpmap.frag";
|
||||
static char *VertProgFile = "CH11-bumpmap.vert";
|
||||
|
||||
/* program/shader objects */
|
||||
static GLuint fragShader;
|
||||
|
||||
21
progs/glsl/convolution.frag
Normal file
21
progs/glsl/convolution.frag
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
const int KernelSize = 9;
|
||||
|
||||
//texture offsets
|
||||
uniform vec2 Offset[KernelSize];
|
||||
//convolution kernel
|
||||
uniform vec4 KernelValue[KernelSize];
|
||||
uniform sampler2D srcTex;
|
||||
uniform vec4 ScaleFactor;
|
||||
uniform vec4 BaseColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
int i;
|
||||
vec4 sum = vec4(0.0);
|
||||
for (i = 0; i < KernelSize; ++i) {
|
||||
vec4 tmp = texture2D(srcTex, gl_TexCoord[0].st + Offset[i]);
|
||||
sum += tmp * KernelValue[i];
|
||||
}
|
||||
gl_FragColor = sum * ScaleFactor + BaseColor;
|
||||
}
|
||||
5
progs/glsl/convolution.vert
Normal file
5
progs/glsl/convolution.vert
Normal file
@@ -0,0 +1,5 @@
|
||||
void main() {
|
||||
gl_FrontColor = gl_Color;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
}
|
||||
469
progs/glsl/convolutions.c
Normal file
469
progs/glsl/convolutions.c
Normal file
@@ -0,0 +1,469 @@
|
||||
/**
|
||||
* Convolution with GLSL.
|
||||
* Note: uses GL_ARB_shader_objects, GL_ARB_vertex_shader, GL_ARB_fragment_shader,
|
||||
* not the OpenGL 2.0 shader API.
|
||||
* Author: Zack Rusin
|
||||
*/
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include "readtex.h"
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
|
||||
enum Filter {
|
||||
GAUSSIAN_BLUR,
|
||||
SHARPEN,
|
||||
MEAN_REMOVAL,
|
||||
EMBOSS,
|
||||
EDGE_DETECT,
|
||||
NO_FILTER,
|
||||
LAST
|
||||
};
|
||||
#define QUIT LAST
|
||||
|
||||
struct BoundingBox {
|
||||
float minx, miny, minz;
|
||||
float maxx, maxy, maxz;
|
||||
};
|
||||
struct Texture {
|
||||
GLuint id;
|
||||
GLfloat x;
|
||||
GLfloat y;
|
||||
GLint width;
|
||||
GLint height;
|
||||
GLenum format;
|
||||
};
|
||||
|
||||
static const char *textureLocation = "../images/girl2.rgb";
|
||||
|
||||
static GLfloat viewRotx = 0.0, viewRoty = 0.0, viewRotz = 0.0;
|
||||
static struct BoundingBox box;
|
||||
static struct Texture texture;
|
||||
static GLuint program;
|
||||
static GLint menuId;
|
||||
static enum Filter filter = GAUSSIAN_BLUR;
|
||||
|
||||
|
||||
static void checkError(int line)
|
||||
{
|
||||
GLenum err = glGetError();
|
||||
if (err) {
|
||||
printf("GL Error %s (0x%x) at line %d\n",
|
||||
gluErrorString(err), (int) err, line);
|
||||
}
|
||||
}
|
||||
|
||||
static void loadAndCompileShader(GLuint shader, const char *text)
|
||||
{
|
||||
GLint stat;
|
||||
|
||||
glShaderSourceARB(shader, 1, (const GLchar **) &text, NULL);
|
||||
|
||||
glCompileShaderARB(shader);
|
||||
|
||||
glGetObjectParameterivARB(shader, GL_COMPILE_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetInfoLogARB(shader, 1000, &len, log);
|
||||
fprintf(stderr, "Problem compiling shader: %s\n", log);
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
printf("Shader compiled OK\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void readShader(GLuint shader, const char *filename)
|
||||
{
|
||||
const int max = 100*1000;
|
||||
int n;
|
||||
char *buffer = (char*) malloc(max);
|
||||
FILE *f = fopen(filename, "r");
|
||||
if (!f) {
|
||||
fprintf(stderr, "Unable to open shader file %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
n = fread(buffer, 1, max, f);
|
||||
printf("Read %d bytes from shader file %s\n", n, filename);
|
||||
if (n > 0) {
|
||||
buffer[n] = 0;
|
||||
loadAndCompileShader(shader, buffer);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
checkLink(GLuint prog)
|
||||
{
|
||||
GLint stat;
|
||||
glGetObjectParameterivARB(prog, GL_LINK_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetInfoLogARB(prog, 1000, &len, log);
|
||||
fprintf(stderr, "Linker error:\n%s\n", log);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Link success!\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void fillConvolution(GLint *k,
|
||||
GLfloat *scale,
|
||||
GLfloat *color)
|
||||
{
|
||||
switch(filter) {
|
||||
case GAUSSIAN_BLUR:
|
||||
k[0] = 1; k[1] = 2; k[2] = 1;
|
||||
k[3] = 2; k[4] = 4; k[5] = 2;
|
||||
k[6] = 1; k[7] = 2; k[8] = 1;
|
||||
|
||||
*scale = 1./16.;
|
||||
break;
|
||||
case SHARPEN:
|
||||
k[0] = 0; k[1] = -2; k[2] = 0;
|
||||
k[3] = -2; k[4] = 11; k[5] = -2;
|
||||
k[6] = 0; k[7] = -2; k[8] = 0;
|
||||
|
||||
*scale = 1./3.;
|
||||
break;
|
||||
case MEAN_REMOVAL:
|
||||
k[0] = -1; k[1] = -1; k[2] = -1;
|
||||
k[3] = -1; k[4] = 9; k[5] = -1;
|
||||
k[6] = -1; k[7] = -1; k[8] = -1;
|
||||
|
||||
*scale = 1./1.;
|
||||
break;
|
||||
case EMBOSS:
|
||||
k[0] = -1; k[1] = 0; k[2] = -1;
|
||||
k[3] = 0; k[4] = 4; k[5] = 0;
|
||||
k[6] = -1; k[7] = 0; k[8] = -1;
|
||||
|
||||
*scale = 1./1.;
|
||||
color[0] = 0.5;
|
||||
color[1] = 0.5;
|
||||
color[2] = 0.5;
|
||||
color[3] = 0.5;
|
||||
break;
|
||||
case EDGE_DETECT:
|
||||
k[0] = 1; k[1] = 1; k[2] = 1;
|
||||
k[3] = 0; k[4] = 0; k[5] = 0;
|
||||
k[6] = -1; k[7] = -1; k[8] = -1;
|
||||
|
||||
*scale = 1.;
|
||||
color[0] = 0.5;
|
||||
color[1] = 0.5;
|
||||
color[2] = 0.5;
|
||||
color[3] = 0.5;
|
||||
break;
|
||||
case NO_FILTER:
|
||||
k[0] = 0; k[1] = 0; k[2] = 0;
|
||||
k[3] = 0; k[4] = 1; k[5] = 0;
|
||||
k[6] = 0; k[7] = 0; k[8] = 0;
|
||||
|
||||
*scale = 1.;
|
||||
break;
|
||||
default:
|
||||
assert(!"Unhandled switch value");
|
||||
}
|
||||
}
|
||||
|
||||
static void setupConvolution()
|
||||
{
|
||||
GLint *kernel = (GLint*)malloc(sizeof(GLint) * 9);
|
||||
GLfloat scale;
|
||||
GLfloat *vecKer = (GLfloat*)malloc(sizeof(GLfloat) * 9 * 4);
|
||||
GLuint loc;
|
||||
GLuint i;
|
||||
GLfloat baseColor[4];
|
||||
baseColor[0] = 0;
|
||||
baseColor[1] = 0;
|
||||
baseColor[2] = 0;
|
||||
baseColor[3] = 0;
|
||||
|
||||
fillConvolution(kernel, &scale, baseColor);
|
||||
/*vector of 4*/
|
||||
for (i = 0; i < 9; ++i) {
|
||||
vecKer[i*4 + 0] = kernel[i];
|
||||
vecKer[i*4 + 1] = kernel[i];
|
||||
vecKer[i*4 + 2] = kernel[i];
|
||||
vecKer[i*4 + 3] = kernel[i];
|
||||
}
|
||||
|
||||
loc = glGetUniformLocationARB(program, "KernelValue");
|
||||
glUniform4fvARB(loc, 9, vecKer);
|
||||
loc = glGetUniformLocationARB(program, "ScaleFactor");
|
||||
glUniform4fARB(loc, scale, scale, scale, scale);
|
||||
loc = glGetUniformLocationARB(program, "BaseColor");
|
||||
glUniform4fARB(loc, baseColor[0], baseColor[1],
|
||||
baseColor[2], baseColor[3]);
|
||||
|
||||
free(vecKer);
|
||||
free(kernel);
|
||||
}
|
||||
|
||||
static void createProgram(const char *vertProgFile,
|
||||
const char *fragProgFile)
|
||||
{
|
||||
GLuint fragShader = 0, vertShader = 0;
|
||||
|
||||
program = glCreateProgram();
|
||||
if (vertProgFile) {
|
||||
vertShader = glCreateShader(GL_VERTEX_SHADER);
|
||||
readShader(vertShader, vertProgFile);
|
||||
glAttachShader(program, vertShader);
|
||||
}
|
||||
|
||||
if (fragProgFile) {
|
||||
fragShader = glCreateShader(GL_FRAGMENT_SHADER);
|
||||
readShader(fragShader, fragProgFile);
|
||||
glAttachShader(program, fragShader);
|
||||
}
|
||||
|
||||
glLinkProgramARB(program);
|
||||
checkLink(program);
|
||||
|
||||
glUseProgramObjectARB(program);
|
||||
|
||||
/*
|
||||
assert(glIsProgram(program));
|
||||
assert(glIsShader(fragShader));
|
||||
assert(glIsShader(vertShader));
|
||||
*/
|
||||
|
||||
checkError(__LINE__);
|
||||
{/*texture*/
|
||||
GLuint texLoc = glGetUniformLocationARB(program, "srcTex");
|
||||
glUniform1iARB(texLoc, 0);
|
||||
}
|
||||
{/*setup offsets */
|
||||
float offsets[] = { 1.0 / texture.width, 1.0 / texture.height,
|
||||
0.0 , 1.0 / texture.height,
|
||||
-1.0 / texture.width, 1.0 / texture.height,
|
||||
1.0 / texture.width, 0.0,
|
||||
0.0 , 0.0,
|
||||
-1.0 / texture.width, 0.0,
|
||||
1.0 / texture.width, -1.0 / texture.height,
|
||||
0.0 , -1.0 / texture.height,
|
||||
-1.0 / texture.width, -1.0 / texture.height };
|
||||
GLuint offsetLoc = glGetUniformLocationARB(program, "Offset");
|
||||
glUniform2fvARB(offsetLoc, 9, offsets);
|
||||
}
|
||||
setupConvolution();
|
||||
|
||||
checkError(__LINE__);
|
||||
}
|
||||
|
||||
|
||||
static void readTexture(const char *filename)
|
||||
{
|
||||
GLubyte *data;
|
||||
|
||||
texture.x = 0;
|
||||
texture.y = 0;
|
||||
|
||||
glGenTextures(1, &texture.id);
|
||||
glBindTexture(GL_TEXTURE_2D, texture.id);
|
||||
glTexParameteri(GL_TEXTURE_2D,
|
||||
GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D,
|
||||
GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
data = LoadRGBImage(filename, &texture.width, &texture.height,
|
||||
&texture.format);
|
||||
if (!data) {
|
||||
printf("Error: couldn't load texture image '%s'\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
printf("Texture %s (%d x %d)\n",
|
||||
filename, texture.width, texture.height);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
|
||||
texture.width, texture.height, 0, texture.format,
|
||||
GL_UNSIGNED_BYTE, data);
|
||||
}
|
||||
|
||||
static void menuSelected(int entry)
|
||||
{
|
||||
switch (entry) {
|
||||
case QUIT:
|
||||
exit(0);
|
||||
break;
|
||||
default:
|
||||
filter = (enum Filter)entry;
|
||||
}
|
||||
setupConvolution();
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void menuInit()
|
||||
{
|
||||
menuId = glutCreateMenu(menuSelected);
|
||||
|
||||
glutAddMenuEntry("Gaussian blur", GAUSSIAN_BLUR);
|
||||
glutAddMenuEntry("Sharpen", SHARPEN);
|
||||
glutAddMenuEntry("Mean removal", MEAN_REMOVAL);
|
||||
glutAddMenuEntry("Emboss", EMBOSS);
|
||||
glutAddMenuEntry("Edge detect", EDGE_DETECT);
|
||||
glutAddMenuEntry("None", NO_FILTER);
|
||||
|
||||
glutAddMenuEntry("Quit", QUIT);
|
||||
|
||||
glutAttachMenu(GLUT_RIGHT_BUTTON);
|
||||
}
|
||||
|
||||
static void init()
|
||||
{
|
||||
if (!glutExtensionSupported("GL_ARB_shader_objects") ||
|
||||
!glutExtensionSupported("GL_ARB_vertex_shader") ||
|
||||
!glutExtensionSupported("GL_ARB_fragment_shader")) {
|
||||
fprintf(stderr, "Sorry, this program requires GL_ARB_shader_objects, GL_ARB_vertex_shader, and GL_ARB_fragment_shader\n");
|
||||
exit(1);
|
||||
}
|
||||
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
|
||||
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
|
||||
|
||||
menuInit();
|
||||
readTexture(textureLocation);
|
||||
createProgram("convolution.vert", "convolution.frag");
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glClearColor(1.0, 1.0, 1.0, 1.0);
|
||||
/*glShadeModel(GL_SMOOTH);*/
|
||||
glShadeModel(GL_FLAT);
|
||||
}
|
||||
|
||||
static void reshape(int width, int height)
|
||||
{
|
||||
glViewport(0, 0, width, height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
box.minx = 0;
|
||||
box.maxx = width;
|
||||
box.miny = 0;
|
||||
box.maxy = height;
|
||||
box.minz = 0;
|
||||
box.maxz = 1;
|
||||
glOrtho(box.minx, box.maxx, box.miny, box.maxy, -999999, 999999);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void keyPress(unsigned char key, int x, int y)
|
||||
{
|
||||
switch(key) {
|
||||
case 27:
|
||||
exit(0);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void
|
||||
special(int k, int x, int y)
|
||||
{
|
||||
switch (k) {
|
||||
case GLUT_KEY_UP:
|
||||
viewRotx += 2.0;
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
viewRotx -= 2.0;
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
viewRoty += 2.0;
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
viewRoty -= 2.0;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void draw()
|
||||
{
|
||||
GLfloat center[2];
|
||||
GLfloat anchor[2];
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glLoadIdentity();
|
||||
glPushMatrix();
|
||||
|
||||
center[0] = box.maxx/2;
|
||||
center[1] = box.maxy/2;
|
||||
anchor[0] = center[0] - texture.width/2;
|
||||
anchor[1] = center[1] - texture.height/2;
|
||||
|
||||
glTranslatef(center[0], center[1], 0);
|
||||
glRotatef(viewRotx, 1.0, 0.0, 0.0);
|
||||
glRotatef(viewRoty, 0.0, 1.0, 0.0);
|
||||
glRotatef(viewRotz, 0.0, 0.0, 1.0);
|
||||
glTranslatef(-center[0], -center[1], 0);
|
||||
|
||||
glTranslatef(anchor[0], anchor[1], 0);
|
||||
glBegin(GL_TRIANGLE_STRIP);
|
||||
{
|
||||
glColor3f(1., 0., 0.);
|
||||
glTexCoord2f(0, 0);
|
||||
glVertex3f(0, 0, 0);
|
||||
|
||||
glColor3f(0., 1., 0.);
|
||||
glTexCoord2f(0, 1.0);
|
||||
glVertex3f(0, texture.height, 0);
|
||||
|
||||
glColor3f(1., 0., 0.);
|
||||
glTexCoord2f(1.0, 0);
|
||||
glVertex3f(texture.width, 0, 0);
|
||||
|
||||
glColor3f(0., 1., 0.);
|
||||
glTexCoord2f(1, 1);
|
||||
glVertex3f(texture.width, texture.height, 0);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glFlush();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
|
||||
glutInitWindowPosition(0, 0);
|
||||
glutInitWindowSize(400, 400);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE);
|
||||
|
||||
if (!glutCreateWindow("Image Convolutions")) {
|
||||
fprintf(stderr, "Couldn't create window!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
glutReshapeFunc(reshape);
|
||||
glutKeyboardFunc(keyPress);
|
||||
glutSpecialFunc(special);
|
||||
glutDisplayFunc(draw);
|
||||
|
||||
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
@@ -16,8 +16,8 @@
|
||||
#include "shaderutil.h"
|
||||
|
||||
|
||||
static char *FragProgFile = "CH18-mandel.frag.txt";
|
||||
static char *VertProgFile = "CH18-mandel.vert.txt";
|
||||
static char *FragProgFile = "CH18-mandel.frag";
|
||||
static char *VertProgFile = "CH18-mandel.vert";
|
||||
|
||||
/* program/shader objects */
|
||||
static GLuint fragShader;
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
|
||||
static const char *Demo = "multitex";
|
||||
|
||||
static const char *VertFile = "multitex.vert.txt";
|
||||
static const char *FragFile = "multitex.frag.txt";
|
||||
static const char *VertFile = "multitex.vert";
|
||||
static const char *FragFile = "multitex.frag";
|
||||
|
||||
static const char *TexFiles[2] =
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ uniform sampler2D tex2;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy, 0.0);
|
||||
vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy, 0.0);
|
||||
vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
|
||||
vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
|
||||
gl_FragColor = mix(t1, t2, t2.w);
|
||||
}
|
||||
205
progs/glsl/pointcoord.c
Normal file
205
progs/glsl/pointcoord.c
Normal file
@@ -0,0 +1,205 @@
|
||||
/**
|
||||
* Test GLSL 1.20 gl_PointCoord fragment program attribute.
|
||||
* Brian Paul
|
||||
* 11 Aug 2007
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
#include "extfuncs.h"
|
||||
#include "shaderutil.h"
|
||||
|
||||
|
||||
static GLint WinWidth = 300, WinHeight = 300;
|
||||
static char *FragProgFile = NULL;
|
||||
static char *VertProgFile = NULL;
|
||||
static GLuint fragShader;
|
||||
static GLuint vertShader;
|
||||
static GLuint program;
|
||||
static GLint win = 0;
|
||||
static GLint tex0;
|
||||
static GLenum Filter = GL_NEAREST;
|
||||
|
||||
|
||||
static void
|
||||
Redisplay(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
/* draw one point/sprite */
|
||||
glPushMatrix();
|
||||
glPointSize(60);
|
||||
glBegin(GL_POINTS);
|
||||
glVertex2f(WinWidth / 2.0f, WinHeight / 2.0f);
|
||||
glEnd();
|
||||
glPopMatrix();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Reshape(int width, int height)
|
||||
{
|
||||
glViewport(0, 0, width, height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(0, width, 0, height, -1, 1);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
WinWidth = width;
|
||||
WinHeight = height;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
CleanUp(void)
|
||||
{
|
||||
glDeleteShader_func(fragShader);
|
||||
glDeleteShader_func(vertShader);
|
||||
glDeleteProgram_func(program);
|
||||
glutDestroyWindow(win);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key(unsigned char key, int x, int y)
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch(key) {
|
||||
case 27:
|
||||
CleanUp();
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
MakeTexture(void)
|
||||
{
|
||||
#define SZ 16
|
||||
GLubyte image[SZ][SZ][4];
|
||||
GLuint i, j;
|
||||
|
||||
for (i = 0; i < SZ; i++) {
|
||||
for (j = 0; j < SZ; j++) {
|
||||
if ((i + j) & 1) {
|
||||
image[i][j][0] = 0;
|
||||
image[i][j][1] = 0;
|
||||
image[i][j][2] = 0;
|
||||
image[i][j][3] = 255;
|
||||
}
|
||||
else {
|
||||
image[i][j][0] = j * 255 / (SZ-1);
|
||||
image[i][j][1] = i * 255 / (SZ-1);
|
||||
image[i][j][2] = 0;
|
||||
image[i][j][3] = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glActiveTexture(GL_TEXTURE0); /* unit 0 */
|
||||
glBindTexture(GL_TEXTURE_2D, 42);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SZ, SZ, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, image);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, Filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
#undef SZ
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
{
|
||||
static const char *fragShaderText =
|
||||
"#version 120 \n"
|
||||
"uniform sampler2D tex0; \n"
|
||||
"void main() { \n"
|
||||
" gl_FragColor = texture2D(tex0, gl_PointCoord.xy, 0.0); \n"
|
||||
"}\n";
|
||||
static const char *vertShaderText =
|
||||
"void main() {\n"
|
||||
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
|
||||
"}\n";
|
||||
|
||||
if (!ShadersSupported())
|
||||
exit(1);
|
||||
|
||||
GetExtensionFuncs();
|
||||
|
||||
vertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText);
|
||||
fragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText);
|
||||
program = LinkShaders(vertShader, fragShader);
|
||||
|
||||
glUseProgram_func(program);
|
||||
|
||||
tex0 = glGetUniformLocation_func(program, "tex0");
|
||||
printf("Uniforms: tex0: %d\n", tex0);
|
||||
|
||||
glUniform1i_func(tex0, 0); /* tex unit 0 */
|
||||
|
||||
/*assert(glGetError() == 0);*/
|
||||
|
||||
glClearColor(0.3f, 0.3f, 0.3f, 0.0f);
|
||||
|
||||
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
||||
|
||||
assert(glIsProgram_func(program));
|
||||
assert(glIsShader_func(fragShader));
|
||||
assert(glIsShader_func(vertShader));
|
||||
|
||||
MakeTexture();
|
||||
|
||||
glEnable(GL_POINT_SPRITE);
|
||||
|
||||
glColor3f(1, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ParseOptions(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-fs") == 0) {
|
||||
FragProgFile = argv[i+1];
|
||||
}
|
||||
else if (strcmp(argv[i], "-vs") == 0) {
|
||||
VertProgFile = argv[i+1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition( 0, 0);
|
||||
glutInitWindowSize(WinWidth, WinHeight);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
|
||||
win = glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Redisplay);
|
||||
ParseOptions(argc, argv);
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
@@ -35,11 +35,11 @@
|
||||
|
||||
static const char *Demo = "texdemo1";
|
||||
|
||||
static const char *ReflectVertFile = "reflect.vert.txt";
|
||||
static const char *CubeFragFile = "cubemap.frag.txt";
|
||||
static const char *ReflectVertFile = "reflect.vert";
|
||||
static const char *CubeFragFile = "cubemap.frag";
|
||||
|
||||
static const char *SimpleVertFile = "simple.vert.txt";
|
||||
static const char *SimpleTexFragFile = "shadowtex.frag.txt";
|
||||
static const char *SimpleVertFile = "simple.vert";
|
||||
static const char *SimpleTexFragFile = "shadowtex.frag";
|
||||
|
||||
static const char *GroundImage = "../images/tile.rgb";
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#include "shaderutil.h"
|
||||
|
||||
|
||||
static char *FragProgFile = "CH11-toyball.frag.txt";
|
||||
static char *VertProgFile = "CH11-toyball.vert.txt";
|
||||
static char *FragProgFile = "CH11-toyball.frag";
|
||||
static char *VertProgFile = "CH11-toyball.vert";
|
||||
|
||||
/* program/shader objects */
|
||||
static GLuint fragShader;
|
||||
|
||||
@@ -28,7 +28,7 @@ static GLuint program;
|
||||
static GLint win = 0;
|
||||
static GLboolean anim = 0*GL_TRUE;
|
||||
static GLboolean DetermineInFragProg = GL_TRUE;
|
||||
static GLfloat Yrot = 0.0f;
|
||||
static GLfloat Xrot = 30.0f;
|
||||
static GLint u_fragface;
|
||||
static GLenum FrontWinding = GL_CCW;
|
||||
static int prevTime = 0;
|
||||
@@ -41,7 +41,8 @@ static const GLfloat Green[4] = {0, 1, 0, 0};
|
||||
static void
|
||||
Redisplay(void)
|
||||
{
|
||||
float xmin = -1, xmax = 1, ymin = -1, ymax = 1;
|
||||
int i;
|
||||
float radius = 2;
|
||||
|
||||
glFrontFace(FrontWinding);
|
||||
|
||||
@@ -54,18 +55,22 @@ Redisplay(void)
|
||||
glEnable(GL_VERTEX_PROGRAM_TWO_SIDE);
|
||||
}
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(Yrot, 0, 1, 0);
|
||||
glRotatef(Xrot, 1, 0, 0);
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
/* Draw a tristrip ring */
|
||||
glBegin(GL_TRIANGLE_STRIP);
|
||||
glColor4fv(Red);
|
||||
glSecondaryColor3fv_func(Green);
|
||||
glVertex2f(xmin, ymin);
|
||||
glVertex2f(xmax, ymin);
|
||||
glVertex2f(xmax, ymax);
|
||||
glVertex2f(xmin, ymax);
|
||||
for (i = 0; i < 20; i++) {
|
||||
float a = i / 19.0 * M_PI * 2.0;
|
||||
float x = radius * cos(a);
|
||||
float y = radius * sin(a);
|
||||
glVertex3f(x, -1, y);
|
||||
glVertex3f(x, +1, y);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
glPopMatrix();
|
||||
@@ -86,7 +91,7 @@ Idle(void)
|
||||
}
|
||||
prevTime = curTime;
|
||||
|
||||
Yrot += dt * 0.1;
|
||||
Xrot += dt * 0.1;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
@@ -98,7 +103,7 @@ Reshape(int width, int height)
|
||||
glViewport(0, 0, width, height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-ar, ar, -1, 1, 5, 15);
|
||||
glFrustum(-ar, ar, -1, 1, 3, 25);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0, 0, -10);
|
||||
@@ -141,12 +146,16 @@ Key(unsigned char key, int x, int y)
|
||||
DetermineInFragProg = GL_FALSE;
|
||||
break;
|
||||
case 'r':
|
||||
Yrot = 0;
|
||||
/* reset */
|
||||
Xrot = 30;
|
||||
anim = 0;
|
||||
glutIdleFunc(NULL);
|
||||
break;
|
||||
case 's':
|
||||
Yrot += 5;
|
||||
Xrot += 5;
|
||||
break;
|
||||
case 'S':
|
||||
Xrot -= 5;
|
||||
break;
|
||||
case 'w':
|
||||
if (FrontWinding == GL_CCW) {
|
||||
@@ -173,12 +182,24 @@ Init(void)
|
||||
static const char *fragShaderText =
|
||||
"uniform bool fragface; \n"
|
||||
"void main() { \n"
|
||||
#if 0
|
||||
" if (!fragface || gl_FrontFacing) { \n"
|
||||
" gl_FragColor = gl_Color; \n"
|
||||
" } \n"
|
||||
" else { \n"
|
||||
" gl_FragColor = 0.8 * gl_SecondaryColor; \n"
|
||||
" } \n"
|
||||
#else
|
||||
" bool f = gl_FrontFacing; \n"
|
||||
" if (f) { \n"
|
||||
" gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0); \n"
|
||||
" } \n"
|
||||
" else { \n"
|
||||
" gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0); \n"
|
||||
" } \n"
|
||||
" //float g = float(gl_FrontFacing) * 0.5 + 0.5; \n"
|
||||
" //gl_FragColor = vec4(g); \n"
|
||||
#endif
|
||||
"} \n";
|
||||
static const char *vertShaderText =
|
||||
"uniform bool fragface; \n"
|
||||
@@ -218,6 +239,8 @@ Init(void)
|
||||
assert(glIsProgram_func(program));
|
||||
assert(glIsShader_func(fragShader));
|
||||
assert(glIsShader_func(vertShader));
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
|
||||
@@ -246,6 +269,7 @@ Usage(void)
|
||||
printf(" a - toggle animation\n");
|
||||
printf(" s - step rotation\n");
|
||||
printf(" w - toggle CW, CCW front-face winding\n");
|
||||
printf("NOTE: red = front face, green = back face.\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -255,7 +279,7 @@ main(int argc, char *argv[])
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition( 0, 0);
|
||||
glutInitWindowSize(WinWidth, WinHeight);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
|
||||
win = glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
|
||||
@@ -31,27 +31,27 @@ clean:
|
||||
#
|
||||
|
||||
cltest: cltest.o framework.o $(LIB_DEP)
|
||||
$(CC) $(LDFLAGS) cltest.o framework.o $(LIBS) -o cltest
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) cltest.o framework.o $(LIBS) -o cltest
|
||||
|
||||
sotest: sotest.o framework.o $(LIB_DEP)
|
||||
$(CC) $(LDFLAGS) sotest.o framework.o $(LIBS) -o sotest
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) sotest.o framework.o $(LIBS) -o sotest
|
||||
|
||||
vstest: vstest.o framework.o $(LIB_DEP)
|
||||
$(CC) $(LDFLAGS) vstest.o framework.o $(LIBS) -o vstest
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) vstest.o framework.o $(LIBS) -o vstest
|
||||
|
||||
#
|
||||
# objects
|
||||
#
|
||||
|
||||
framework.o: framework.c framework.h
|
||||
$(CC) -c -I$(INCDIR) framework.c -o framework.o
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) framework.c -o framework.o
|
||||
|
||||
cltest.o: cltest.c framework.h
|
||||
$(CC) -c -I$(INCDIR) cltest.c -o cltest.o
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) cltest.c -o cltest.o
|
||||
|
||||
sotest.o: sotest.c framework.h
|
||||
$(CC) -c -I$(INCDIR) sotest.c -o sotest.o
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) sotest.c -o sotest.o
|
||||
|
||||
vstest.o: vstest.c framework.h
|
||||
$(CC) -c -I$(INCDIR) vstest.c -o vstest.o
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) vstest.c -o vstest.o
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ TRACER = gltrace.so
|
||||
default: $(TRACER)
|
||||
|
||||
$(TRACER): $(OBJECTS)
|
||||
$(TOP)/bin/mklib -o $(TRACER) -noprefix -cplusplus \
|
||||
$(MKLIB) -o $(TRACER) -noprefix -cplusplus -linker '$(CXX)' \
|
||||
-ldflags '$(LDFLAGS)' $(MKLIB_OPTIONS) $(OBJECTS)
|
||||
|
||||
gltrace.cc: gltrace.py
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "gltrace_support.h"
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <assert.h>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
@@ -136,7 +138,7 @@ namespace gltrace {
|
||||
|
||||
struct timeval now;
|
||||
struct tm t;
|
||||
static char *months[12] =
|
||||
static char const *months[12] =
|
||||
{
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
|
||||
@@ -115,13 +115,13 @@ getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.
|
||||
|
||||
|
||||
texrect: texrect.o readtex.o
|
||||
$(CC) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
|
||||
|
||||
texrect.o: texrect.c readtex.h
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
invert: invert.o readtex.o
|
||||
$(CC) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
|
||||
|
||||
invert.o: invert.c readtex.h
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
@@ -67,10 +67,10 @@ clean:
|
||||
|
||||
# special cases
|
||||
pbinfo: pbinfo.o pbutil.o
|
||||
$(CC) $(LDFLAGS) pbinfo.o pbutil.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) pbinfo.o pbutil.o $(LIBS) -o $@
|
||||
|
||||
pbdemo: pbdemo.o pbutil.o
|
||||
$(CC) $(LDFLAGS) pbdemo.o pbutil.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) pbdemo.o pbutil.o $(LIBS) -o $@
|
||||
|
||||
pbinfo.o: pbinfo.c pbutil.h
|
||||
$(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbinfo.c
|
||||
@@ -82,13 +82,13 @@ pbutil.o: pbutil.c pbutil.h
|
||||
$(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbutil.c
|
||||
|
||||
glxgears_fbconfig: glxgears_fbconfig.o pbutil.o
|
||||
$(CC) $(LDFLAGS) glxgears_fbconfig.o pbutil.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) glxgears_fbconfig.o pbutil.o $(LIBS) -o $@
|
||||
|
||||
glxgears_fbconfig.o: glxgears_fbconfig.c pbutil.h
|
||||
$(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) -c -I. $(CFLAGS) glxgears_fbconfig.c
|
||||
|
||||
xrotfontdemo: xrotfontdemo.o xuserotfont.o
|
||||
$(CC) $(LDFLAGS) xrotfontdemo.o xuserotfont.o $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) xrotfontdemo.o xuserotfont.o $(LIBS) -o $@
|
||||
|
||||
xuserotfont.o: xuserotfont.c xuserotfont.h
|
||||
$(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xuserotfont.c
|
||||
|
||||
@@ -523,6 +523,13 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
|
||||
printf("OpenGL vendor string: %s\n", glVendor);
|
||||
printf("OpenGL renderer string: %s\n", glRenderer);
|
||||
printf("OpenGL version string: %s\n", glVersion);
|
||||
#ifdef GL_VERSION_2_0
|
||||
if (glVersion[0] >= '2' && glVersion[1] == '.') {
|
||||
char *v = (char *) glGetString(GL_SHADING_LANGUAGE_VERSION);
|
||||
printf("OpenGL shading language version string: %s\n", v);
|
||||
}
|
||||
#endif
|
||||
|
||||
printf("OpenGL extensions:\n");
|
||||
print_extension_list(glExtensions);
|
||||
if (limits)
|
||||
|
||||
@@ -21,8 +21,9 @@ default: $(TOP)/$(LIB_DIR)/demodriver.so
|
||||
|
||||
|
||||
$(TOP)/$(LIB_DIR)/demodriver.so: $(OBJECTS)
|
||||
$(TOP)/bin/mklib -o demodriver.so -noprefix -ldflags '$(LDFLAGS)' \
|
||||
-install $(TOP)/$(LIB_DIR) $(OBJECTS)
|
||||
$(MKLIB) -o demodriver.so -noprefix -linker '$(CC)' \
|
||||
-ldflags '$(LDFLAGS)' -install $(TOP)/$(LIB_DIR) \
|
||||
$(OBJECTS)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ default: depend library Makefile
|
||||
library: $(TOP)/$(LIB_DIR)/libEGLdri.so
|
||||
|
||||
$(TOP)/$(LIB_DIR)/libEGLdri.so: $(OBJECTS)
|
||||
$(TOP)/bin/mklib -o EGLdri -ldflags '$(LDFLAGS)' -major 1 -minor 0 \
|
||||
$(MKLIB) -o EGLdri -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major 1 -minor 0 \
|
||||
-install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS)
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,8 @@ default: depend library
|
||||
library: $(TOP)/$(LIB_DIR)/libEGL.so
|
||||
|
||||
$(TOP)/$(LIB_DIR)/libEGL.so: $(OBJECTS)
|
||||
$(TOP)/bin/mklib -o EGL -ldflags '$(LDFLAGS)' -major 1 -minor 0 \
|
||||
$(MKLIB) -o EGL -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major 1 -minor 0 \
|
||||
-install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS)
|
||||
|
||||
|
||||
|
||||
@@ -25,10 +25,11 @@ glu.pc: glu.pc.in
|
||||
install: glu.pc
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
|
||||
$(INSTALL) $(TOP)/$(LIB_DIR)/libGLU.* $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(INSTALL) $(TOP)/$(LIB_DIR)/$(GLU_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(INSTALL) -m 644 glu.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
|
||||
|
||||
clean:
|
||||
-@for dir in $(SUBDIRS) ; do \
|
||||
(cd $$dir && $(MAKE) clean) ; \
|
||||
done
|
||||
-rm -f *.pc
|
||||
|
||||
@@ -45,7 +45,7 @@ $(TOP)/$(LIB_DIR):
|
||||
|
||||
# Make the library:
|
||||
$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
|
||||
@ $(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
@ $(MKLIB) -o $(GLU_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \
|
||||
$(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
|
||||
$(GLU_LIB_DEPS) $(OBJECTS)
|
||||
|
||||
@@ -136,9 +136,10 @@ $(TOP)/$(LIB_DIR):
|
||||
|
||||
# Make the library:
|
||||
$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
|
||||
$(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
|
||||
$(MKLIB) -o $(GLU_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \
|
||||
-cplusplus $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
|
||||
-exports glu.exports -id $(INSTALL_LIB_DIR)/lib$(GLU_LIB).$(GLU_MAJOR).dylib \
|
||||
$(GLU_LIB_DEPS) $(OBJECTS)
|
||||
|
||||
|
||||
|
||||
59
src/glu/sgi/glu.exports
Normal file
59
src/glu/sgi/glu.exports
Normal file
@@ -0,0 +1,59 @@
|
||||
gluBeginCurve
|
||||
gluBeginPolygon
|
||||
gluBeginSurface
|
||||
gluBeginTrim
|
||||
gluBuild1DMipmapLevels
|
||||
gluBuild1DMipmaps
|
||||
gluBuild2DMipmapLevels
|
||||
gluBuild2DMipmaps
|
||||
gluBuild3DMipmapLevels
|
||||
gluBuild3DMipmaps
|
||||
gluCheckExtension
|
||||
gluCylinder
|
||||
gluDeleteNurbsRenderer
|
||||
gluDeleteQuadric
|
||||
gluDeleteTess
|
||||
gluDisk
|
||||
gluEndCurve
|
||||
gluEndPolygon
|
||||
gluEndSurface
|
||||
gluEndTrim
|
||||
gluErrorString
|
||||
gluGetNurbsProperty
|
||||
gluGetString
|
||||
gluGetTessProperty
|
||||
gluLoadSamplingMatrices
|
||||
gluLookAt
|
||||
gluNewNurbsRenderer
|
||||
gluNewQuadric
|
||||
gluNewTess
|
||||
gluNextContour
|
||||
gluNurbsCallback
|
||||
gluNurbsCallbackData
|
||||
gluNurbsCallbackDataEXT
|
||||
gluNurbsCurve
|
||||
gluNurbsProperty
|
||||
gluNurbsSurface
|
||||
gluOrtho2D
|
||||
gluPartialDisk
|
||||
gluPerspective
|
||||
gluPickMatrix
|
||||
gluProject
|
||||
gluPwlCurve
|
||||
gluQuadricCallback
|
||||
gluQuadricDrawStyle
|
||||
gluQuadricNormals
|
||||
gluQuadricOrientation
|
||||
gluQuadricTexture
|
||||
gluScaleImage
|
||||
gluSphere
|
||||
gluTessBeginContour
|
||||
gluTessBeginPolygon
|
||||
gluTessCallback
|
||||
gluTessEndContour
|
||||
gluTessEndPolygon
|
||||
gluTessNormal
|
||||
gluTessProperty
|
||||
gluTessVertex
|
||||
gluUnProject
|
||||
gluUnProject4
|
||||
59
src/glu/sgi/glu.exports.darwin
Normal file
59
src/glu/sgi/glu.exports.darwin
Normal file
@@ -0,0 +1,59 @@
|
||||
_gluBeginCurve
|
||||
_gluBeginPolygon
|
||||
_gluBeginSurface
|
||||
_gluBeginTrim
|
||||
_gluBuild1DMipmapLevels
|
||||
_gluBuild1DMipmaps
|
||||
_gluBuild2DMipmapLevels
|
||||
_gluBuild2DMipmaps
|
||||
_gluBuild3DMipmapLevels
|
||||
_gluBuild3DMipmaps
|
||||
_gluCheckExtension
|
||||
_gluCylinder
|
||||
_gluDeleteNurbsRenderer
|
||||
_gluDeleteQuadric
|
||||
_gluDeleteTess
|
||||
_gluDisk
|
||||
_gluEndCurve
|
||||
_gluEndPolygon
|
||||
_gluEndSurface
|
||||
_gluEndTrim
|
||||
_gluErrorString
|
||||
_gluGetNurbsProperty
|
||||
_gluGetString
|
||||
_gluGetTessProperty
|
||||
_gluLoadSamplingMatrices
|
||||
_gluLookAt
|
||||
_gluNewNurbsRenderer
|
||||
_gluNewQuadric
|
||||
_gluNewTess
|
||||
_gluNextContour
|
||||
_gluNurbsCallback
|
||||
_gluNurbsCallbackData
|
||||
_gluNurbsCallbackDataEXT
|
||||
_gluNurbsCurve
|
||||
_gluNurbsProperty
|
||||
_gluNurbsSurface
|
||||
_gluOrtho2D
|
||||
_gluPartialDisk
|
||||
_gluPerspective
|
||||
_gluPickMatrix
|
||||
_gluProject
|
||||
_gluPwlCurve
|
||||
_gluQuadricCallback
|
||||
_gluQuadricDrawStyle
|
||||
_gluQuadricNormals
|
||||
_gluQuadricOrientation
|
||||
_gluQuadricTexture
|
||||
_gluScaleImage
|
||||
_gluSphere
|
||||
_gluTessBeginContour
|
||||
_gluTessBeginPolygon
|
||||
_gluTessCallback
|
||||
_gluTessEndContour
|
||||
_gluTessEndPolygon
|
||||
_gluTessNormal
|
||||
_gluTessProperty
|
||||
_gluTessVertex
|
||||
_gluUnProject
|
||||
_gluUnProject4
|
||||
@@ -83,10 +83,10 @@ $(TOP)/$(LIB_DIR):
|
||||
|
||||
# Make the library
|
||||
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
|
||||
@$(TOP)/bin/mklib -o $(GLUT_LIB) -ldflags '$(LDFLAGS)' \
|
||||
@$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
|
||||
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(GLUT_LIB_DEPS) \
|
||||
$(OBJECTS)
|
||||
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
|
||||
$(GLUT_LIB_DEPS) $(OBJECTS)
|
||||
|
||||
clean:
|
||||
-rm -f *.o
|
||||
|
||||
@@ -61,7 +61,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
|
||||
|
||||
# Make the library
|
||||
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
|
||||
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
|
||||
$(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \
|
||||
$(MKLIB_OPTIONS) $(OBJECTS)
|
||||
|
||||
@@ -63,7 +63,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
|
||||
|
||||
# Make the library
|
||||
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
|
||||
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
|
||||
$(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \
|
||||
$(MKLIB_OPTIONS) $(OBJECTS)
|
||||
|
||||
@@ -32,7 +32,7 @@ default: $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
|
||||
|
||||
# Make the library
|
||||
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
|
||||
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) \
|
||||
-patch $(GLUT_TINY) $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
|
||||
$(GLUT_LIB_DEPS) $(OBJECTS)
|
||||
|
||||
@@ -91,9 +91,10 @@ default: $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
|
||||
|
||||
# Make the library
|
||||
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
|
||||
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
|
||||
$(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
|
||||
-id $(INSTALL_LIB_DIR)/lib$(GLUT_LIB).$(GLUT_MAJOR).dylib \
|
||||
$(GLUT_LIB_DEPS) $(OBJECTS)
|
||||
|
||||
|
||||
@@ -111,7 +112,7 @@ install: glut.pc
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
|
||||
$(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL
|
||||
$(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(INSTALL) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
|
||||
|
||||
|
||||
@@ -119,6 +120,7 @@ clean:
|
||||
-rm -f *.o *~
|
||||
-rm -f *.lo
|
||||
-rm -f *.la
|
||||
-rm -f *.pc
|
||||
-rm -rf .libs
|
||||
-rm -f depend depend.bak
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
|
||||
|
||||
# Make the library
|
||||
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
|
||||
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
|
||||
$(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \
|
||||
$(MKLIB_OPTIONS) $(OBJECTS)
|
||||
@@ -93,6 +93,6 @@ install: glut.pc
|
||||
# Remove .o and backup files
|
||||
clean: depend
|
||||
-rm -f depend depend.bak
|
||||
-rm -f *.o *~ *.o *~ *.so libglut.so.3.7
|
||||
-rm -f *.o *~ *.o *~ *.so *.pc libglut.so.3.7
|
||||
|
||||
include depend
|
||||
|
||||
@@ -7,7 +7,7 @@ MAJOR = 1
|
||||
MINOR = 0
|
||||
TINY = 0
|
||||
|
||||
INCDIRS = -I$(TOP)/include -I/usr/include/Motif1.2 $(X11_INCLUDES)
|
||||
INCDIRS = -I$(TOP)/include $(MOTIF_CFLAGS) $(X11_INCLUDES)
|
||||
|
||||
|
||||
OBJECTS = $(GLW_SOURCES:.c=.o)
|
||||
@@ -39,19 +39,20 @@ install: glw.pc
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
|
||||
$(INSTALL) -m 644 *.h $(DESTDIR)$(INSTALL_INC_DIR)/GL
|
||||
$(INSTALL) $(TOP)/$(LIB_DIR)/libGLw.* $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(INSTALL) $(TOP)/$(LIB_DIR)/$(GLW_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(INSTALL) -m 644 glw.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
|
||||
|
||||
clean:
|
||||
-rm -f depend depend.bak
|
||||
-rm -f *.o *~
|
||||
-rm -f *.o *.pc *~
|
||||
|
||||
|
||||
# Make the library
|
||||
$(TOP)/$(LIB_DIR)/$(GLW_LIB_NAME): $(OBJECTS)
|
||||
$(TOP)/bin/mklib -o $(GLW_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
$(MKLIB) -o $(GLW_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(MAJOR) -minor $(MINOR) -patch $(TINY) \
|
||||
$(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
|
||||
-id $(INSTALL_LIB_DIR)/lib$(GLW_LIB).$(MAJOR).dylib \
|
||||
$(GLW_LIB_DEPS) $(OBJECTS)
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/miniglx.conf
|
||||
|
||||
# Make libGL
|
||||
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
|
||||
@ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
@ $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major 1 -minor 2 $(MKLIB_OPTIONS) \
|
||||
-install $(TOP)/$(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS) \
|
||||
$(LIBDRM_LIB) $(PCIACCESS_LIB)
|
||||
|
||||
@@ -71,9 +71,10 @@ default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
|
||||
|
||||
# Make libGL
|
||||
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
|
||||
$(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
$(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major 1 -minor 2 $(MKLIB_OPTIONS) \
|
||||
-install $(TOP)/$(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS)
|
||||
-install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \
|
||||
$(GL_LIB_DEPS) $(OBJECTS)
|
||||
|
||||
|
||||
depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_ASM_API) Makefile
|
||||
|
||||
@@ -308,7 +308,7 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
driBindExtensions(psc);
|
||||
driBindExtensions(psc, 1);
|
||||
|
||||
psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
|
||||
psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
|
||||
|
||||
@@ -329,7 +329,7 @@ driConvertConfigs(const __DRIcoreExtension *core,
|
||||
}
|
||||
|
||||
_X_HIDDEN void
|
||||
driBindExtensions(__GLXscreenConfigs *psc)
|
||||
driBindExtensions(__GLXscreenConfigs *psc, int dri2)
|
||||
{
|
||||
const __DRIextension **extensions;
|
||||
int i;
|
||||
@@ -386,7 +386,7 @@ driBindExtensions(__GLXscreenConfigs *psc)
|
||||
#endif
|
||||
|
||||
#ifdef __DRI_TEX_BUFFER
|
||||
if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) {
|
||||
if ((strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) && dri2) {
|
||||
psc->texBuffer = (__DRItexBufferExtension *) extensions[i];
|
||||
__glXEnableDirectExtension(psc, "GLX_EXT_texture_from_pixmap");
|
||||
}
|
||||
|
||||
@@ -55,6 +55,6 @@ extern void ErrorMessageF(const char *f, ...);
|
||||
|
||||
extern void *driOpenDriver(const char *driverName);
|
||||
|
||||
extern void driBindExtensions(__GLXscreenConfigs *psc);
|
||||
extern void driBindExtensions(__GLXscreenConfigs *psc, int dri2);
|
||||
|
||||
#endif /* _DRI_COMMON_H */
|
||||
|
||||
@@ -635,7 +635,7 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
driBindExtensions(psc);
|
||||
driBindExtensions(psc, 0);
|
||||
|
||||
psp->destroyScreen = driDestroyScreen;
|
||||
psp->createContext = driCreateContext;
|
||||
|
||||
@@ -390,7 +390,7 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen,
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
driBindExtensions(psc);
|
||||
driBindExtensions(psc, 0);
|
||||
|
||||
psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
|
||||
psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
|
||||
|
||||
@@ -66,6 +66,8 @@
|
||||
# include <pthread.h>
|
||||
#endif
|
||||
|
||||
#include "glxextensions.h"
|
||||
|
||||
#define GLX_MAJOR_VERSION 1 /* current version numbers */
|
||||
#define GLX_MINOR_VERSION 4
|
||||
|
||||
|
||||
@@ -423,7 +423,11 @@ CreateContext(Display *dpy, XVisualInfo *vis,
|
||||
req->visual = vis->visualid;
|
||||
req->screen = vis->screen;
|
||||
req->shareList = shareList ? shareList->xid : None;
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
req->isDirect = gc->driContext != NULL;
|
||||
#else
|
||||
req->isDirect = 0;
|
||||
#endif
|
||||
}
|
||||
else if ( use_glx_1_3 ) {
|
||||
xGLXCreateNewContextReq *req;
|
||||
@@ -437,7 +441,11 @@ CreateContext(Display *dpy, XVisualInfo *vis,
|
||||
req->screen = fbconfig->screen;
|
||||
req->renderType = renderType;
|
||||
req->shareList = shareList ? shareList->xid : None;
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
req->isDirect = gc->driContext != NULL;
|
||||
#else
|
||||
req->isDirect = 0;
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
xGLXVendorPrivateWithReplyReq *vpreq;
|
||||
@@ -455,7 +463,11 @@ CreateContext(Display *dpy, XVisualInfo *vis,
|
||||
req->screen = fbconfig->screen;
|
||||
req->renderType = renderType;
|
||||
req->shareList = shareList ? shareList->xid : None;
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
req->isDirect = gc->driContext != NULL;
|
||||
#else
|
||||
req->isDirect = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
UnlockDisplay(dpy);
|
||||
@@ -1525,7 +1537,11 @@ glXQueryContext(Display *dpy, GLXContext ctx, int attribute, int *value)
|
||||
int retVal;
|
||||
|
||||
/* get the information from the server if we don't have it already */
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (!ctx->driContext && (ctx->mode == NULL)) {
|
||||
#else
|
||||
if (ctx->mode == NULL) {
|
||||
#endif
|
||||
retVal = __glXQueryContextInfo(dpy, ctx);
|
||||
if (Success != retVal) return retVal;
|
||||
}
|
||||
|
||||
@@ -399,8 +399,12 @@ static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
|
||||
return False;
|
||||
}
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if ((dpy != oldGC->currentDpy || (gc && gc->driContext)) &&
|
||||
!oldGC->isDirect && oldGC != &dummyContext) {
|
||||
#else
|
||||
if ((dpy != oldGC->currentDpy) && oldGC != &dummyContext) {
|
||||
#endif
|
||||
xGLXMakeCurrentReply dummy_reply;
|
||||
|
||||
/* We are either switching from one dpy to another and have to
|
||||
@@ -462,7 +466,9 @@ static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
|
||||
gc->currentDrawable = draw;
|
||||
gc->currentReadable = read;
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (!gc->driContext) {
|
||||
#endif
|
||||
if (!IndirectAPI)
|
||||
IndirectAPI = __glXNewIndirectAPI();
|
||||
_glapi_set_dispatch(IndirectAPI);
|
||||
@@ -483,10 +489,12 @@ static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
|
||||
(void) glGetString(GL_VERSION);
|
||||
__glXInitVertexArrayState(gc);
|
||||
}
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
}
|
||||
else {
|
||||
gc->currentContextTag = -1;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
__glXSetCurrentContextNull();
|
||||
}
|
||||
|
||||
@@ -595,9 +595,9 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
|
||||
getVisualConfigs(dpy, priv, i);
|
||||
getFBConfigs(dpy, priv, i);
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
psc->scr = i;
|
||||
psc->dpy = dpy;
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
psc->drawHash = __glxHashCreate();
|
||||
if (psc->drawHash == NULL)
|
||||
continue;
|
||||
|
||||
@@ -244,7 +244,7 @@ extern GLboolean __glExtensionBitIsEnabled( const struct __GLXcontextRec * gc,
|
||||
unsigned bit );
|
||||
|
||||
extern void
|
||||
__glXEnableDirectExtension(__GLXscreenConfigs *psc, const char *name);
|
||||
__glXEnableDirectExtension(struct __GLXscreenConfigsRec *psc, const char *name);
|
||||
|
||||
/* Source-level backwards compatibility with old drivers. They won't
|
||||
* find the respective functions, though.
|
||||
|
||||
@@ -101,7 +101,6 @@ typedef struct __glxHashBucket {
|
||||
typedef struct __glxHashTable *__glxHashTablePtr;
|
||||
struct __glxHashTable {
|
||||
unsigned long magic;
|
||||
unsigned long entries;
|
||||
unsigned long hits; /* At top of linked list */
|
||||
unsigned long partials; /* Not at top of linked list */
|
||||
unsigned long misses; /* Not in table */
|
||||
@@ -146,7 +145,6 @@ _X_HIDDEN __glxHashTable *__glxHashCreate(void)
|
||||
table = HASH_ALLOC(sizeof(*table));
|
||||
if (!table) return NULL;
|
||||
table->magic = HASH_MAGIC;
|
||||
table->entries = 0;
|
||||
table->hits = 0;
|
||||
table->partials = 0;
|
||||
table->misses = 0;
|
||||
@@ -319,8 +317,8 @@ static void compute_dist(__glxHashTablePtr table)
|
||||
int i;
|
||||
__glxHashBucketPtr bucket;
|
||||
|
||||
printf("Entries = %ld, hits = %ld, partials = %ld, misses = %ld\n",
|
||||
table->entries, table->hits, table->partials, table->misses);
|
||||
printf("Hits = %ld, partials = %ld, misses = %ld\n",
|
||||
table->hits, table->partials, table->misses);
|
||||
clear_dist();
|
||||
for (i = 0; i < HASH_SIZE; i++) {
|
||||
bucket = table->buckets[i];
|
||||
|
||||
@@ -5124,10 +5124,13 @@ glAreTexturesResidentEXT(GLsizei n, const GLuint * textures,
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
return CALL_AreTexturesResident(GET_DISPATCH(),
|
||||
(n, textures, residences));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
Display *const dpy = gc->currentDpy;
|
||||
GLboolean retval = (GLboolean) 0;
|
||||
@@ -5274,9 +5277,12 @@ glDeleteTexturesEXT(GLsizei n, const GLuint * textures)
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_DeleteTextures(GET_DISPATCH(), (n, textures));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
Display *const dpy = gc->currentDpy;
|
||||
const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
|
||||
@@ -5342,9 +5348,12 @@ glGenTexturesEXT(GLsizei n, GLuint * textures)
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GenTextures(GET_DISPATCH(), (n, textures));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
Display *const dpy = gc->currentDpy;
|
||||
const GLuint cmdlen = 4;
|
||||
@@ -5404,9 +5413,12 @@ glIsTextureEXT(GLuint texture)
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
return CALL_IsTexture(GET_DISPATCH(), (texture));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
Display *const dpy = gc->currentDpy;
|
||||
GLboolean retval = (GLboolean) 0;
|
||||
@@ -5718,9 +5730,12 @@ glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table)
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
const __GLXattribute *const state = gc->client_state_private;
|
||||
Display *const dpy = gc->currentDpy;
|
||||
@@ -5791,10 +5806,13 @@ glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params)
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetColorTableParameterfv(GET_DISPATCH(),
|
||||
(target, pname, params));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
Display *const dpy = gc->currentDpy;
|
||||
const GLuint cmdlen = 8;
|
||||
@@ -5861,10 +5879,13 @@ glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params)
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetColorTableParameteriv(GET_DISPATCH(),
|
||||
(target, pname, params));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
Display *const dpy = gc->currentDpy;
|
||||
const GLuint cmdlen = 8;
|
||||
@@ -6184,10 +6205,13 @@ gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type,
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetConvolutionFilter(GET_DISPATCH(),
|
||||
(target, format, type, image));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
const __GLXattribute *const state = gc->client_state_private;
|
||||
Display *const dpy = gc->currentDpy;
|
||||
@@ -6259,10 +6283,13 @@ gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params)
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetConvolutionParameterfv(GET_DISPATCH(),
|
||||
(target, pname, params));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
Display *const dpy = gc->currentDpy;
|
||||
const GLuint cmdlen = 8;
|
||||
@@ -6329,10 +6356,13 @@ gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params)
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetConvolutionParameteriv(GET_DISPATCH(),
|
||||
(target, pname, params));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
Display *const dpy = gc->currentDpy;
|
||||
const GLuint cmdlen = 8;
|
||||
@@ -6406,10 +6436,13 @@ gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format,
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetHistogram(GET_DISPATCH(),
|
||||
(target, reset, format, type, values));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
const __GLXattribute *const state = gc->client_state_private;
|
||||
Display *const dpy = gc->currentDpy;
|
||||
@@ -6480,9 +6513,12 @@ gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params)
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
Display *const dpy = gc->currentDpy;
|
||||
const GLuint cmdlen = 8;
|
||||
@@ -6548,9 +6584,12 @@ gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params)
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
Display *const dpy = gc->currentDpy;
|
||||
const GLuint cmdlen = 8;
|
||||
@@ -6620,9 +6659,12 @@ gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format,
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
const __GLXattribute *const state = gc->client_state_private;
|
||||
Display *const dpy = gc->currentDpy;
|
||||
@@ -6691,9 +6733,12 @@ gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params)
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
Display *const dpy = gc->currentDpy;
|
||||
const GLuint cmdlen = 8;
|
||||
@@ -6756,9 +6801,12 @@ gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params)
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||
Display *const dpy = gc->currentDpy;
|
||||
const GLuint cmdlen = 8;
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
* "vbo", to support multiple texture coordinate arrays, generic attributes,
|
||||
* and vertex buffer objects.
|
||||
*
|
||||
* \author Ian Romanick <idr@us.ibm.com>
|
||||
* \author Ian Romanick <ian.d.romanick@intel.com>
|
||||
*/
|
||||
|
||||
static void emit_DrawArrays_none( GLenum mode, GLint first, GLsizei count );
|
||||
@@ -1601,17 +1601,21 @@ void __indirect_glClientActiveTextureARB(GLenum texture)
|
||||
|
||||
|
||||
/**
|
||||
* Modify the enable state for the selected array
|
||||
*/
|
||||
GLboolean
|
||||
__glXSetArrayEnable( __GLXattribute * state,
|
||||
GLenum key, unsigned index, GLboolean enable )
|
||||
__glXSetArrayEnable(__GLXattribute *state, GLenum key, unsigned index,
|
||||
GLboolean enable)
|
||||
{
|
||||
struct array_state_vector * arrays = state->array_state;
|
||||
struct array_state * a;
|
||||
|
||||
|
||||
if ( key == GL_TEXTURE_COORD_ARRAY ) {
|
||||
index = arrays->active_texture_unit;
|
||||
/* Texture coordinate arrays have an implict index set when the
|
||||
* application calls glClientActiveTexture.
|
||||
*/
|
||||
if (key == GL_TEXTURE_COORD_ARRAY) {
|
||||
index = arrays->active_texture_unit;
|
||||
}
|
||||
|
||||
a = get_array_entry( arrays, key, index );
|
||||
|
||||
@@ -119,12 +119,14 @@ void NAME(_gloffset_GetSeparableFilter)(GLenum target, GLenum format, GLenum typ
|
||||
{
|
||||
__GLXcontext * const gc = __glXGetCurrentContext();
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->driContext) {
|
||||
CALL_GetSeparableFilter(GET_DISPATCH(),
|
||||
(target, format, type, row, column, span));
|
||||
return;
|
||||
}
|
||||
else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
Display *const dpy = gc->currentDpy;
|
||||
const GLuint cmdlen = __GLX_PAD(13);
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ default: depend asm_subdirs libmesa.a libglapi.a driver_subdirs
|
||||
|
||||
# Make archive of core mesa object files
|
||||
libmesa.a: $(MESA_OBJECTS)
|
||||
@ $(TOP)/bin/mklib -o mesa -static $(MESA_OBJECTS)
|
||||
@ $(MKLIB) -o mesa -static $(MESA_OBJECTS)
|
||||
|
||||
# Make archive of gl* API dispatcher functions only
|
||||
libglapi.a: $(GLAPI_OBJECTS)
|
||||
@ $(TOP)/bin/mklib -o glapi -static $(GLAPI_OBJECTS)
|
||||
@ $(MKLIB) -o glapi -static $(GLAPI_OBJECTS)
|
||||
|
||||
|
||||
######################################################################
|
||||
@@ -105,13 +105,13 @@ install-headers:
|
||||
install-libgl: default gl.pc install-headers
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
|
||||
$(INSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)* \
|
||||
$(INSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB) \
|
||||
$(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
|
||||
|
||||
install-osmesa: default
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(INSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)* \
|
||||
$(INSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_GLOB) \
|
||||
$(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
|
||||
install-dri: default
|
||||
@@ -129,6 +129,7 @@ clean:
|
||||
-rm -f */*/*.o
|
||||
-rm -f depend depend.bak libmesa.a libglapi.a
|
||||
-rm -f drivers/*/*.o
|
||||
-rm -f *.pc
|
||||
-@cd drivers/dri && $(MAKE) clean
|
||||
-@cd drivers/x11 && $(MAKE) clean
|
||||
-@cd drivers/osmesa && $(MAKE) clean
|
||||
|
||||
@@ -181,9 +181,10 @@ $(TOP)/$(LIB_DIR):
|
||||
mkdir $(TOP)/$(LIB_DIR)
|
||||
|
||||
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) $(MESA_MODULES) $(GLU_MODULES)
|
||||
@$(TOP)/bin/mklib -o $(GL_LIB) -ldflags '$(LDFLAGS)' -install $(TOP)/$(LIB_DIR) \
|
||||
@$(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
|
||||
$(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(OBJECTS) $(MESA_MODULES) $(GLU_MODULES)
|
||||
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(GL_LIB_DEPS) \
|
||||
$(OBJECTS) $(MESA_MODULES) $(GLU_MODULES)
|
||||
|
||||
# $(GLU_OBJECTS):
|
||||
# cd $(GLU_DIR) && $(MAKE) $< ;
|
||||
|
||||
@@ -37,7 +37,7 @@ default: directfb-libgl directfbgl_mesa
|
||||
|
||||
# XXX this used to be in src/mesa/Makefile and is probably broken now
|
||||
directfb-libgl: $(LIBS)
|
||||
@ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
@ $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
|
||||
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(LIBS) \
|
||||
$(GL_LIB_DEPS)
|
||||
|
||||
@@ -53,3 +53,4 @@ clean:
|
||||
fi \
|
||||
done
|
||||
-rm -f common/*.o
|
||||
-rm -f *.pc
|
||||
|
||||
@@ -10,11 +10,6 @@ COMMON_SOURCES = \
|
||||
../common/xmlconfig.c \
|
||||
../common/drirenderbuffer.c
|
||||
|
||||
COMMON_BM_SOURCES = \
|
||||
../common/dri_bufmgr.c \
|
||||
../common/dri_bufmgr_fake.c
|
||||
|
||||
|
||||
ifeq ($(WINDOW_SYSTEM),dri)
|
||||
WINOBJ=
|
||||
WINLIB=
|
||||
@@ -68,7 +63,7 @@ default: symlinks depend $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
|
||||
|
||||
|
||||
$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
|
||||
$(TOP)/bin/mklib -ldflags '$(LDFLAGS)' -noprefix -o $@ \
|
||||
$(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
$(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ static void TAG(WriteDepthSpan)( GLcontext *ctx,
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLuint *depth = (const GLuint *) values;
|
||||
const VALUE_TYPE *depth = (const VALUE_TYPE *) values;
|
||||
GLint x1;
|
||||
GLint n1;
|
||||
LOCAL_DEPTH_VARS;
|
||||
@@ -134,7 +134,7 @@ static void TAG(WriteDepthPixels)( GLcontext *ctx,
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLuint *depth = (const GLuint *) values;
|
||||
const VALUE_TYPE *depth = (const VALUE_TYPE *) values;
|
||||
GLuint i;
|
||||
LOCAL_DEPTH_VARS;
|
||||
|
||||
@@ -180,7 +180,7 @@ static void TAG(ReadDepthSpan)( GLcontext *ctx,
|
||||
{
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLuint *depth = (GLuint *) values;
|
||||
VALUE_TYPE *depth = (VALUE_TYPE *) values;
|
||||
GLint x1, n1;
|
||||
LOCAL_DEPTH_VARS;
|
||||
|
||||
@@ -215,7 +215,7 @@ static void TAG(ReadDepthPixels)( GLcontext *ctx,
|
||||
{
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLuint *depth = (GLuint *) values;
|
||||
VALUE_TYPE *depth = (VALUE_TYPE *) values;
|
||||
GLuint i;
|
||||
LOCAL_DEPTH_VARS;
|
||||
|
||||
@@ -267,3 +267,4 @@ static void TAG(InitDepthPointers)(struct gl_renderbuffer *rb)
|
||||
#undef READ_DEPTH
|
||||
#endif
|
||||
#undef TAG
|
||||
#undef VALUE_TYPE
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2007 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Eric Anholt <eric@anholt.net>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include "mtypes.h"
|
||||
#include "dri_bufmgr.h"
|
||||
|
||||
/** @file dri_bufmgr.c
|
||||
*
|
||||
* Convenience functions for buffer management methods.
|
||||
*/
|
||||
|
||||
dri_bo *
|
||||
dri_bo_alloc(dri_bufmgr *bufmgr, const char *name, unsigned long size,
|
||||
unsigned int alignment, uint64_t location_mask)
|
||||
{
|
||||
return bufmgr->bo_alloc(bufmgr, name, size, alignment, location_mask);
|
||||
}
|
||||
|
||||
dri_bo *
|
||||
dri_bo_alloc_static(dri_bufmgr *bufmgr, const char *name, unsigned long offset,
|
||||
unsigned long size, void *virtual,
|
||||
uint64_t location_mask)
|
||||
{
|
||||
return bufmgr->bo_alloc_static(bufmgr, name, offset, size, virtual,
|
||||
location_mask);
|
||||
}
|
||||
|
||||
void
|
||||
dri_bo_reference(dri_bo *bo)
|
||||
{
|
||||
bo->bufmgr->bo_reference(bo);
|
||||
}
|
||||
|
||||
void
|
||||
dri_bo_unreference(dri_bo *bo)
|
||||
{
|
||||
if (bo == NULL)
|
||||
return;
|
||||
|
||||
bo->bufmgr->bo_unreference(bo);
|
||||
}
|
||||
|
||||
int
|
||||
dri_bo_map(dri_bo *buf, GLboolean write_enable)
|
||||
{
|
||||
return buf->bufmgr->bo_map(buf, write_enable);
|
||||
}
|
||||
|
||||
int
|
||||
dri_bo_unmap(dri_bo *buf)
|
||||
{
|
||||
return buf->bufmgr->bo_unmap(buf);
|
||||
}
|
||||
|
||||
void
|
||||
dri_fence_wait(dri_fence *fence)
|
||||
{
|
||||
fence->bufmgr->fence_wait(fence);
|
||||
}
|
||||
|
||||
void
|
||||
dri_fence_reference(dri_fence *fence)
|
||||
{
|
||||
fence->bufmgr->fence_reference(fence);
|
||||
}
|
||||
|
||||
void
|
||||
dri_fence_unreference(dri_fence *fence)
|
||||
{
|
||||
if (fence == NULL)
|
||||
return;
|
||||
|
||||
fence->bufmgr->fence_unreference(fence);
|
||||
}
|
||||
|
||||
void
|
||||
dri_bo_subdata(dri_bo *bo, unsigned long offset,
|
||||
unsigned long size, const void *data)
|
||||
{
|
||||
if (size == 0 || data == NULL)
|
||||
return;
|
||||
|
||||
dri_bo_map(bo, GL_TRUE);
|
||||
memcpy((unsigned char *)bo->virtual + offset, data, size);
|
||||
dri_bo_unmap(bo);
|
||||
}
|
||||
|
||||
void
|
||||
dri_bo_get_subdata(dri_bo *bo, unsigned long offset,
|
||||
unsigned long size, void *data)
|
||||
{
|
||||
if (size == 0 || data == NULL)
|
||||
return;
|
||||
|
||||
dri_bo_map(bo, GL_FALSE);
|
||||
memcpy(data, (unsigned char *)bo->virtual + offset, size);
|
||||
dri_bo_unmap(bo);
|
||||
}
|
||||
|
||||
void
|
||||
dri_bufmgr_destroy(dri_bufmgr *bufmgr)
|
||||
{
|
||||
bufmgr->destroy(bufmgr);
|
||||
}
|
||||
|
||||
|
||||
int dri_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta,
|
||||
GLuint offset, dri_bo *target_buf)
|
||||
{
|
||||
return reloc_buf->bufmgr->emit_reloc(reloc_buf, flags, delta, offset, target_buf);
|
||||
}
|
||||
|
||||
void *dri_process_relocs(dri_bo *batch_buf, GLuint *count)
|
||||
{
|
||||
return batch_buf->bufmgr->process_relocs(batch_buf, count);
|
||||
}
|
||||
|
||||
void dri_post_submit(dri_bo *batch_buf, dri_fence **last_fence)
|
||||
{
|
||||
batch_buf->bufmgr->post_submit(batch_buf, last_fence);
|
||||
}
|
||||
|
||||
void
|
||||
dri_bufmgr_set_debug(dri_bufmgr *bufmgr, GLboolean enable_debug)
|
||||
{
|
||||
bufmgr->debug = enable_debug;
|
||||
}
|
||||
|
||||
int
|
||||
dri_bufmgr_check_aperture_space(dri_bo *bo)
|
||||
{
|
||||
return bo->bufmgr->check_aperture_space(bo);
|
||||
}
|
||||
@@ -1,260 +0,0 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright <20> 2007 Intel Corporation
|
||||
* Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
*
|
||||
**************************************************************************/
|
||||
/*
|
||||
* Authors: Thomas Hellstr<74>m <thomas-at-tungstengraphics-dot-com>
|
||||
* Keith Whitwell <keithw-at-tungstengraphics-dot-com>
|
||||
* Eric Anholt <eric@anholt.net>
|
||||
*/
|
||||
|
||||
#ifndef _DRI_BUFMGR_H_
|
||||
#define _DRI_BUFMGR_H_
|
||||
#include <xf86drm.h>
|
||||
|
||||
typedef struct _dri_bufmgr dri_bufmgr;
|
||||
typedef struct _dri_bo dri_bo;
|
||||
typedef struct _dri_fence dri_fence;
|
||||
|
||||
struct _dri_bo {
|
||||
/** Size in bytes of the buffer object. */
|
||||
unsigned long size;
|
||||
/**
|
||||
* Card virtual address (offset from the beginning of the aperture) for the
|
||||
* object. Only valid while validated.
|
||||
*/
|
||||
unsigned long offset;
|
||||
/**
|
||||
* Virtual address for accessing the buffer data. Only valid while mapped.
|
||||
*/
|
||||
void *virtual;
|
||||
/** Buffer manager context associated with this buffer object */
|
||||
dri_bufmgr *bufmgr;
|
||||
};
|
||||
|
||||
struct _dri_fence {
|
||||
/**
|
||||
* This is an ORed mask of DRM_BO_FLAG_READ, DRM_BO_FLAG_WRITE, and
|
||||
* DRM_FLAG_EXE indicating the operations associated with this fence.
|
||||
*
|
||||
* It is constant for the life of the fence object.
|
||||
*/
|
||||
unsigned int type;
|
||||
/** Buffer manager context associated with this fence */
|
||||
dri_bufmgr *bufmgr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Context for a buffer manager instance.
|
||||
*
|
||||
* Contains public methods followed by private storage for the buffer manager.
|
||||
*/
|
||||
struct _dri_bufmgr {
|
||||
/**
|
||||
* Allocate a buffer object.
|
||||
*
|
||||
* Buffer objects are not necessarily initially mapped into CPU virtual
|
||||
* address space or graphics device aperture. They must be mapped using
|
||||
* bo_map() to be used by the CPU, and validated for use using bo_validate()
|
||||
* to be used from the graphics device.
|
||||
*/
|
||||
dri_bo *(*bo_alloc)(dri_bufmgr *bufmgr_ctx, const char *name,
|
||||
unsigned long size, unsigned int alignment,
|
||||
uint64_t location_mask);
|
||||
|
||||
/**
|
||||
* Allocates a buffer object for a static allocation.
|
||||
*
|
||||
* Static allocations are ones such as the front buffer that are offered by
|
||||
* the X Server, which are never evicted and never moved.
|
||||
*/
|
||||
dri_bo *(*bo_alloc_static)(dri_bufmgr *bufmgr_ctx, const char *name,
|
||||
unsigned long offset, unsigned long size,
|
||||
void *virtual, uint64_t location_mask);
|
||||
|
||||
/** Takes a reference on a buffer object */
|
||||
void (*bo_reference)(dri_bo *bo);
|
||||
|
||||
/**
|
||||
* Releases a reference on a buffer object, freeing the data if
|
||||
* rerefences remain.
|
||||
*/
|
||||
void (*bo_unreference)(dri_bo *bo);
|
||||
|
||||
/**
|
||||
* Maps the buffer into userspace.
|
||||
*
|
||||
* This function will block waiting for any existing fence on the buffer to
|
||||
* clear, first. The resulting mapping is available at buf->virtual.
|
||||
\ */
|
||||
int (*bo_map)(dri_bo *buf, GLboolean write_enable);
|
||||
|
||||
/** Reduces the refcount on the userspace mapping of the buffer object. */
|
||||
int (*bo_unmap)(dri_bo *buf);
|
||||
|
||||
/** Takes a reference on a fence object */
|
||||
void (*fence_reference)(dri_fence *fence);
|
||||
|
||||
/**
|
||||
* Releases a reference on a fence object, freeing the data if
|
||||
* rerefences remain.
|
||||
*/
|
||||
void (*fence_unreference)(dri_fence *fence);
|
||||
|
||||
/**
|
||||
* Blocks until the given fence is signaled.
|
||||
*/
|
||||
void (*fence_wait)(dri_fence *fence);
|
||||
|
||||
/**
|
||||
* Tears down the buffer manager instance.
|
||||
*/
|
||||
void (*destroy)(dri_bufmgr *bufmgr);
|
||||
|
||||
/**
|
||||
* Add relocation entry in reloc_buf, which will be updated with the
|
||||
* target buffer's real offset on on command submission.
|
||||
*
|
||||
* Relocations remain in place for the lifetime of the buffer object.
|
||||
*
|
||||
* \param reloc_buf Buffer to write the relocation into.
|
||||
* \param flags BO flags to be used in validating the target buffer.
|
||||
* Applicable flags include:
|
||||
* - DRM_BO_FLAG_READ: The buffer will be read in the process of
|
||||
* command execution.
|
||||
* - DRM_BO_FLAG_WRITE: The buffer will be written in the process of
|
||||
* command execution.
|
||||
* - DRM_BO_FLAG_MEM_TT: The buffer should be validated in TT memory.
|
||||
* - DRM_BO_FLAG_MEM_VRAM: The buffer should be validated in video
|
||||
* memory.
|
||||
* \param delta Constant value to be added to the relocation target's offset.
|
||||
* \param offset Byte offset within batch_buf of the relocated pointer.
|
||||
* \param target Buffer whose offset should be written into the relocation
|
||||
* entry.
|
||||
*/
|
||||
int (*emit_reloc)(dri_bo *reloc_buf, uint64_t flags, GLuint delta,
|
||||
GLuint offset, dri_bo *target);
|
||||
|
||||
/**
|
||||
* Processes the relocations, either in userland or by converting the list
|
||||
* for use in batchbuffer submission.
|
||||
*
|
||||
* Kernel-based implementations will return a pointer to the arguments
|
||||
* to be handed with batchbuffer submission to the kernel. The userland
|
||||
* implementation performs the buffer validation and emits relocations
|
||||
* into them the appopriate order.
|
||||
*
|
||||
* \param batch_buf buffer at the root of the tree of relocations
|
||||
* \param count returns the number of buffers validated.
|
||||
* \return relocation record for use in command submission.
|
||||
* */
|
||||
void *(*process_relocs)(dri_bo *batch_buf, GLuint *count);
|
||||
|
||||
void (*post_submit)(dri_bo *batch_buf, dri_fence **fence);
|
||||
|
||||
int (*check_aperture_space)(dri_bo *bo);
|
||||
GLboolean debug; /**< Enables verbose debugging printouts */
|
||||
};
|
||||
|
||||
dri_bo *dri_bo_alloc(dri_bufmgr *bufmgr, const char *name, unsigned long size,
|
||||
unsigned int alignment, uint64_t location_mask);
|
||||
dri_bo *dri_bo_alloc_static(dri_bufmgr *bufmgr, const char *name,
|
||||
unsigned long offset, unsigned long size,
|
||||
void *virtual, uint64_t location_mask);
|
||||
void dri_bo_reference(dri_bo *bo);
|
||||
void dri_bo_unreference(dri_bo *bo);
|
||||
int dri_bo_map(dri_bo *buf, GLboolean write_enable);
|
||||
int dri_bo_unmap(dri_bo *buf);
|
||||
void dri_fence_wait(dri_fence *fence);
|
||||
void dri_fence_reference(dri_fence *fence);
|
||||
void dri_fence_unreference(dri_fence *fence);
|
||||
|
||||
void dri_bo_subdata(dri_bo *bo, unsigned long offset,
|
||||
unsigned long size, const void *data);
|
||||
void dri_bo_get_subdata(dri_bo *bo, unsigned long offset,
|
||||
unsigned long size, void *data);
|
||||
|
||||
void dri_bufmgr_fake_contended_lock_take(dri_bufmgr *bufmgr);
|
||||
dri_bufmgr *dri_bufmgr_fake_init(unsigned long low_offset, void *low_virtual,
|
||||
unsigned long size,
|
||||
unsigned int (*fence_emit)(void *private),
|
||||
int (*fence_wait)(void *private,
|
||||
unsigned int cookie),
|
||||
void *driver_priv);
|
||||
void dri_bufmgr_set_debug(dri_bufmgr *bufmgr, GLboolean enable_debug);
|
||||
void dri_bo_fake_disable_backing_store(dri_bo *bo,
|
||||
void (*invalidate_cb)(dri_bo *bo,
|
||||
void *ptr),
|
||||
void *ptr);
|
||||
void dri_bufmgr_destroy(dri_bufmgr *bufmgr);
|
||||
|
||||
int dri_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta,
|
||||
GLuint offset, dri_bo *target_buf);
|
||||
void *dri_process_relocs(dri_bo *batch_buf, uint32_t *count);
|
||||
void dri_post_process_relocs(dri_bo *batch_buf);
|
||||
void dri_post_submit(dri_bo *batch_buf, dri_fence **last_fence);
|
||||
int dri_bufmgr_check_aperture_space(dri_bo *bo);
|
||||
|
||||
#ifndef TTM_API
|
||||
/* reuse some TTM API */
|
||||
|
||||
#define DRM_BO_MEM_LOCAL 0
|
||||
#define DRM_BO_MEM_TT 1
|
||||
#define DRM_BO_MEM_VRAM 2
|
||||
#define DRM_BO_MEM_PRIV0 3
|
||||
#define DRM_BO_MEM_PRIV1 4
|
||||
#define DRM_BO_MEM_PRIV2 5
|
||||
#define DRM_BO_MEM_PRIV3 6
|
||||
#define DRM_BO_MEM_PRIV4 7
|
||||
|
||||
#define DRM_BO_FLAG_READ (1ULL << 0)
|
||||
#define DRM_BO_FLAG_WRITE (1ULL << 1)
|
||||
#define DRM_BO_FLAG_EXE (1ULL << 2)
|
||||
#define DRM_BO_MASK_ACCESS (DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_EXE)
|
||||
#define DRM_BO_FLAG_NO_EVICT (1ULL << 4)
|
||||
|
||||
#define DRM_BO_FLAG_MAPPABLE (1ULL << 5)
|
||||
#define DRM_BO_FLAG_SHAREABLE (1ULL << 6)
|
||||
|
||||
#define DRM_BO_FLAG_CACHED (1ULL << 7)
|
||||
|
||||
#define DRM_BO_FLAG_NO_MOVE (1ULL << 8)
|
||||
#define DRM_BO_FLAG_CACHED_MAPPED (1ULL << 19)
|
||||
#define DRM_BO_FLAG_FORCE_CACHING (1ULL << 13)
|
||||
#define DRM_BO_FLAG_FORCE_MAPPABLE (1ULL << 14)
|
||||
#define DRM_BO_FLAG_TILE (1ULL << 15)
|
||||
|
||||
#define DRM_BO_FLAG_MEM_LOCAL (1ULL << 24)
|
||||
#define DRM_BO_FLAG_MEM_TT (1ULL << 25)
|
||||
#define DRM_BO_FLAG_MEM_VRAM (1ULL << 26)
|
||||
|
||||
#define DRM_BO_MASK_MEM 0x00000000FF000000ULL
|
||||
|
||||
#define DRM_FENCE_TYPE_EXE 0x00000001
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -48,36 +48,34 @@
|
||||
#define HW_WRITE_CLIPLOOP() HW_CLIPLOOP()
|
||||
#endif
|
||||
|
||||
|
||||
#if (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)
|
||||
|
||||
/**
|
||||
** GL_RGB, GL_UNSIGNED_SHORT_5_6_5
|
||||
**/
|
||||
|
||||
#ifndef GET_VALUE
|
||||
#ifndef GET_PTR
|
||||
#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
|
||||
#endif
|
||||
|
||||
#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
|
||||
#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
|
||||
#endif /* GET_VALUE */
|
||||
|
||||
#define INIT_MONO_PIXEL(p, color) \
|
||||
p = PACK_COLOR_565( color[0], color[1], color[2] )
|
||||
|
||||
#define WRITE_RGBA( _x, _y, r, g, b, a ) \
|
||||
do { \
|
||||
GLshort * _p = (GLshort *) GET_PTR(_x, _y); \
|
||||
_p[0] = ((((int)r & 0xf8) << 8) | (((int)g & 0xfc) << 3) | \
|
||||
(((int)b & 0xf8) >> 3)); \
|
||||
} while(0)
|
||||
PUT_VALUE(_x, _y, ((((int)r & 0xf8) << 8) | \
|
||||
(((int)g & 0xfc) << 3) | \
|
||||
(((int)b & 0xf8) >> 3))) \
|
||||
|
||||
#define WRITE_PIXEL( _x, _y, p ) \
|
||||
do { \
|
||||
GLushort * _p = (GLushort *) GET_PTR(_x, _y); \
|
||||
_p[0] = p; \
|
||||
} while(0)
|
||||
#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
|
||||
|
||||
#define READ_RGBA( rgba, _x, _y ) \
|
||||
do { \
|
||||
GLushort p = *(volatile GLshort *) GET_PTR(_x, _y); \
|
||||
GLushort p = GET_VALUE(_x, _y); \
|
||||
rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \
|
||||
rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \
|
||||
rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
|
||||
@@ -90,29 +88,30 @@
|
||||
** GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV
|
||||
**/
|
||||
|
||||
#ifndef GET_VALUE
|
||||
#ifndef GET_PTR
|
||||
#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch)
|
||||
#endif
|
||||
|
||||
#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y))
|
||||
#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v)
|
||||
#endif /* GET_VALUE */
|
||||
|
||||
# define INIT_MONO_PIXEL(p, color) \
|
||||
p = PACK_COLOR_8888(color[3], color[0], color[1], color[2])
|
||||
|
||||
# define WRITE_RGBA(_x, _y, r, g, b, a) \
|
||||
do { \
|
||||
GLuint * _p = (GLuint *) GET_PTR(_x, _y); \
|
||||
_p[0] = ((r << 16) | (g << 8) | (b << 0) | (a << 24)); \
|
||||
} while(0)
|
||||
PUT_VALUE(_x, _y, ((r << 16) | \
|
||||
(g << 8) | \
|
||||
(b << 0) | \
|
||||
(a << 24)))
|
||||
|
||||
#define WRITE_PIXEL(_x, _y, p) \
|
||||
do { \
|
||||
GLuint * _p = (GLuint *) GET_PTR(_x, _y); \
|
||||
_p[0] = p; \
|
||||
} while(0)
|
||||
#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p)
|
||||
|
||||
# if defined( USE_X86_ASM )
|
||||
# define READ_RGBA(rgba, _x, _y) \
|
||||
do { \
|
||||
GLuint p = *(volatile GLuint *) GET_PTR(_x, _y); \
|
||||
GLuint p = GET_VALUE(_x, _y); \
|
||||
__asm__ __volatile__( "bswap %0; rorl $8, %0" \
|
||||
: "=r" (p) : "0" (p) ); \
|
||||
((GLuint *)rgba)[0] = p; \
|
||||
@@ -123,14 +122,14 @@
|
||||
*/
|
||||
# define READ_RGBA( rgba, _x, _y ) \
|
||||
do { \
|
||||
GLuint p = *(volatile GLuint *) GET_PTR(_x, _y); \
|
||||
GLuint p = GET_VALUE(_x, _y); \
|
||||
GLuint t = p; \
|
||||
*((uint32_t *) rgba) = (t >> 24) | (p << 8); \
|
||||
} while (0)
|
||||
# else
|
||||
# define READ_RGBA( rgba, _x, _y ) \
|
||||
do { \
|
||||
GLuint p = *(volatile GLuint *) GET_PTR(_x, _y); \
|
||||
GLuint p = GET_VALUE(_x, _y); \
|
||||
rgba[0] = (p >> 16) & 0xff; \
|
||||
rgba[1] = (p >> 8) & 0xff; \
|
||||
rgba[2] = (p >> 0) & 0xff; \
|
||||
@@ -389,7 +388,8 @@ static void TAG(ReadRGBASpan)( GLcontext *ctx,
|
||||
}
|
||||
|
||||
|
||||
#if defined(USE_MMX_ASM) && \
|
||||
#if defined(GET_PTR) && \
|
||||
defined(USE_MMX_ASM) && \
|
||||
(((SPANTMP_PIXEL_FMT == GL_BGRA) && \
|
||||
(SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \
|
||||
((SPANTMP_PIXEL_FMT == GL_RGB) && \
|
||||
@@ -440,7 +440,8 @@ static void TAG2(ReadRGBASpan,_MMX)( GLcontext *ctx,
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(USE_SSE_ASM) && \
|
||||
#if defined(GET_PTR) && \
|
||||
defined(USE_SSE_ASM) && \
|
||||
(SPANTMP_PIXEL_FMT == GL_BGRA) && \
|
||||
(SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
|
||||
static void TAG2(ReadRGBASpan,_SSE2)( GLcontext *ctx,
|
||||
@@ -474,7 +475,8 @@ static void TAG2(ReadRGBASpan,_SSE2)( GLcontext *ctx,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_SSE_ASM) && \
|
||||
#if defined(GET_PTR) && \
|
||||
defined(USE_SSE_ASM) && \
|
||||
(SPANTMP_PIXEL_FMT == GL_BGRA) && \
|
||||
(SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
|
||||
static void TAG2(ReadRGBASpan,_SSE)( GLcontext *ctx,
|
||||
@@ -567,6 +569,7 @@ static void TAG(InitPointers)(struct gl_renderbuffer *rb)
|
||||
rb->PutMonoValues = TAG(WriteMonoRGBAPixels);
|
||||
rb->GetValues = TAG(ReadRGBAPixels);
|
||||
|
||||
#if defined(GET_PTR)
|
||||
#if defined(USE_SSE_ASM) && \
|
||||
(SPANTMP_PIXEL_FMT == GL_BGRA) && \
|
||||
(SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
|
||||
@@ -596,6 +599,7 @@ static void TAG(InitPointers)(struct gl_renderbuffer *rb)
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif /* GET_PTR */
|
||||
{
|
||||
if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "C" );
|
||||
rb->GetRow = TAG(ReadRGBASpan);
|
||||
@@ -610,6 +614,8 @@ static void TAG(InitPointers)(struct gl_renderbuffer *rb)
|
||||
#undef READ_RGBA
|
||||
#undef TAG
|
||||
#undef TAG2
|
||||
#undef GET_VALUE
|
||||
#undef PUT_VALUE
|
||||
#undef GET_PTR
|
||||
#undef SPANTMP_PIXEL_FMT
|
||||
#undef SPANTMP_PIXEL_TYPE
|
||||
|
||||
@@ -836,6 +836,10 @@ driGetConfigAttribIndex(const __DRIconfig *config,
|
||||
case __DRI_ATTRIB_SWAP_METHOD:
|
||||
break;
|
||||
|
||||
case __DRI_ATTRIB_FLOAT_MODE:
|
||||
*value = config->modes.floatMode;
|
||||
break;
|
||||
|
||||
default:
|
||||
*value = *(unsigned int *)
|
||||
((char *) &config->modes + attribMap[index].offset);
|
||||
|
||||
@@ -112,6 +112,8 @@ do { \
|
||||
|
||||
/* 16 bit depthbuffer functions.
|
||||
*/
|
||||
#define VALUE_TYPE GLushort
|
||||
|
||||
#define WRITE_DEPTH( _x, _y, d ) \
|
||||
*(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d;
|
||||
|
||||
@@ -125,6 +127,8 @@ do { \
|
||||
#if 0 /* Unused */
|
||||
/* 32 bit depthbuffer functions.
|
||||
*/
|
||||
#define VALUE_TYPE GLuint
|
||||
|
||||
#define WRITE_DEPTH( _x, _y, d ) \
|
||||
*(GLuint *)(buf + (_x)*4 + (_y)*pitch) = d;
|
||||
|
||||
@@ -138,6 +142,8 @@ do { \
|
||||
|
||||
/* 24/8 bit interleaved depth/stencil functions
|
||||
*/
|
||||
#define VALUE_TYPE GLuint
|
||||
|
||||
#define WRITE_DEPTH( _x, _y, d ) { \
|
||||
GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*pitch); \
|
||||
tmp &= 0xff; \
|
||||
|
||||
@@ -67,6 +67,8 @@ do { \
|
||||
|
||||
/* 16 bit depthbuffer functions.
|
||||
*/
|
||||
#define VALUE_TYPE GLushort
|
||||
|
||||
#define WRITE_DEPTH( _x, _y, d ) \
|
||||
*(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d;
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ DRIVER_SOURCES = \
|
||||
intel_pixel.c \
|
||||
intel_pixel_bitmap.c \
|
||||
intel_pixel_copy.c \
|
||||
intel_pixel_read.c \
|
||||
intel_pixel_draw.c \
|
||||
intel_pixel_read.c \
|
||||
intel_buffers.c \
|
||||
intel_blit.c \
|
||||
i915_tex.c \
|
||||
@@ -52,12 +52,10 @@ DRIVER_SOURCES = \
|
||||
intel_state.c \
|
||||
intel_tris.c \
|
||||
intel_fbo.c \
|
||||
intel_depthstencil.c \
|
||||
intel_bufmgr_ttm.c
|
||||
intel_depthstencil.c
|
||||
|
||||
C_SOURCES = \
|
||||
$(COMMON_SOURCES) \
|
||||
$(COMMON_BM_SOURCES) \
|
||||
$(DRIVER_SOURCES)
|
||||
|
||||
ASM_SOURCES =
|
||||
@@ -69,6 +67,7 @@ DRIVER_DEFINES = -I../intel -I../intel/server -DI915 \
|
||||
include ../Makefile.template
|
||||
|
||||
intel_decode.o: ../intel/intel_decode.c
|
||||
|
||||
intel_tex_layout.o: ../intel/intel_tex_layout.c
|
||||
|
||||
symlinks:
|
||||
|
||||
@@ -42,12 +42,6 @@
|
||||
* Mesa's Driver Functions
|
||||
***************************************/
|
||||
|
||||
static const struct dri_extension i830_extensions[] = {
|
||||
{"GL_ARB_texture_env_crossbar", NULL},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
i830InitDriverFunctions(struct dd_function_table *functions)
|
||||
{
|
||||
@@ -87,6 +81,9 @@ i830CreateContext(const __GLcontextModes * mesaVis,
|
||||
_tnl_destroy_pipeline(ctx);
|
||||
_tnl_install_pipeline(ctx, intel_pipeline);
|
||||
|
||||
if (intel->no_rast)
|
||||
FALLBACK(intel, INTEL_FALLBACK_USER, 1);
|
||||
|
||||
intel->ctx.Const.MaxTextureUnits = I830_TEX_UNITS;
|
||||
intel->ctx.Const.MaxTextureImageUnits = I830_TEX_UNITS;
|
||||
intel->ctx.Const.MaxTextureCoordUnits = I830_TEX_UNITS;
|
||||
@@ -105,8 +102,6 @@ i830CreateContext(const __GLcontextModes * mesaVis,
|
||||
|
||||
intel->verts = TNL_CONTEXT(ctx)->clipspace.vertex_buf;
|
||||
|
||||
driInitExtensions(ctx, i830_extensions, GL_FALSE);
|
||||
|
||||
i830InitState(i830);
|
||||
i830InitMetaFuncs(i830);
|
||||
|
||||
|
||||
@@ -494,10 +494,6 @@
|
||||
#define VFT1_TEX0_FMT(x) (x)
|
||||
#define VFT1_TEX0_MASK 3
|
||||
#define VFT1_TEX1_SHIFT 2
|
||||
#define TEXCOORDFMT_2D 0
|
||||
#define TEXCOORDFMT_3D 1
|
||||
#define TEXCOORDFMT_4D 2
|
||||
#define TEXCOORDFMT_1D 3
|
||||
|
||||
/*New stuff picked up along the way */
|
||||
|
||||
@@ -635,8 +631,4 @@
|
||||
#define ENABLE_TEX_STREAM_MAP_IDX (1<<3)
|
||||
#define TEX_STREAM_MAP_IDX(x) (x)
|
||||
|
||||
|
||||
#define MI_FLUSH ((0<<29)|(4<<23))
|
||||
#define FLUSH_MAP_CACHE (1<<0)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "i830_reg.h"
|
||||
#include "intel_batchbuffer.h"
|
||||
#include "intel_regions.h"
|
||||
#include "intel_tris.h"
|
||||
#include "tnl/t_context.h"
|
||||
#include "tnl/t_vertex.h"
|
||||
|
||||
@@ -419,10 +420,12 @@ i830_emit_state(struct intel_context *intel)
|
||||
{
|
||||
struct i830_context *i830 = i830_context(&intel->ctx);
|
||||
struct i830_hw_state *state = i830->current;
|
||||
int i, ret, count;
|
||||
int i, count;
|
||||
GLuint dirty;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
BATCH_LOCALS;
|
||||
dri_bo *aper_array[3 + I830_TEX_UNITS];
|
||||
int aper_count;
|
||||
|
||||
/* We don't hold the lock at this point, so want to make sure that
|
||||
* there won't be a buffer wrap between the state emits and the primitive
|
||||
@@ -435,26 +438,28 @@ i830_emit_state(struct intel_context *intel)
|
||||
* Set the space as LOOP_CLIPRECTS now, since that's what our primitives
|
||||
* will be emitted under.
|
||||
*/
|
||||
intel_batchbuffer_require_space(intel->batch, get_state_size(state) + 8,
|
||||
intel_batchbuffer_require_space(intel->batch,
|
||||
get_state_size(state) + INTEL_PRIM_EMIT_SIZE,
|
||||
LOOP_CLIPRECTS);
|
||||
count = 0;
|
||||
again:
|
||||
aper_count = 0;
|
||||
dirty = get_dirty(state);
|
||||
|
||||
ret = 0;
|
||||
aper_array[aper_count++] = intel->batch->buf;
|
||||
if (dirty & I830_UPLOAD_BUFFERS) {
|
||||
ret |= dri_bufmgr_check_aperture_space(state->draw_region->buffer);
|
||||
ret |= dri_bufmgr_check_aperture_space(state->depth_region->buffer);
|
||||
aper_array[aper_count++] = state->draw_region->buffer;
|
||||
aper_array[aper_count++] = state->depth_region->buffer;
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < I830_TEX_UNITS; i++)
|
||||
if (dirty & I830_UPLOAD_TEX(i)) {
|
||||
if (state->tex_buffer[i]) {
|
||||
ret |= dri_bufmgr_check_aperture_space(state->tex_buffer[i]);
|
||||
aper_array[aper_count++] = state->tex_buffer[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
if (dri_bufmgr_check_aperture_space(aper_array, aper_count)) {
|
||||
if (count == 0) {
|
||||
count++;
|
||||
intel_batchbuffer_flush(intel->batch);
|
||||
@@ -490,14 +495,14 @@ i830_emit_state(struct intel_context *intel)
|
||||
OUT_BATCH(state->Buffer[I830_DESTREG_CBUFADDR0]);
|
||||
OUT_BATCH(state->Buffer[I830_DESTREG_CBUFADDR1]);
|
||||
OUT_RELOC(state->draw_region->buffer,
|
||||
DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
|
||||
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
|
||||
state->draw_region->draw_offset);
|
||||
|
||||
if (state->depth_region) {
|
||||
OUT_BATCH(state->Buffer[I830_DESTREG_DBUFADDR0]);
|
||||
OUT_BATCH(state->Buffer[I830_DESTREG_DBUFADDR1]);
|
||||
OUT_RELOC(state->depth_region->buffer,
|
||||
DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
|
||||
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
|
||||
state->depth_region->draw_offset);
|
||||
}
|
||||
|
||||
@@ -524,7 +529,7 @@ i830_emit_state(struct intel_context *intel)
|
||||
|
||||
if (state->tex_buffer[i]) {
|
||||
OUT_RELOC(state->tex_buffer[i],
|
||||
DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
|
||||
I915_GEM_DOMAIN_SAMPLER, 0,
|
||||
state->tex_offset[i] | TM0S0_USE_FENCE);
|
||||
}
|
||||
else if (state == &i830->meta) {
|
||||
@@ -717,4 +722,5 @@ i830InitVtbl(struct i830_context *i830)
|
||||
i830->intel.vtbl.render_prevalidate = i830_render_prevalidate;
|
||||
i830->intel.vtbl.assert_not_dirty = i830_assert_not_dirty;
|
||||
i830->intel.vtbl.note_unlock = i830_note_unlock;
|
||||
i830->intel.vtbl.finish_batch = intel_finish_vb;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ static const struct dri_extension i915_extensions[] = {
|
||||
{"GL_ARB_depth_texture", NULL},
|
||||
{"GL_ARB_fragment_program", NULL},
|
||||
{"GL_ARB_shadow", NULL},
|
||||
{"GL_ARB_texture_env_crossbar", NULL},
|
||||
{"GL_ARB_texture_non_power_of_two", NULL},
|
||||
{"GL_EXT_shadow_funcs", NULL},
|
||||
/* ARB extn won't work if not enabled */
|
||||
@@ -139,6 +138,9 @@ i915CreateContext(const __GLcontextModes * mesaVis,
|
||||
_tnl_destroy_pipeline(ctx);
|
||||
_tnl_install_pipeline(ctx, intel_pipeline);
|
||||
|
||||
if (intel->no_rast)
|
||||
FALLBACK(intel, INTEL_FALLBACK_USER, 1);
|
||||
|
||||
ctx->Const.MaxTextureUnits = I915_TEX_UNITS;
|
||||
ctx->Const.MaxTextureImageUnits = I915_TEX_UNITS;
|
||||
ctx->Const.MaxTextureCoordUnits = I915_TEX_UNITS;
|
||||
|
||||
@@ -325,118 +325,6 @@
|
||||
#define SCISSOR_RECT_0_YMAX(x) ((x)<<16)
|
||||
#define SCISSOR_RECT_0_XMAX(x) (x)
|
||||
|
||||
/* p189 */
|
||||
#define _3DSTATE_LOAD_STATE_IMMEDIATE_1 ((0x3<<29)|(0x1d<<24)|(0x04<<16))
|
||||
#define I1_LOAD_S(n) (1<<(4+n))
|
||||
|
||||
#define S0_VB_OFFSET_MASK 0xffffffc
|
||||
#define S0_AUTO_CACHE_INV_DISABLE (1<<0)
|
||||
|
||||
#define S1_VERTEX_WIDTH_SHIFT 24
|
||||
#define S1_VERTEX_WIDTH_MASK (0x3f<<24)
|
||||
#define S1_VERTEX_PITCH_SHIFT 16
|
||||
#define S1_VERTEX_PITCH_MASK (0x3f<<16)
|
||||
|
||||
#define TEXCOORDFMT_2D 0x0
|
||||
#define TEXCOORDFMT_3D 0x1
|
||||
#define TEXCOORDFMT_4D 0x2
|
||||
#define TEXCOORDFMT_1D 0x3
|
||||
#define TEXCOORDFMT_2D_16 0x4
|
||||
#define TEXCOORDFMT_4D_16 0x5
|
||||
#define TEXCOORDFMT_NOT_PRESENT 0xf
|
||||
#define S2_TEXCOORD_FMT0_MASK 0xf
|
||||
#define S2_TEXCOORD_FMT1_SHIFT 4
|
||||
#define S2_TEXCOORD_FMT(unit, type) ((type)<<(unit*4))
|
||||
#define S2_TEXCOORD_NONE (~0)
|
||||
|
||||
/* S3 not interesting */
|
||||
|
||||
#define S4_POINT_WIDTH_SHIFT 23
|
||||
#define S4_POINT_WIDTH_MASK (0x1ff<<23)
|
||||
#define S4_LINE_WIDTH_SHIFT 19
|
||||
#define S4_LINE_WIDTH_ONE (0x2<<19)
|
||||
#define S4_LINE_WIDTH_MASK (0xf<<19)
|
||||
#define S4_FLATSHADE_ALPHA (1<<18)
|
||||
#define S4_FLATSHADE_FOG (1<<17)
|
||||
#define S4_FLATSHADE_SPECULAR (1<<16)
|
||||
#define S4_FLATSHADE_COLOR (1<<15)
|
||||
#define S4_CULLMODE_BOTH (0<<13)
|
||||
#define S4_CULLMODE_NONE (1<<13)
|
||||
#define S4_CULLMODE_CW (2<<13)
|
||||
#define S4_CULLMODE_CCW (3<<13)
|
||||
#define S4_CULLMODE_MASK (3<<13)
|
||||
#define S4_VFMT_POINT_WIDTH (1<<12)
|
||||
#define S4_VFMT_SPEC_FOG (1<<11)
|
||||
#define S4_VFMT_COLOR (1<<10)
|
||||
#define S4_VFMT_DEPTH_OFFSET (1<<9)
|
||||
#define S4_VFMT_XYZ (1<<6)
|
||||
#define S4_VFMT_XYZW (2<<6)
|
||||
#define S4_VFMT_XY (3<<6)
|
||||
#define S4_VFMT_XYW (4<<6)
|
||||
#define S4_VFMT_XYZW_MASK (7<<6)
|
||||
#define S4_FORCE_DEFAULT_DIFFUSE (1<<5)
|
||||
#define S4_FORCE_DEFAULT_SPECULAR (1<<4)
|
||||
#define S4_LOCAL_DEPTH_OFFSET_ENABLE (1<<3)
|
||||
#define S4_VFMT_FOG_PARAM (1<<2)
|
||||
#define S4_SPRITE_POINT_ENABLE (1<<1)
|
||||
#define S4_LINE_ANTIALIAS_ENABLE (1<<0)
|
||||
|
||||
#define S4_VFMT_MASK (S4_VFMT_POINT_WIDTH | \
|
||||
S4_VFMT_SPEC_FOG | \
|
||||
S4_VFMT_COLOR | \
|
||||
S4_VFMT_DEPTH_OFFSET | \
|
||||
S4_VFMT_XYZW_MASK | \
|
||||
S4_VFMT_FOG_PARAM)
|
||||
|
||||
|
||||
#define S5_WRITEDISABLE_ALPHA (1<<31)
|
||||
#define S5_WRITEDISABLE_RED (1<<30)
|
||||
#define S5_WRITEDISABLE_GREEN (1<<29)
|
||||
#define S5_WRITEDISABLE_BLUE (1<<28)
|
||||
#define S5_WRITEDISABLE_MASK (0xf<<28)
|
||||
#define S5_FORCE_DEFAULT_POINT_SIZE (1<<27)
|
||||
#define S5_LAST_PIXEL_ENABLE (1<<26)
|
||||
#define S5_GLOBAL_DEPTH_OFFSET_ENABLE (1<<25)
|
||||
#define S5_FOG_ENABLE (1<<24)
|
||||
#define S5_STENCIL_REF_SHIFT 16
|
||||
#define S5_STENCIL_REF_MASK (0xff<<16)
|
||||
#define S5_STENCIL_TEST_FUNC_SHIFT 13
|
||||
#define S5_STENCIL_TEST_FUNC_MASK (0x7<<13)
|
||||
#define S5_STENCIL_FAIL_SHIFT 10
|
||||
#define S5_STENCIL_FAIL_MASK (0x7<<10)
|
||||
#define S5_STENCIL_PASS_Z_FAIL_SHIFT 7
|
||||
#define S5_STENCIL_PASS_Z_FAIL_MASK (0x7<<7)
|
||||
#define S5_STENCIL_PASS_Z_PASS_SHIFT 4
|
||||
#define S5_STENCIL_PASS_Z_PASS_MASK (0x7<<4)
|
||||
#define S5_STENCIL_WRITE_ENABLE (1<<3)
|
||||
#define S5_STENCIL_TEST_ENABLE (1<<2)
|
||||
#define S5_COLOR_DITHER_ENABLE (1<<1)
|
||||
#define S5_LOGICOP_ENABLE (1<<0)
|
||||
|
||||
|
||||
#define S6_ALPHA_TEST_ENABLE (1<<31)
|
||||
#define S6_ALPHA_TEST_FUNC_SHIFT 28
|
||||
#define S6_ALPHA_TEST_FUNC_MASK (0x7<<28)
|
||||
#define S6_ALPHA_REF_SHIFT 20
|
||||
#define S6_ALPHA_REF_MASK (0xff<<20)
|
||||
#define S6_DEPTH_TEST_ENABLE (1<<19)
|
||||
#define S6_DEPTH_TEST_FUNC_SHIFT 16
|
||||
#define S6_DEPTH_TEST_FUNC_MASK (0x7<<16)
|
||||
#define S6_CBUF_BLEND_ENABLE (1<<15)
|
||||
#define S6_CBUF_BLEND_FUNC_SHIFT 12
|
||||
#define S6_CBUF_BLEND_FUNC_MASK (0x7<<12)
|
||||
#define S6_CBUF_SRC_BLEND_FACT_SHIFT 8
|
||||
#define S6_CBUF_SRC_BLEND_FACT_MASK (0xf<<8)
|
||||
#define S6_CBUF_DST_BLEND_FACT_SHIFT 4
|
||||
#define S6_CBUF_DST_BLEND_FACT_MASK (0xf<<4)
|
||||
#define S6_DEPTH_WRITE_ENABLE (1<<3)
|
||||
#define S6_COLOR_WRITE_ENABLE (1<<2)
|
||||
#define S6_TRISTRIP_PV_SHIFT 0
|
||||
#define S6_TRISTRIP_PV_MASK (0x3<<0)
|
||||
|
||||
#define S7_DEPTH_OFFSET_CONST_MASK ~0
|
||||
|
||||
|
||||
/* Helper macros for blend factors
|
||||
*/
|
||||
#define DST_BLND_FACT(f) ((f)<<S6_CBUF_DST_BLEND_FACT_SHIFT)
|
||||
@@ -855,10 +743,4 @@
|
||||
#define _3DSTATE_DEFAULT_DIFFUSE ((0x3<<29)|(0x1d<<24)|(0x99<<16))
|
||||
#define _3DSTATE_DEFAULT_SPECULAR ((0x3<<29)|(0x1d<<24)|(0x9a<<16))
|
||||
|
||||
|
||||
#define MI_FLUSH ((0<<29)|(4<<23))
|
||||
#define FLUSH_MAP_CACHE (1<<0)
|
||||
#define INHIBIT_FLUSH_RENDER_CACHE (1<<2)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user