Compare commits
331 Commits
post-merge
...
mesa_6_5_3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02e958a1e4 | ||
|
|
cce5084941 | ||
|
|
4b1d1b7b18 | ||
|
|
7ff72a7659 | ||
|
|
c4b3b8dece | ||
|
|
65bab0dad8 | ||
|
|
74edc663a6 | ||
|
|
54d59cfb70 | ||
|
|
b7f5b8af65 | ||
|
|
4099531a0a | ||
|
|
1606f2c123 | ||
|
|
1dd7c00214 | ||
|
|
f42d4ab41e | ||
|
|
4a28548cbf | ||
|
|
5814922d25 | ||
|
|
3de20aead2 | ||
|
|
6d27194dff | ||
|
|
c233aa2768 | ||
|
|
c93b2a1cb7 | ||
|
|
eca456b63d | ||
|
|
4003bde6ff | ||
|
|
ddcf819906 | ||
|
|
9ede048127 | ||
|
|
97693436a5 | ||
|
|
8a8a5bd104 | ||
|
|
3e5eda9ee9 | ||
|
|
f38dcc8a6a | ||
|
|
b1b154c498 | ||
|
|
286faac68e | ||
|
|
3b0bd0ce17 | ||
|
|
208ea84524 | ||
|
|
7868ab6617 | ||
|
|
47ad443c55 | ||
|
|
3db3dc58bc | ||
|
|
c27adc52ce | ||
|
|
afc132e7a9 | ||
|
|
335769a875 | ||
|
|
0bdf216dd0 | ||
|
|
d59e6f233b | ||
|
|
ad02042db2 | ||
|
|
f793e90e82 | ||
|
|
112e1f2b5a | ||
|
|
e5cf37c178 | ||
|
|
b5e9b0e562 | ||
|
|
b1502588c4 | ||
|
|
74afcabd85 | ||
|
|
b3ab925e91 | ||
|
|
2d2c6a622d | ||
|
|
fc3d6bd351 | ||
|
|
e261d66d81 | ||
|
|
cd3e39340f | ||
|
|
ad3cc95485 | ||
|
|
4e0a64675c | ||
|
|
d5e7234ba8 | ||
|
|
bc74cb4c0a | ||
|
|
257f799849 | ||
|
|
81c4fee160 | ||
|
|
1fbdd9d794 | ||
|
|
82839e8430 | ||
|
|
ced6f76404 | ||
|
|
4cc2674aee | ||
|
|
a7f7366d38 | ||
|
|
11e3f733ba | ||
|
|
98ef18909a | ||
|
|
f2346498aa | ||
|
|
4b7c6fc5a6 | ||
|
|
fe16b9f663 | ||
|
|
c9855a60f4 | ||
|
|
838a2a2633 | ||
|
|
e7e5279fc0 | ||
|
|
7fd3a6c521 | ||
|
|
720cf3aa13 | ||
|
|
5491c8194c | ||
|
|
e4e2068ac9 | ||
|
|
6346a753c6 | ||
|
|
4d944b502f | ||
|
|
6aa5668871 | ||
|
|
d60009bd6d | ||
|
|
535c37e85d | ||
|
|
ba3d384e94 | ||
|
|
8b5fce6bcc | ||
|
|
020cdb47cf | ||
|
|
121f2212cc | ||
|
|
24a93dd6a4 | ||
|
|
00da9afb84 | ||
|
|
4abcaf3949 | ||
|
|
6bde08815f | ||
|
|
8e6207396c | ||
|
|
5ca8d4ccf2 | ||
|
|
6b3027e291 | ||
|
|
8d370fb2ee | ||
|
|
36a6a59972 | ||
|
|
addd03da2e | ||
|
|
c93e883b20 | ||
|
|
274ac7a801 | ||
|
|
aaa57412c1 | ||
|
|
2a2f8d806f | ||
|
|
bac15c8db8 | ||
|
|
f3e8c32376 | ||
|
|
6d3d9c1c6d | ||
|
|
e57e752eee | ||
|
|
884af40864 | ||
|
|
30a79f76fc | ||
|
|
8598f55091 | ||
|
|
6d01f3f1ec | ||
|
|
e3caa5f891 | ||
|
|
d9443c2494 | ||
|
|
565cd49b5f | ||
|
|
a4b2b88337 | ||
|
|
04bda46739 | ||
|
|
d2d86a3f0b | ||
|
|
9cbcf7c696 | ||
|
|
468a33d19a | ||
|
|
893b368a82 | ||
|
|
41fc55dd81 | ||
|
|
1a9483c954 | ||
|
|
36949abec7 | ||
|
|
6459adf79b | ||
|
|
badc346206 | ||
|
|
4a7c45118d | ||
|
|
34ca2be769 | ||
|
|
5888010362 | ||
|
|
dfee7619d4 | ||
|
|
96e05da1c9 | ||
|
|
1560de2c3c | ||
|
|
921b008419 | ||
|
|
aa6992a296 | ||
|
|
4b3835dadf | ||
|
|
64e8088667 | ||
|
|
3dfcd48469 | ||
|
|
e812a2a484 | ||
|
|
da56df9d72 | ||
|
|
9519785e29 | ||
|
|
83ad64d94a | ||
|
|
fde15a2bae | ||
|
|
216eb81c53 | ||
|
|
4fc46a6c82 | ||
|
|
e19cfabb6e | ||
|
|
8d8a3cc398 | ||
|
|
fb1d22d23d | ||
|
|
3d59042afd | ||
|
|
967c1056d5 | ||
|
|
9f8373d5ca | ||
|
|
50aaabc248 | ||
|
|
30b6f11de1 | ||
|
|
f11604a30d | ||
|
|
99193e4f74 | ||
|
|
5b74fe0889 | ||
|
|
431d650f2b | ||
|
|
3c008a014f | ||
|
|
bf287356cf | ||
|
|
bce7043ebc | ||
|
|
70b0e123c4 | ||
|
|
f98f4f6d7a | ||
|
|
afc58f5f7e | ||
|
|
b61d74c575 | ||
|
|
9f66025f54 | ||
|
|
183d8e0620 | ||
|
|
b0bba03846 | ||
|
|
ba876be0c0 | ||
|
|
319ce38fa4 | ||
|
|
64700be4e1 | ||
|
|
159ecba4b3 | ||
|
|
e798d22556 | ||
|
|
0109b47106 | ||
|
|
7b2626f7d8 | ||
|
|
19121e2802 | ||
|
|
e0bbf46342 | ||
|
|
702c8f1e6c | ||
|
|
f9574c3f6b | ||
|
|
e8292d28e4 | ||
|
|
c96974f78c | ||
|
|
6461e91ac3 | ||
|
|
af807a4696 | ||
|
|
5c0c60a13c | ||
|
|
5dba996dba | ||
|
|
9612a3011f | ||
|
|
0d3d930912 | ||
|
|
d8bfc42bb7 | ||
|
|
ca7885f733 | ||
|
|
9176752172 | ||
|
|
79bf692420 | ||
|
|
f72e7fb1d6 | ||
|
|
4647f13c43 | ||
|
|
20ec486baf | ||
|
|
55000888b9 | ||
|
|
4f9d3a07bb | ||
|
|
84803279ca | ||
|
|
8d2d6e5194 | ||
|
|
e9c614a1af | ||
|
|
8f3fc5221c | ||
|
|
ae55d5322c | ||
|
|
92b7fa7b48 | ||
|
|
eb4a8b4bb5 | ||
|
|
663a3e9ba7 | ||
|
|
51a894e6eb | ||
|
|
ac32b644ee | ||
|
|
487f7a73cb | ||
|
|
aa1c79eaea | ||
|
|
885111518e | ||
|
|
0cae814f36 | ||
|
|
33c3739628 | ||
|
|
4d864b087e | ||
|
|
2f207dcf1e | ||
|
|
f9c01c33d3 | ||
|
|
d4dc57bb13 | ||
|
|
a28e648690 | ||
|
|
40ae3943f2 | ||
|
|
dba21ed913 | ||
|
|
66d336808d | ||
|
|
dccd9c4f4d | ||
|
|
3fe47d5c57 | ||
|
|
3fd88089c0 | ||
|
|
0683e4ce4b | ||
|
|
ec42af9263 | ||
|
|
00831b5b3b | ||
|
|
ec6c8f86f3 | ||
|
|
e608d92c5b | ||
|
|
57dadf71ca | ||
|
|
adb91c056f | ||
|
|
6f652c89d7 | ||
|
|
7439a36785 | ||
|
|
7eba12edce | ||
|
|
ba730e14ed | ||
|
|
1ba858591b | ||
|
|
f2f5d06853 | ||
|
|
b2ac30ac36 | ||
|
|
3b7f2f53a2 | ||
|
|
8128f7143d | ||
|
|
393a93ea32 | ||
|
|
3e7d43cd48 | ||
|
|
1bbd69251b | ||
|
|
f841b04601 | ||
|
|
b463d52143 | ||
|
|
7e4a7fdddd | ||
|
|
ee2f31e281 | ||
|
|
dad97b4688 | ||
|
|
a01616eed5 | ||
|
|
d750861dc2 | ||
|
|
59f7f6dbe9 | ||
|
|
20d85c609a | ||
|
|
ad766b5785 | ||
|
|
0420d8505a | ||
|
|
05e6fd8398 | ||
|
|
e5d00e8cf4 | ||
|
|
31dc7a3c89 | ||
|
|
17238f1ee5 | ||
|
|
f407cada8a | ||
|
|
e713ef66ef | ||
|
|
a0275b0d2c | ||
|
|
d6d6d20b13 | ||
|
|
1f1f582304 | ||
|
|
811c2e9a91 | ||
|
|
cda3236092 | ||
|
|
9b9e056615 | ||
|
|
ff65fa39e8 | ||
|
|
3e45db6729 | ||
|
|
3b8ab88131 | ||
|
|
32225d06b9 | ||
|
|
a835939222 | ||
|
|
98abd1bbc8 | ||
|
|
a9455bb9a7 | ||
|
|
63c57a14d3 | ||
|
|
25f21b5331 | ||
|
|
da82d86ea0 | ||
|
|
075d3d892f | ||
|
|
ae36cfc65e | ||
|
|
9878e8ff51 | ||
|
|
6583429f89 | ||
|
|
037c068460 | ||
|
|
c042a91b8b | ||
|
|
813a0e11f1 | ||
|
|
52cc32378c | ||
|
|
c3da0bd7dd | ||
|
|
e508155d16 | ||
|
|
0426d3c0c8 | ||
|
|
b53745ce91 | ||
|
|
768f7231ea | ||
|
|
680abf8a02 | ||
|
|
1170268088 | ||
|
|
38a1c2b495 | ||
|
|
b5d988dd19 | ||
|
|
b67d93111d | ||
|
|
ee9bc897f8 | ||
|
|
1b354bb5e4 | ||
|
|
44fb5156bb | ||
|
|
ad76128204 | ||
|
|
2eb656ef4f | ||
|
|
8ba06464ac | ||
|
|
76444d042c | ||
|
|
e01ee3da57 | ||
|
|
fd1b1fce3f | ||
|
|
38889f5221 | ||
|
|
a02870f4f6 | ||
|
|
d63eef4b86 | ||
|
|
805b1cf482 | ||
|
|
4110fac389 | ||
|
|
5a5b55943d | ||
|
|
1e055089a3 | ||
|
|
87c9ad6fd5 | ||
|
|
c05b6f800a | ||
|
|
540e1c70cc | ||
|
|
180c0d70c4 | ||
|
|
6a47e35065 | ||
|
|
381b4b0c91 | ||
|
|
675f7f627b | ||
|
|
51bfb8fc8c | ||
|
|
6b6760d6bc | ||
|
|
c171166987 | ||
|
|
a27d3e43fe | ||
|
|
6a632de96d | ||
|
|
92de58f001 | ||
|
|
caf8010652 | ||
|
|
f34cad0f97 | ||
|
|
adccb084df | ||
|
|
ead0f46d5f | ||
|
|
77b862a849 | ||
|
|
ed7fbad206 | ||
|
|
4720cd0050 | ||
|
|
c9795c6ca2 | ||
|
|
bce82efe1f | ||
|
|
aeda4c589a | ||
|
|
696fe3f52e | ||
|
|
c34d026eb0 | ||
|
|
de90bbd0b7 | ||
|
|
d214138910 | ||
|
|
89433fef0d | ||
|
|
b4d9c0048f | ||
|
|
9a94dae4c2 | ||
|
|
183abbcd6b | ||
|
|
0536268267 |
27
Makefile
27
Makefile
@@ -155,10 +155,10 @@ ultrix-gcc:
|
|||||||
|
|
||||||
# Rules for making release tarballs
|
# Rules for making release tarballs
|
||||||
|
|
||||||
DIRECTORY = Mesa-6.5.2
|
DIRECTORY = Mesa-6.5.3
|
||||||
LIB_NAME = MesaLib-6.5.2
|
LIB_NAME = MesaLib-6.5.3
|
||||||
DEMO_NAME = MesaDemos-6.5.2
|
DEMO_NAME = MesaDemos-6.5.3
|
||||||
GLUT_NAME = MesaGLUT-6.5.2
|
GLUT_NAME = MesaGLUT-6.5.3
|
||||||
|
|
||||||
MAIN_FILES = \
|
MAIN_FILES = \
|
||||||
$(DIRECTORY)/Makefile* \
|
$(DIRECTORY)/Makefile* \
|
||||||
@@ -209,9 +209,6 @@ MAIN_FILES = \
|
|||||||
$(DIRECTORY)/src/mesa/glapi/*.[chS] \
|
$(DIRECTORY)/src/mesa/glapi/*.[chS] \
|
||||||
$(DIRECTORY)/src/mesa/glapi/descrip.mms \
|
$(DIRECTORY)/src/mesa/glapi/descrip.mms \
|
||||||
$(DIRECTORY)/src/mesa/glapi/sources \
|
$(DIRECTORY)/src/mesa/glapi/sources \
|
||||||
$(DIRECTORY)/src/mesa/array_cache/*.[ch] \
|
|
||||||
$(DIRECTORY)/src/mesa/array_cache/descrip.mms \
|
|
||||||
$(DIRECTORY)/src/mesa/array_cache/sources \
|
|
||||||
$(DIRECTORY)/src/mesa/math/*.[ch] \
|
$(DIRECTORY)/src/mesa/math/*.[ch] \
|
||||||
$(DIRECTORY)/src/mesa/math/descrip.mms \
|
$(DIRECTORY)/src/mesa/math/descrip.mms \
|
||||||
$(DIRECTORY)/src/mesa/math/sources \
|
$(DIRECTORY)/src/mesa/math/sources \
|
||||||
@@ -231,6 +228,8 @@ MAIN_FILES = \
|
|||||||
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
|
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
|
||||||
$(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \
|
$(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \
|
||||||
$(DIRECTORY)/src/mesa/swrast_setup/sources \
|
$(DIRECTORY)/src/mesa/swrast_setup/sources \
|
||||||
|
$(DIRECTORY)/src/mesa/vbo/*.[chS] \
|
||||||
|
$(DIRECTORY)/src/mesa/vbo/descrip.mms \
|
||||||
$(DIRECTORY)/src/mesa/tnl/*.[chS] \
|
$(DIRECTORY)/src/mesa/tnl/*.[chS] \
|
||||||
$(DIRECTORY)/src/mesa/tnl/descrip.mms \
|
$(DIRECTORY)/src/mesa/tnl/descrip.mms \
|
||||||
$(DIRECTORY)/src/mesa/tnl/sources \
|
$(DIRECTORY)/src/mesa/tnl/sources \
|
||||||
@@ -289,7 +288,16 @@ MAIN_FILES = \
|
|||||||
$(DIRECTORY)/windows/VC7/mesa/glu/glu.vcproj \
|
$(DIRECTORY)/windows/VC7/mesa/glu/glu.vcproj \
|
||||||
$(DIRECTORY)/windows/VC7/mesa/mesa.sln \
|
$(DIRECTORY)/windows/VC7/mesa/mesa.sln \
|
||||||
$(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \
|
$(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \
|
||||||
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj
|
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj \
|
||||||
|
$(DIRECTORY)/windows/VC8/mesa/mesa.sln \
|
||||||
|
$(DIRECTORY)/windows/VC8/mesa/gdi/gdi.vcproj \
|
||||||
|
$(DIRECTORY)/windows/VC8/mesa/glu/glu.vcproj \
|
||||||
|
$(DIRECTORY)/windows/VC8/mesa/mesa/mesa.vcproj \
|
||||||
|
$(DIRECTORY)/windows/VC8/mesa/osmesa/osmesa.vcproj \
|
||||||
|
$(DIRECTORY)/windows/VC8/progs/progs.sln \
|
||||||
|
$(DIRECTORY)/windows/VC8/progs/demos/gears.vcproj \
|
||||||
|
$(DIRECTORY)/windows/VC8/progs/glut/glut.vcproj
|
||||||
|
|
||||||
|
|
||||||
DRI_FILES = \
|
DRI_FILES = \
|
||||||
$(DIRECTORY)/include/GL/internal/dri_interface.h \
|
$(DIRECTORY)/include/GL/internal/dri_interface.h \
|
||||||
@@ -365,6 +373,9 @@ DEMO_FILES = \
|
|||||||
$(DIRECTORY)/progs/samples/Makefile* \
|
$(DIRECTORY)/progs/samples/Makefile* \
|
||||||
$(DIRECTORY)/progs/samples/README \
|
$(DIRECTORY)/progs/samples/README \
|
||||||
$(DIRECTORY)/progs/samples/*.c \
|
$(DIRECTORY)/progs/samples/*.c \
|
||||||
|
$(DIRECTORY)/progs/glsl/Makefile* \
|
||||||
|
$(DIRECTORY)/progs/glsl/*.c \
|
||||||
|
$(DIRECTORY)/progs/glsl/*.txt \
|
||||||
$(DIRECTORY)/progs/windml/Makefile.ugl \
|
$(DIRECTORY)/progs/windml/Makefile.ugl \
|
||||||
$(DIRECTORY)/progs/windml/*.c \
|
$(DIRECTORY)/progs/windml/*.c \
|
||||||
$(DIRECTORY)/progs/windml/*.bmp \
|
$(DIRECTORY)/progs/windml/*.bmp \
|
||||||
|
|||||||
11
bin/mklib
11
bin/mklib
@@ -212,15 +212,16 @@ case $ARCH in
|
|||||||
# finish up
|
# finish up
|
||||||
FINAL_LIBS="${LIBNAME}"
|
FINAL_LIBS="${LIBNAME}"
|
||||||
elif [ $STATIC = 1 ] ; then
|
elif [ $STATIC = 1 ] ; then
|
||||||
LIBNAME="lib${LIBNAME}" # prefix with "lib"
|
LIBNAME="lib${LIBNAME}.a" # prefix with "lib", suffix with ".a"
|
||||||
echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a
|
echo "mklib: Making" $ARCH "static library: " ${LIBNAME}
|
||||||
LINK="ar"
|
LINK="ar"
|
||||||
OPTS="-ru"
|
OPTS="-ru"
|
||||||
|
rm -f ${LIBNAME}
|
||||||
# make lib
|
# make lib
|
||||||
${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
|
${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
|
||||||
ranlib ${LIBNAME}.a
|
ranlib ${LIBNAME}
|
||||||
# finish up
|
# finish up
|
||||||
FINAL_LIBS=${LIBNAME}.a
|
FINAL_LIBS=${LIBNAME}
|
||||||
else
|
else
|
||||||
LIBNAME="lib${LIBNAME}" # prefix with "lib"
|
LIBNAME="lib${LIBNAME}" # prefix with "lib"
|
||||||
case $ARCH in 'Linux' | 'GNU' | GNU/*)
|
case $ARCH in 'Linux' | 'GNU' | GNU/*)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ CONFIG_NAME = default
|
|||||||
# Version info
|
# Version info
|
||||||
MESA_MAJOR=6
|
MESA_MAJOR=6
|
||||||
MESA_MINOR=5
|
MESA_MINOR=5
|
||||||
MESA_TINY=2
|
MESA_TINY=3
|
||||||
|
|
||||||
# external projects. This should be useless now that we use libdrm.
|
# external projects. This should be useless now that we use libdrm.
|
||||||
DRM_SOURCE_PATH=$(TOP)/../drm
|
DRM_SOURCE_PATH=$(TOP)/../drm
|
||||||
@@ -63,7 +63,7 @@ SRC_DIRS = mesa glu glut/glx glw
|
|||||||
GLU_DIRS = sgi
|
GLU_DIRS = sgi
|
||||||
DRIVER_DIRS = x11 osmesa
|
DRIVER_DIRS = x11 osmesa
|
||||||
# Which subdirs under $(TOP)/progs/ to enter:
|
# Which subdirs under $(TOP)/progs/ to enter:
|
||||||
PROGRAM_DIRS = demos redbook samples xdemos
|
PROGRAM_DIRS = demos redbook samples glsl xdemos
|
||||||
|
|
||||||
|
|
||||||
# Library/program dependencies
|
# Library/program dependencies
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ ARCH_FLAGS ?=
|
|||||||
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
|
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
|
||||||
-D_BSD_SOURCE -D_GNU_SOURCE \
|
-D_BSD_SOURCE -D_GNU_SOURCE \
|
||||||
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
|
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
|
||||||
-DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN
|
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
|
||||||
|
-DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN
|
||||||
|
|
||||||
X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb` `pkg-config --cflags-only-I x11-xcb` `pkg-config --cflags-only-I xcb-glx`
|
X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb` `pkg-config --cflags-only-I x11-xcb` `pkg-config --cflags-only-I xcb-glx`
|
||||||
|
|
||||||
@@ -65,4 +66,4 @@ WINDOW_SYSTEM=dri
|
|||||||
# gamma are missing because they have not been converted to use the new
|
# gamma are missing because they have not been converted to use the new
|
||||||
# interface.
|
# interface.
|
||||||
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
|
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
|
||||||
savage sis tdfx trident unichrome ffb
|
savage sis tdfx trident unichrome ffb nouveau
|
||||||
|
|||||||
@@ -1,155 +1,163 @@
|
|||||||
File: docs/README.WIN32
|
File: docs/README.WIN32
|
||||||
|
|
||||||
Last updated: Mar 31, 2006 - Karl Schultz - kschultz@users.sourceforge.net
|
Last updated: Apr 25, 2007 - Karl Schultz - kschultz@users.sourceforge.net
|
||||||
|
|
||||||
Quick Start
|
Quick Start
|
||||||
----- -----
|
----- -----
|
||||||
|
|
||||||
Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same
|
Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same
|
||||||
directory. The libs and demos build separately, so if you do not care
|
directory. The libs and demos build separately, so if you do not care
|
||||||
about the demos or GLUT, you only need to unzip MesaLib. If you unzip
|
about the demos or GLUT, you only need to unzip MesaLib. If you unzip
|
||||||
more than one ZIP file, they all need to be unzipped into the same
|
more than one ZIP file, they all need to be unzipped into the same
|
||||||
directory. Don't worry, you will not overwrite anything.
|
directory. Don't worry, you will not overwrite anything.
|
||||||
|
|
||||||
The Windows build system uses Microsoft Visual Studio. Project files
|
The Windows build system uses Microsoft Visual Studio. Project files
|
||||||
for a specific version of Visual Studio are in their own directory in
|
for a specific version of Visual Studio are in their own directory in
|
||||||
the top-level "windows" directory. For example, Visual Studio 6 files
|
the top-level "windows" directory. For example, Visual Studio 8 files
|
||||||
are in windows/VC6. If a directory does not exist for your version of
|
are in windows/VC8.
|
||||||
Visual Studio, you can try importing the project files from an earlier
|
|
||||||
version of Visual Studio. At this time, project files exist for
|
Support has been dropped for versions of Visual Studio prior to 8. The
|
||||||
Version 6 and Version 7. The code has been built with a beta version
|
main reason is because Microsoft now provides a free compiler and
|
||||||
of Version 8 and it runs on 64-bit Windows. If you want to try this,
|
developer environment. Visual Studio Express can be found at
|
||||||
start by importing the VC7 files and create the 64-bit targets in the
|
|
||||||
configuration manager.
|
http://msdn.microsoft.com/vstudio/express/visualc/default.aspx
|
||||||
|
|
||||||
It is likely that the new and free Visual Studio Express can be used
|
You'll also need the Platform SDK. Instructions for obtaining and
|
||||||
to build Mesa, but it hasn't been tried yet. Start with the VC7
|
using the SDK with Visual Studio Express can be found at
|
||||||
project files.
|
|
||||||
|
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
|
||||||
The project files to build the core Mesa library, Windows Mesa
|
|
||||||
drivers, OSMesa, and GLU are in the mesa directory. The project files
|
If you are stuck using VC6 or VC7, you may start with these project
|
||||||
to build GLUT and some demo programs are in the progs directory.
|
files, but you may need to modify them to reflect changes in the
|
||||||
|
Mesa source code tree. If you sucessfully update the project files,
|
||||||
Makefiles are no longer shipped or supported, but can be generated
|
please submit them to the author of this document so that they may
|
||||||
from the projects using Visual Studio.
|
be included in the next distribution.
|
||||||
|
|
||||||
|
The project files to build the core Mesa library, Windows Mesa
|
||||||
Windows Drivers
|
drivers, OSMesa, and GLU are in the mesa directory. The project files
|
||||||
------- -------
|
to build GLUT and some demo programs are in the progs directory.
|
||||||
|
|
||||||
At this time, only the GDI driver is known to work. Most of the demos
|
Makefiles are no longer shipped or supported, but can be generated
|
||||||
in progs/demos should work with this driver.
|
from the projects using Visual Studio.
|
||||||
|
|
||||||
Source code also exists in the tree for other drivers in
|
|
||||||
src/mesa/drivers/windows, but the status of this code is unknown.
|
Windows Drivers
|
||||||
|
------- -------
|
||||||
The GDI driver operates basically by writing pixel spans into a DIB
|
|
||||||
section and then blitting the DIB to the window. The driver was
|
At this time, only the GDI driver is known to work. Most of the demos
|
||||||
recently cleaned up and rewitten and so may have bugs or may be
|
in progs/demos should work with this driver.
|
||||||
missing some functionality. The older versions of the CVS source may
|
|
||||||
be useful in figuring out any problems, or report them to me.
|
Source code also exists in the tree for other drivers in
|
||||||
|
src/mesa/drivers/windows, but the status of this code is unknown.
|
||||||
To build Mesa with the GDI driver, build the mesa, gdi, and glu
|
|
||||||
projects in the Visual Studio workspace found at
|
The GDI driver operates basically by writing pixel spans into a DIB
|
||||||
|
section and then blitting the DIB to the window. The driver was
|
||||||
windows/VC6/mesa/mesa.dsw
|
recently cleaned up and rewitten and so may have bugs or may be
|
||||||
or
|
missing some functionality. The older versions of the CVS source may
|
||||||
windows/VC7/mesa/mesa.sln
|
be useful in figuring out any problems, or report them to me.
|
||||||
|
|
||||||
The osmesa DLL can also be built with the osmesa project.
|
To build Mesa with the GDI driver, build the mesa, gdi, and glu
|
||||||
|
projects in the Visual Studio workspace found at
|
||||||
The build system creates a lib top-level directory and copies
|
|
||||||
resulting LIB and DLL files to this lib directory. The files are:
|
windows/VC8/mesa/mesa.sln
|
||||||
|
|
||||||
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
|
The osmesa DLL can also be built with the osmesa project.
|
||||||
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
|
|
||||||
|
The build system creates a lib top-level directory and copies
|
||||||
If the MesaDemos ZIP file was extracted, the DLL files are also copied
|
resulting LIB and DLL files to this lib directory. The files are:
|
||||||
to the demos directory. This facilitates running the demos as described
|
|
||||||
below.
|
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
|
||||||
|
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
|
||||||
|
|
||||||
GLUT and Demos
|
If the MesaDemos ZIP file was extracted, the DLL files are also copied
|
||||||
---- --- -----
|
to the demos directory. This facilitates running the demos as described
|
||||||
|
below.
|
||||||
A Visual Studio workspace can be found at
|
|
||||||
|
|
||||||
windows/VC6/progs/progs.dsw
|
GLUT and Demos
|
||||||
or
|
---- --- -----
|
||||||
windows/VC7/progs/progs.sln
|
|
||||||
|
A Visual Studio workspace can be found at
|
||||||
It can be used to build GLUT and a few demos. The GLUT lib and DLL
|
|
||||||
are copied to the top-level lib directory, along with the Mesa libs.
|
windows/VC8/progs/progs.sln
|
||||||
|
|
||||||
The demo build system expects to find the LIB files in the top level
|
It can be used to build GLUT and a few demos. The GLUT lib and DLL
|
||||||
lib directory, so you must build the Mesa libs first. The demo
|
are copied to the top-level lib directory, along with the Mesa libs.
|
||||||
executables are placed in the demos directory, because some of them
|
|
||||||
rely on data files found there. Also, the Mesa lib DLL's were copied
|
The demo build system expects to find the LIB files in the top level
|
||||||
there by the Mesa lib build process. Therefore, you should be able to
|
lib directory, so you must build the Mesa libs first. The demo
|
||||||
simply run the demo executables from the demo directory.
|
executables are placed in the demos directory, because some of them
|
||||||
|
rely on data files found there. Also, the Mesa lib DLL's were copied
|
||||||
If you want to run the demos from the Visual Studio, you may have to
|
there by the Mesa lib build process. Therefore, you should be able to
|
||||||
change the startup directory and explicitly state where the executables are.
|
simply run the demo executables from the demo directory.
|
||||||
|
|
||||||
You may also build all the demo programs by using a makefile. Go to
|
If you want to run the demos from the Visual Studio, you may have to
|
||||||
the progs/demos directory and make sure you have executed VCVARS32.BAT
|
change the startup directory and explicitly state where the executables are.
|
||||||
or whatever setup script is appropriate for your compiler. Then,
|
|
||||||
|
You may also build all the demo programs by using a makefile. Go to
|
||||||
nmake -f Makefile.win
|
the progs/demos directory and make sure you have executed VCVARS32.BAT
|
||||||
|
or whatever setup script is appropriate for your compiler. Then,
|
||||||
should build all the demos.
|
|
||||||
|
nmake -f Makefile.win
|
||||||
|
|
||||||
Build System Notes
|
should build all the demos.
|
||||||
----- ------ -----
|
|
||||||
|
|
||||||
VC6
|
Build System Notes
|
||||||
---
|
----- ------ -----
|
||||||
|
|
||||||
Visual Studio 6 does not recognize files with the .cc extension as C++
|
VC6 (not actively supported)
|
||||||
language files, without a lot of unnatural tweaking. So, the VC6
|
---
|
||||||
build process uses custom build steps to compile these files in the
|
|
||||||
GLU library.
|
Visual Studio 6 does not recognize files with the .cc extension as C++
|
||||||
|
language files, without a lot of unnatural tweaking. So, the VC6
|
||||||
Two additional configurations are provided, Debug x86 and Release x86
|
build process uses custom build steps to compile these files in the
|
||||||
that activate the shader code compilation by defining SLANG_86. It is
|
GLU library.
|
||||||
unknown if and how this works.
|
|
||||||
|
Two additional configurations are provided, Debug x86 and Release x86
|
||||||
VC7
|
that activate the shader code compilation by defining SLANG_86. It is
|
||||||
---
|
unknown if and how this works.
|
||||||
|
|
||||||
The above-mentioned .cc problem does not exist in this version.
|
VC7 (not actively supported)
|
||||||
|
---
|
||||||
|
|
||||||
General
|
The above-mentioned .cc problem does not exist in this version.
|
||||||
-------
|
|
||||||
|
VC8
|
||||||
After building, you can copy the above DLL files to a place in your
|
---
|
||||||
PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
|
|
||||||
in a system directory, place them in the same directory as the
|
No notes.
|
||||||
executable(s). Be careful about accidentially overwriting files of
|
|
||||||
the same name in the SYSTEM32 directory.
|
|
||||||
|
General
|
||||||
The DLL files are built so that the external entry points use the
|
-------
|
||||||
stdcall calling convention.
|
|
||||||
|
After building, you can copy the above DLL files to a place in your
|
||||||
Static LIB files are not built. The LIB files that are built with are
|
PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
|
||||||
the linker import files associated with the DLL files.
|
in a system directory, place them in the same directory as the
|
||||||
|
executable(s). Be careful about accidentially overwriting files of
|
||||||
The si-glu sources are used to build the GLU libs. This was done
|
the same name in the SYSTEM32 directory.
|
||||||
mainly to get the better tessellator code.
|
|
||||||
|
The DLL files are built so that the external entry points use the
|
||||||
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
|
stdcall calling convention.
|
||||||
to the project settings. You will also need to edit src/mesa.def to
|
|
||||||
change all the gl* symbols to mgl*. Because this is easy to do with a
|
Static LIB files are not built. The LIB files that are built with are
|
||||||
global replace operation in a text editor, no additional mangled
|
the linker import files associated with the DLL files.
|
||||||
version of mesa.def is maintained or shipped.
|
|
||||||
|
The si-glu sources are used to build the GLU libs. This was done
|
||||||
If you have a Windows-related build problem or question, it is
|
mainly to get the better tessellator code.
|
||||||
probably better to direct it to me (kschultz@users.sourceforge.net),
|
|
||||||
rather than directly to the other Mesa developers. I will help you as
|
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
|
||||||
much as I can. I also monitor the Mesa mailing lists and will answer
|
to the project settings. You will also need to edit src/mesa.def to
|
||||||
questions in this area there as well.
|
change all the gl* symbols to mgl*. Because this is easy to do with a
|
||||||
|
global replace operation in a text editor, no additional mangled
|
||||||
|
version of mesa.def is maintained or shipped.
|
||||||
Karl Schultz
|
|
||||||
|
If you have a Windows-related build problem or question, it is
|
||||||
|
probably better to direct it to me (kschultz@users.sourceforge.net),
|
||||||
|
rather than directly to the other Mesa developers. I will help you as
|
||||||
|
much as I can. I also monitor the Mesa mailing lists and will answer
|
||||||
|
questions in this area there as well.
|
||||||
|
|
||||||
|
|
||||||
|
Karl Schultz
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ a:visited {
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="intro.html" target="MainFrame">Introduction</a>
|
<li><a href="intro.html" target="MainFrame">Introduction</a>
|
||||||
<li><a href="news.html" target="MainFrame">News</a>
|
<li><a href="news.html" target="MainFrame">News</a>
|
||||||
|
<LI><A HREF="developers.html" target="MainFrame">Developers</A>
|
||||||
<li><a href="systems.html" target="MainFrame">Platforms and Drivers</a>
|
<li><a href="systems.html" target="MainFrame">Platforms and Drivers</a>
|
||||||
<li><a href="license.html" target="MainFrame">License & Copyright</a>
|
<li><a href="license.html" target="MainFrame">License & Copyright</a>
|
||||||
<li><a href="faq.html" target="MainFrame">FAQ</a>
|
<li><a href="faq.html" target="MainFrame">FAQ</a>
|
||||||
@@ -64,6 +65,7 @@ a:visited {
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="http://sourceforge.net/projects/mesa3d" target="_parent">SourceForge homepage</a>
|
<li><a href="http://sourceforge.net/projects/mesa3d" target="_parent">SourceForge homepage</a>
|
||||||
<li><a href="repository.html" target="MainFrame">Source Code Repository</a>
|
<li><a href="repository.html" target="MainFrame">Source Code Repository</a>
|
||||||
|
<li><a href="memory.html" target="MainFrame">DRI Memory Management</a>
|
||||||
<li><a href="shading.html" target="MainFrame">Shading Language</a>
|
<li><a href="shading.html" target="MainFrame">Shading Language</a>
|
||||||
<li><a href="utilities.html" target="MainFrame">Utilities</a>
|
<li><a href="utilities.html" target="MainFrame">Utilities</a>
|
||||||
<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a>
|
<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a>
|
||||||
@@ -72,7 +74,6 @@ a:visited {
|
|||||||
<li><a href="subset.html" target="MainFrame">Subset Information</a>
|
<li><a href="subset.html" target="MainFrame">Subset Information</a>
|
||||||
<li><a href="fbdev-dri.html" target="MainFrame">fbdev/DRI Environment</a>
|
<li><a href="fbdev-dri.html" target="MainFrame">fbdev/DRI Environment</a>
|
||||||
<li><a href="glfbdev-driver.html" target="MainFrame">glFBDev Driver</a>
|
<li><a href="glfbdev-driver.html" target="MainFrame">glFBDev Driver</a>
|
||||||
<LI><A HREF="custom.html" target="MainFrame">Custom Development</A>
|
|
||||||
<LI><A HREF="dispatch.html" target="MainFrame">GL Dispatch</A>
|
<LI><A HREF="dispatch.html" target="MainFrame">GL Dispatch</A>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
<HTML>
|
|
||||||
|
|
||||||
<TITLE>Custom Development</TITLE>
|
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
|
||||||
|
|
||||||
<BODY>
|
|
||||||
|
|
||||||
<H1>Custom Development</H1>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Mesa is primarily developed and maintained on a volunteer basis.
|
|
||||||
Some Mesa development work has been done in conjuction with contracted
|
|
||||||
projects, such as the XFree86/DRI drivers.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<pre>[Begin shameless plug]</pre>
|
|
||||||
If you have a need for specific or custom Mesa development work,
|
|
||||||
<a href="http://www.tungstengraphics.com/" target="_parent">
|
|
||||||
Tungsten Graphics, Inc.</a> may be able to help you.
|
|
||||||
<pre>[End shameless plug]</pre>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
51
docs/developers.html
Normal file
51
docs/developers.html
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<HTML>
|
||||||
|
|
||||||
|
<TITLE>Developers</TITLE>
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||||
|
|
||||||
|
<BODY>
|
||||||
|
|
||||||
|
<H1>Developers</H1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Both professional and volunteer developers contribute to Mesa.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="http://www.tungstengraphics.com/" target="_parent">Tungsten Graphics</a>
|
||||||
|
employs several of the main Mesa developers including Brian Paul
|
||||||
|
and Keith Whitwell.
|
||||||
|
Much of the on-going work in Mesa is done through Tungsten Graphics engineering
|
||||||
|
contracts.
|
||||||
|
Prominent examples of this work includes:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>DRI drivers for Intel i965, i945, i915 and other chips
|
||||||
|
<li>Advanced memory manager and framebuffer object support
|
||||||
|
<li>Shading language compiler and OpenGL 2.0 support
|
||||||
|
<li>MiniGLX environment
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Other companies including
|
||||||
|
<a href="http://www.intellinuxgraphics.org/index.html" target="_parent">Intel</a>
|
||||||
|
and IBM also actively contribute to the project.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Volunteers have made significant contributions to all parts of Mesa, including
|
||||||
|
complete device drivers.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<H1>Custom Development</H1>
|
||||||
|
<p>
|
||||||
|
Contact <a href="http://www.tungstengraphics.com/" target="_parent">
|
||||||
|
Tungsten Graphics</a>
|
||||||
|
for information about custom development in Mesa, OpenGL, X and other
|
||||||
|
graphics technologies.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
<H1>Downloading</H1>
|
<H1>Downloading</H1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Last development release: <b>6.5.2</b>
|
Last development release: <b>6.5.3</b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -9,35 +9,31 @@
|
|||||||
<H1>Introduction</H1>
|
<H1>Introduction</H1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Mesa is a 3-D graphics library with an API which is very similar to
|
Mesa is an open-source implementation of the
|
||||||
that of <a href="http://www.opengl.org/" target="_parent">OpenGL</a>.*
|
<a href="http://www.opengl.org/" target="_parent">OpenGL</a> specification -
|
||||||
To the extent that Mesa utilizes the OpenGL command syntax or state
|
a system for rendering interactive 3D graphics.
|
||||||
machine, it is being used with authorization from <a
|
|
||||||
href="http://www.sgi.com/" target="_parent">Silicon Graphics,
|
|
||||||
Inc.</a>(SGI). However, the author does not possess an OpenGL license
|
|
||||||
from SGI, and makes no claim that Mesa is in any way a compatible
|
|
||||||
replacement for OpenGL or associated with SGI. Those who want a
|
|
||||||
licensed implementation of OpenGL should contact a licensed
|
|
||||||
vendor.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Please do not refer to the library as <em>MesaGL</em> (for legal
|
A variety of device drivers allows Mesa to be used in many different
|
||||||
reasons). It's just <em>Mesa</em> or <em>The Mesa 3-D graphics
|
environments ranging from software emulation to complete hardware acceleration
|
||||||
library</em>. <br>
|
for modern GPUs.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
* OpenGL is a trademark of <a href="http://www.sgi.com/"
|
Mesa ties into several other open-source projects: the
|
||||||
target="_parent">Silicon Graphics Incorporated</a>.
|
<a href="http://dri.sf.net/" target="_parent">Direct Rendering Infrastructure</a>
|
||||||
|
and <a href="http://x.org" target="_parent">X.org</a> to provide OpenGL
|
||||||
|
support to users of X on Linux, FreeBSD and other operating systems.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<H1>Project History</H1>
|
<H1>Project History</H1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The Mesa project was founded by me, Brian Paul. Here's a short history
|
The Mesa project was originally started by Brian Paul.
|
||||||
of the project.
|
Here's a short history of the project.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -6,6 +6,34 @@
|
|||||||
|
|
||||||
<BODY>
|
<BODY>
|
||||||
|
|
||||||
|
<H1>Disclaimer</H1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Mesa is a 3-D graphics library with an API which is very similar to
|
||||||
|
that of <a href="http://www.opengl.org/" target="_parent">OpenGL</a>.*
|
||||||
|
To the extent that Mesa utilizes the OpenGL command syntax or state
|
||||||
|
machine, it is being used with authorization from <a
|
||||||
|
href="http://www.sgi.com/" target="_parent">Silicon Graphics,
|
||||||
|
Inc.</a>(SGI). However, the author does not possess an OpenGL license
|
||||||
|
from SGI, and makes no claim that Mesa is in any way a compatible
|
||||||
|
replacement for OpenGL or associated with SGI. Those who want a
|
||||||
|
licensed implementation of OpenGL should contact a licensed
|
||||||
|
vendor.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Please do not refer to the library as <em>MesaGL</em> (for legal
|
||||||
|
reasons). It's just <em>Mesa</em> or <em>The Mesa 3-D graphics
|
||||||
|
library</em>. <br>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
* OpenGL is a trademark of <a href="http://www.sgi.com/"
|
||||||
|
target="_parent">Silicon Graphics Incorporated</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<H1>License / Copyright Information</H1>
|
<H1>License / Copyright Information</H1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@@ -24,7 +52,7 @@ The default Mesa license is as follows:
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
copy of this software and associated documentation files (the "Software"),
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
|||||||
@@ -11,6 +11,33 @@
|
|||||||
<H1>News</H1>
|
<H1>News</H1>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>April 27, 2007</h2>
|
||||||
|
<p>
|
||||||
|
<a href="relnotes-6.5.3.html">Mesa 6.5.3</a> is released.
|
||||||
|
This is a development release which will lead up to the Mesa 7.0 release
|
||||||
|
(which will advertise OpenGL 2.1 API support).
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>March 26, 2007</h2>
|
||||||
|
<p>
|
||||||
|
The new Shading Language compiler branch has been merged into the git
|
||||||
|
master branch. This is a step toward hardware support for the OpenGL
|
||||||
|
2.0 Shading Language and will be included in the next Mesa release.
|
||||||
|
In conjunction, <a href="http://glean.sf.net" target="_parent">Glean
|
||||||
|
</a> has been updated with a new test that does over 130 tests of the
|
||||||
|
shading language and built-in functions.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>April 2007</h2>
|
||||||
|
<p>
|
||||||
|
Thomas Hellström of
|
||||||
|
<a href="http://www.tungstengraphics.com" target="_parent">
|
||||||
|
Tungsten Graphics</a> has written a whitepaper describing the new
|
||||||
|
<a href="http://www.tungstengraphics.com/mm.pdf">DRI memory management
|
||||||
|
system</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2>December 5, 2006</h2>
|
<h2>December 5, 2006</h2>
|
||||||
<p>
|
<p>
|
||||||
Mesa is now using git as its source code management system.
|
Mesa is now using git as its source code management system.
|
||||||
|
|||||||
@@ -8,10 +8,11 @@
|
|||||||
|
|
||||||
<body bgcolor="#eeeeee">
|
<body bgcolor="#eeeeee">
|
||||||
|
|
||||||
<H1>Mesa 6.5.3 Release Notes / (in progress)</H1>
|
<H1>Mesa 6.5.3 Release Notes / April 27, 2007</H1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Mesa 6.5.3 is a 6.5 follow-on development release with many internal changes.
|
Mesa 6.5.3 is a development release with many changes and new features.
|
||||||
|
Mesa 7.0 is expected to follow shortly.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
@@ -21,14 +22,31 @@ TBD
|
|||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Shared library numbering</h2>
|
||||||
|
<p>
|
||||||
|
Mesa 6.5.3 supports the OpenGL 2.0/2.1 API. However, the (unix)
|
||||||
|
shared library version is still 1.5 (i.e. libGL.so.1.5.xxxxxx).
|
||||||
|
Bumping the shared library version to 2.x would cause linking problems
|
||||||
|
with existing OpenGL applications. Since OpenGL 2.x is backward
|
||||||
|
compatible with OpenGL 1.x the shared library version number doesn't
|
||||||
|
have to be incremented (which would indicate an incompatible ABI).
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Other OpenGL vendors name their OpenGL 2.x libraries libGL.so.1.0.xxxxx
|
||||||
|
for the same reason.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>New features</h2>
|
<h2>New features</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>OpenGL 2.0 support.
|
<li>OpenGL 2.0 and 2.1 API support.
|
||||||
<li>Entirely new Shading Language code generator.
|
<li>Entirely new Shading Language code generator. See the
|
||||||
|
<a href="shading.html">Shading Language</a> page for more information.
|
||||||
<li>Much faster software execution of vertex, fragment shaders.
|
<li>Much faster software execution of vertex, fragment shaders.
|
||||||
<li>New vertex buffer object infrastructure (replaces old array_cache code).
|
<li>New vertex buffer object (vbo) infrastructure
|
||||||
<li>Updated glext.h file (version 39)
|
<li>Updated glext.h file (version 39)
|
||||||
<li>Updated glxext.h file (version 18)
|
<li>Updated glxext.h file (version 19)
|
||||||
<li>GL_MAX_DRAWBUFFERS is now 4 (software rendering) so
|
<li>GL_MAX_DRAWBUFFERS is now 4 (software rendering) so
|
||||||
"multiple render targets" are really supported.
|
"multiple render targets" are really supported.
|
||||||
</ul>
|
</ul>
|
||||||
@@ -40,20 +58,25 @@ TBD
|
|||||||
<li>With 32-bit Z buffer, the fragment Z of lines and points was sometimes wrong.
|
<li>With 32-bit Z buffer, the fragment Z of lines and points was sometimes wrong.
|
||||||
<li>GL_POST_CONVOLUTION_ALPHA_BIAS/SCALE was broken.
|
<li>GL_POST_CONVOLUTION_ALPHA_BIAS/SCALE was broken.
|
||||||
<li>1D convolution state could effect 2D image transfers
|
<li>1D convolution state could effect 2D image transfers
|
||||||
|
<li>Overlapping glCopyPixels with negative Y zoom didn't work (bug 10521)
|
||||||
|
<li>Fixed a number of framebuffer/renderbuffer reference counting bugs
|
||||||
|
<li>Fixed a few bugs in software-emulated alpha planes
|
||||||
|
<li>Assorted minor bug fixes in glCopy/DrawPixels, glPixelZoom, etc.
|
||||||
|
<li>Assorted DRI driver bug fixes.
|
||||||
|
<li>Fixed a number of bugs that prevented "depth-peeling" rendering from working.
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<h2>Internal code changes</h2>
|
<h2>Internal code changes</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Massive changes to the Shading Language compiler.
|
<li>Old array_cache module replaced by new vbo module. All geometry
|
||||||
<li>The _MaintainTnlProgram, _MaintainTexEnvProgram, _TexEnvProgram and
|
rendering is now cast in the form of vertex buffer objects.
|
||||||
_TnlProgram fields have been moved.
|
<li>Massive changes to the Shading Language compiler and related state.
|
||||||
<li>The ctx->FragmentProgram._Active field has been removed.
|
<li>Vertex/fragment shaders are compiled into GPU instructions and
|
||||||
<li>The ctx->Vertex/FragmentProgram._Current fields point to the program
|
programs very similar to GL_ARB_vertex/fragment_program.
|
||||||
in effect, whether it comes from a shader, user-program or generated
|
<li>Vertex and fragment programs are executed with the same code now.
|
||||||
fixed-function program.
|
<li>The SSE-optimized vertex program path has been removed since it didn't
|
||||||
<li>The _UseTexEnvProgram field has been removed.
|
support more than 12 temp registers, didn't support branching/looping, etc.
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
@@ -71,17 +94,17 @@ fixed-function program.
|
|||||||
Driver Status
|
Driver Status
|
||||||
---------------------- ----------------------
|
---------------------- ----------------------
|
||||||
DRI drivers varies with the driver
|
DRI drivers varies with the driver
|
||||||
XMesa/GLX (on Xlib) implements OpenGL 2.0
|
XMesa/GLX (on Xlib) implements OpenGL 2.1
|
||||||
OSMesa (off-screen) implements OpenGL 2.0
|
OSMesa (off-screen) implements OpenGL 2.1
|
||||||
|
Windows/Win32 implements OpenGL 2.1
|
||||||
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
|
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
|
||||||
SVGA implements OpenGL 1.3
|
SVGA unsupported
|
||||||
Wind River UGL implements OpenGL 1.3
|
Wind River UGL unsupported
|
||||||
Windows/Win32 implements OpenGL 1.5
|
DJGPP unsupported
|
||||||
DJGPP implements OpenGL 1.5
|
GGI unsupported
|
||||||
GGI implements OpenGL 1.3
|
BeOS unsupported
|
||||||
BeOS implements OpenGL 1.5
|
Allegro unsupported
|
||||||
Allegro needs updating
|
D3D unsupported
|
||||||
D3D needs updating
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ OpenGL Shading Language</a>.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Last updated on 17 Feb 2007.
|
Last updated on 28 March 2007.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@@ -27,6 +27,7 @@ Contents
|
|||||||
<li><a href="#hints">Programming Hints</a>
|
<li><a href="#hints">Programming Hints</a>
|
||||||
<li><a href="#standalone">Stand-alone Compiler</a>
|
<li><a href="#standalone">Stand-alone Compiler</a>
|
||||||
<li><a href="#implementation">Compiler Implementation</a>
|
<li><a href="#implementation">Compiler Implementation</a>
|
||||||
|
<li><a href="#validation">Compiler Validation</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
@@ -40,11 +41,13 @@ in Mesa:
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Dereferencing arrays with non-constant indexes
|
<li>Dereferencing arrays with non-constant indexes
|
||||||
<li>User-defined structs
|
<li>Comparison of user-defined structs
|
||||||
<li>Linking of multiple shaders is not supported
|
<li>Linking of multiple shaders is not supported
|
||||||
<li>Integer operations are not fully implemented (most are implemented
|
|
||||||
as floating point).
|
|
||||||
<li>gl_ClipVertex
|
<li>gl_ClipVertex
|
||||||
|
<li>The derivative functions such as dFdx() are not implemented
|
||||||
|
<li>The inverse trig functions asin(), acos(), and atan() are not implemented
|
||||||
|
<li>The gl_Color and gl_SecondaryColor varying vars are interpolated
|
||||||
|
without perspective correction
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@@ -67,7 +70,8 @@ All other major features of the shading language should function.
|
|||||||
<li>The quality of generated code is pretty good, register usage is fair.
|
<li>The quality of generated code is pretty good, register usage is fair.
|
||||||
<li>Shader error detection and reporting of errors (InfoLog) is not
|
<li>Shader error detection and reporting of errors (InfoLog) is not
|
||||||
very good yet.
|
very good yet.
|
||||||
<li>There are known memory leaks in the compiler.
|
<li>The ftransform() function doesn't necessarily match the results of
|
||||||
|
fixed-function transformation.
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@@ -121,6 +125,9 @@ These issues will be addressed/resolved in the future.
|
|||||||
<pre>
|
<pre>
|
||||||
float x = inversesqrt(y);
|
float x = inversesqrt(y);
|
||||||
</pre>
|
</pre>
|
||||||
|
<li>
|
||||||
|
Use ++i when possible as it's more efficient than i++
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
@@ -282,5 +289,24 @@ Extra NOP instructions will also be inserted.
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<a name="validation">
|
||||||
|
<h2>Compiler Validation</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
A new <a href="http://glean.sf.net" target="_parent">Glean</a> test has
|
||||||
|
been create to exercise the GLSL compiler.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The <em>glsl1</em> test runs over 150 sub-tests to check that the language
|
||||||
|
features and built-in functions work properly.
|
||||||
|
This test should be run frequently while working on the compiler to catch
|
||||||
|
regressions.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The test coverage is reasonably broad and complete but additional tests
|
||||||
|
should be added.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
</BODY>
|
</BODY>
|
||||||
</HTML>
|
</HTML>
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ WIDTH="88" HEIGHT="31" ALIGN="BOTTOM" ALT="Sourceforge.net" BORDER="0"></A>
|
|||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<li>The Mesa CVS repository is hosted by
|
<li>The Mesa git repository is hosted by
|
||||||
<a href="http://freedesktop.org/" target="_parent">freedesktop.org</a>.
|
<a href="http://freedesktop.org/" target="_parent">freedesktop.org</a>.
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@@ -27,10 +27,6 @@
|
|||||||
#define MANGLE(x) mgl##x
|
#define MANGLE(x) mgl##x
|
||||||
#endif /*MANGLE*/
|
#endif /*MANGLE*/
|
||||||
|
|
||||||
/* Internal symbols which may collide with other OpenGL implementations. */
|
|
||||||
#define __glCoreCreateContext __mglCoreCreateContext
|
|
||||||
#define __glCoreNopDispatch __mglCoreNopDispatch
|
|
||||||
|
|
||||||
/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */
|
/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */
|
||||||
|
|
||||||
#define glAccum MANGLE(Accum)
|
#define glAccum MANGLE(Accum)
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ extern "C" {
|
|||||||
/*************************************************************/
|
/*************************************************************/
|
||||||
|
|
||||||
/* Header file version number, required by OpenGL ABI for Linux */
|
/* Header file version number, required by OpenGL ABI for Linux */
|
||||||
/* glxext.h last updated 2007/02/13 */
|
/* glxext.h last updated 2007/04/21 */
|
||||||
/* Current version at http://www.opengl.org/registry/ */
|
/* Current version at http://www.opengl.org/registry/ */
|
||||||
#define GLX_GLXEXT_VERSION 18
|
#define GLX_GLXEXT_VERSION 19
|
||||||
|
|
||||||
#ifndef GLX_VERSION_1_3
|
#ifndef GLX_VERSION_1_3
|
||||||
#define GLX_WINDOW_BIT 0x00000001
|
#define GLX_WINDOW_BIT 0x00000001
|
||||||
@@ -386,7 +386,7 @@ typedef struct {
|
|||||||
/* (as used in the GLX_OML_sync_control extension). */
|
/* (as used in the GLX_OML_sync_control extension). */
|
||||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#elif defined(__sun__)
|
#elif defined(__sun__) || defined(__digital__)
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#if defined(__STDC__)
|
#if defined(__STDC__)
|
||||||
#if defined(__arch64__)
|
#if defined(__arch64__)
|
||||||
|
|||||||
@@ -38,17 +38,11 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef CAPI
|
|
||||||
#undef CAPI
|
|
||||||
#endif
|
|
||||||
#define CAPI
|
|
||||||
|
|
||||||
#define GL_CORE_SGI 1
|
#define GL_CORE_SGI 1
|
||||||
#define GL_CORE_MESA 2
|
#define GL_CORE_MESA 2
|
||||||
#define GL_CORE_APPLE 4
|
#define GL_CORE_APPLE 4
|
||||||
|
|
||||||
typedef struct __GLcontextRec __GLcontext;
|
typedef struct __GLcontextRec __GLcontext;
|
||||||
typedef struct __GLinterfaceRec __GLinterface;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** This file defines the interface between the GL core and the surrounding
|
** This file defines the interface between the GL core and the surrounding
|
||||||
@@ -186,81 +180,4 @@ typedef struct __GLcontextModesRec {
|
|||||||
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
|
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
|
||||||
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
|
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
** Procedures which are imported by the GL from the surrounding
|
|
||||||
** "operating system". Math functions are not considered part of the
|
|
||||||
** "operating system".
|
|
||||||
*/
|
|
||||||
typedef struct __GLimportsRec {
|
|
||||||
/* Memory management */
|
|
||||||
void * (*malloc)(__GLcontext *gc, size_t size);
|
|
||||||
void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize);
|
|
||||||
void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize);
|
|
||||||
void (*free)(__GLcontext *gc, void *addr);
|
|
||||||
|
|
||||||
/* Error handling */
|
|
||||||
void (*warning)(__GLcontext *gc, char *fmt);
|
|
||||||
void (*fatal)(__GLcontext *gc, char *fmt);
|
|
||||||
|
|
||||||
/* other system calls */
|
|
||||||
char *(CAPI *getenv)(__GLcontext *gc, const char *var);
|
|
||||||
int (CAPI *atoi)(__GLcontext *gc, const char *str);
|
|
||||||
int (CAPI *sprintf)(__GLcontext *gc, char *str, const char *fmt, ...);
|
|
||||||
void *(CAPI *fopen)(__GLcontext *gc, const char *path, const char *mode);
|
|
||||||
int (CAPI *fclose)(__GLcontext *gc, void *stream);
|
|
||||||
int (CAPI *fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...);
|
|
||||||
|
|
||||||
/* Drawing surface management */
|
|
||||||
void *(*getDrawablePrivate)(__GLcontext *gc);
|
|
||||||
void *(*getReadablePrivate)(__GLcontext *gc);
|
|
||||||
|
|
||||||
/* Operating system dependent data goes here */
|
|
||||||
void *other;
|
|
||||||
} __GLimports;
|
|
||||||
|
|
||||||
/************************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
** Procedures which are exported by the GL to the surrounding "operating
|
|
||||||
** system" so that it can manage multiple GL context's.
|
|
||||||
*/
|
|
||||||
typedef struct __GLexportsRec {
|
|
||||||
/* Context management (return GL_FALSE on failure) */
|
|
||||||
GLboolean (*destroyContext)(__GLcontext *gc);
|
|
||||||
GLboolean (*loseCurrent)(__GLcontext *gc);
|
|
||||||
/* oldglPriv isn't used anymore, kept for backwards compatibility */
|
|
||||||
GLboolean (*makeCurrent)(__GLcontext *gc);
|
|
||||||
GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare);
|
|
||||||
GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask);
|
|
||||||
GLboolean (*forceCurrent)(__GLcontext *gc);
|
|
||||||
|
|
||||||
/* Drawing surface notification callbacks */
|
|
||||||
GLboolean (*notifyResize)(__GLcontext *gc);
|
|
||||||
void (*notifyDestroy)(__GLcontext *gc);
|
|
||||||
void (*notifySwapBuffers)(__GLcontext *gc);
|
|
||||||
|
|
||||||
/* Dispatch table override control for external agents like libGLS */
|
|
||||||
struct __GLdispatchStateRec* (*dispatchExec)(__GLcontext *gc);
|
|
||||||
void (*beginDispatchOverride)(__GLcontext *gc);
|
|
||||||
void (*endDispatchOverride)(__GLcontext *gc);
|
|
||||||
} __GLexports;
|
|
||||||
|
|
||||||
/************************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
** This must be the first member of a __GLcontext structure. This is the
|
|
||||||
** only part of a context that is exposed to the outside world; everything
|
|
||||||
** else is opaque.
|
|
||||||
*/
|
|
||||||
struct __GLinterfaceRec {
|
|
||||||
__GLimports imports;
|
|
||||||
__GLexports exports;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern __GLcontext *__glCoreCreateContext(__GLimports *, __GLcontextModes *);
|
|
||||||
extern void __glCoreNopDispatch(void);
|
|
||||||
|
|
||||||
#endif /* __gl_core_h_ */
|
#endif /* __gl_core_h_ */
|
||||||
|
|||||||
@@ -180,6 +180,21 @@ extern XMesaContext XMesaCreateContext( XMesaVisual v,
|
|||||||
extern void XMesaDestroyContext( XMesaContext c );
|
extern void XMesaDestroyContext( XMesaContext c );
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XFree86Server
|
||||||
|
/*
|
||||||
|
* These are the extra routines required for integration with XFree86.
|
||||||
|
* None of these routines should be user visible. -KEM
|
||||||
|
*/
|
||||||
|
extern GLboolean XMesaForceCurrent( XMesaContext c );
|
||||||
|
|
||||||
|
extern GLboolean XMesaLoseCurrent( XMesaContext c );
|
||||||
|
|
||||||
|
extern GLboolean XMesaCopyContext( XMesaContext src,
|
||||||
|
XMesaContext dst,
|
||||||
|
GLuint mask );
|
||||||
|
#endif /* XFree86Server */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create an XMesaBuffer from an X window.
|
* Create an XMesaBuffer from an X window.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
|
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
|
#include "gcstruct.h"
|
||||||
|
|
||||||
typedef struct _XMesaImageRec XMesaImage;
|
typedef struct _XMesaImageRec XMesaImage;
|
||||||
|
|
||||||
@@ -123,8 +124,7 @@ do { \
|
|||||||
do { \
|
do { \
|
||||||
/* Assumes: Images are always in ZPixmap format */ \
|
/* Assumes: Images are always in ZPixmap format */ \
|
||||||
(void) __d; \
|
(void) __d; \
|
||||||
if (__sx || __sy) /* The non-trivial case */ \
|
ASSERT(!__sx && !__sy); /* The SubImage case */ \
|
||||||
XMesaPutImageHelper(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h); \
|
|
||||||
ValidateGC(__b, __gc); \
|
ValidateGC(__b, __gc); \
|
||||||
(*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \
|
(*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \
|
||||||
__x, __y, __w, __h, 0, ZPixmap, \
|
__x, __y, __w, __h, 0, ZPixmap, \
|
||||||
|
|||||||
@@ -118,34 +118,39 @@ extfuncs.h: $(TOP)/progs/util/extfuncs.h
|
|||||||
|
|
||||||
|
|
||||||
reflect: reflect.o showbuffer.o readtex.o
|
reflect: reflect.o showbuffer.o readtex.o
|
||||||
$(CC) -I$(INCDIR) $(CFLAGS) reflect.o showbuffer.o readtex.o $(APP_LIB_DEPS) -o $@
|
$(CC) reflect.o showbuffer.o readtex.o $(APP_LIB_DEPS) -o $@
|
||||||
|
|
||||||
reflect.o: reflect.c showbuffer.h
|
reflect.o: reflect.c showbuffer.h
|
||||||
$(CC) -c -I$(INCDIR) $(CFLAGS) reflect.c
|
$(CC) -c -I$(INCDIR) $(CFLAGS) reflect.c
|
||||||
|
|
||||||
|
|
||||||
shadowtex: shadowtex.o showbuffer.o
|
shadowtex: shadowtex.o showbuffer.o
|
||||||
$(CC) -I$(INCDIR) $(CFLAGS) shadowtex.o showbuffer.o $(APP_LIB_DEPS) -o $@
|
$(CC) shadowtex.o showbuffer.o $(APP_LIB_DEPS) -o $@
|
||||||
|
|
||||||
shadowtex.o: shadowtex.c showbuffer.h
|
shadowtex.o: shadowtex.c showbuffer.h
|
||||||
$(CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c
|
$(CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c
|
||||||
|
|
||||||
|
|
||||||
gloss: gloss.o trackball.o readtex.o
|
gloss: gloss.o trackball.o readtex.o
|
||||||
$(CC) -I$(INCDIR) $(CFLAGS) gloss.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@
|
$(CC) gloss.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@
|
||||||
|
|
||||||
gloss.o: gloss.c trackball.h
|
gloss.o: gloss.c trackball.h
|
||||||
$(CC) -c -I$(INCDIR) $(CFLAGS) gloss.c
|
$(CC) -c -I$(INCDIR) $(CFLAGS) gloss.c
|
||||||
|
|
||||||
|
|
||||||
engine: engine.o trackball.o readtex.o
|
engine: engine.o trackball.o readtex.o
|
||||||
$(CC) -I$(INCDIR) $(CFLAGS) engine.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@
|
$(CC) engine.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@
|
||||||
|
|
||||||
engine.o: engine.c trackball.h
|
engine.o: engine.c trackball.h
|
||||||
$(CC) -c -I$(INCDIR) $(CFLAGS) engine.c
|
$(CC) -c -I$(INCDIR) $(CFLAGS) engine.c
|
||||||
|
|
||||||
|
|
||||||
fslight.c: extfuncs.h
|
fslight: fslight.o
|
||||||
|
$(CC) fslight.o $(APP_LIB_DEPS) -o $@
|
||||||
|
|
||||||
|
fslight.o: fslight.c extfuncs.h
|
||||||
|
$(CC) -c -I$(INCDIR) $(CFLAGS) fslight.c
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
@@ -22,9 +22,11 @@ LIBS = GLUT32.LIB OPENGL32.LIB
|
|||||||
|
|
||||||
all: OPENGL32.DLL GLU32.DLL GLUT32.DLL \
|
all: OPENGL32.DLL GLU32.DLL GLUT32.DLL \
|
||||||
readtex.h readtex.c showbuffer.h showbuffer.c \
|
readtex.h readtex.c showbuffer.h showbuffer.c \
|
||||||
|
extfuncs.h trackball.h trackball.c \
|
||||||
arbfplight.exe arbfslight.exe arbocclude.exe bounce.exe \
|
arbfplight.exe arbfslight.exe arbocclude.exe bounce.exe \
|
||||||
clearspd.exe cubemap.exe drawpix.exe fire.exe fogcoord.exe \
|
clearspd.exe cubemap.exe drawpix.exe engine.exe \
|
||||||
fplight.exe gamma.exe gearbox.exe \
|
fire.exe fogcoord.exe \
|
||||||
|
fplight.exe fslight.exe gamma.exe gearbox.exe \
|
||||||
gears.exe geartrain.exe gloss.exe \
|
gears.exe geartrain.exe gloss.exe \
|
||||||
glinfo.exe glslnoise.exe \
|
glinfo.exe glslnoise.exe \
|
||||||
gltestperf.exe glutfx.exe ipers.exe isosurf.exe lodbias.exe \
|
gltestperf.exe glutfx.exe ipers.exe isosurf.exe lodbias.exe \
|
||||||
@@ -42,14 +44,16 @@ bounce.exe: bounce.obj
|
|||||||
clearspd.exe: clearspd.obj
|
clearspd.exe: clearspd.obj
|
||||||
cubemap.exe: cubemap.obj readtex.obj
|
cubemap.exe: cubemap.obj readtex.obj
|
||||||
drawpix.exe: drawpix.obj readtex.obj
|
drawpix.exe: drawpix.obj readtex.obj
|
||||||
|
engine.exe: engine.obj readtex.obj trackball.obj
|
||||||
fire.exe: fire.obj readtex.obj
|
fire.exe: fire.obj readtex.obj
|
||||||
fogcoord.exe: fogcoord.obj readtex.obj
|
fogcoord.exe: fogcoord.obj readtex.obj
|
||||||
fplight.exe: fplight.obj
|
fplight.exe: fplight.obj
|
||||||
|
fslight.exe: fslight.obj
|
||||||
gamma.exe: gamma.obj
|
gamma.exe: gamma.obj
|
||||||
gearbox.exe: gearbox.obj
|
gearbox.exe: gearbox.obj
|
||||||
gears.exe: gears.obj
|
gears.exe: gears.obj
|
||||||
geartrain.exe: geartrain.obj
|
geartrain.exe: geartrain.obj
|
||||||
gloss.exe: gloss.obj readtex.obj
|
gloss.exe: gloss.obj readtex.obj trackball.obj
|
||||||
glinfo.exe: glinfo.obj
|
glinfo.exe: glinfo.obj
|
||||||
glslnoise.exe: glslnoise.obj
|
glslnoise.exe: glslnoise.obj
|
||||||
gltestperf.exe: gltestperf.obj
|
gltestperf.exe: gltestperf.obj
|
||||||
@@ -105,14 +109,23 @@ showbuffer.c: $(TOP)\progs\util\showbuffer.c
|
|||||||
showbuffer.h: $(TOP)\progs\util\showbuffer.h
|
showbuffer.h: $(TOP)\progs\util\showbuffer.h
|
||||||
copy $** .
|
copy $** .
|
||||||
|
|
||||||
|
trackball.c: $(TOP)\progs\util\trackball.c
|
||||||
|
copy $** .
|
||||||
|
|
||||||
|
trackball.h: $(TOP)\progs\util\trackball.h
|
||||||
|
copy $** .
|
||||||
|
|
||||||
|
extfuncs.h: $(TOP)\progs\util\extfuncs.h
|
||||||
|
copy $** .
|
||||||
|
|
||||||
.obj.exe:
|
.obj.exe:
|
||||||
$(link) $(ldebug) -out:$@ $** /LIBPATH:$(LIBDIR) $(LIBS)
|
$(link) $(ldebug) -out:$@ $** /LIBPATH:$(LIBDIR) $(LIBS)
|
||||||
|
|
||||||
.c.obj:
|
.c.obj:
|
||||||
$(cc) $(cdebug) $(cflags) $(cvars) /I$(INCDIR) $*.c
|
$(cc) $(cdebug) $(cflags) $(cvars) -D_USE_MATH_DEFINES /I$(INCDIR) $*.c
|
||||||
|
|
||||||
clean::
|
clean::
|
||||||
del *.obj *.exe readtex.* showbuffer.*
|
del *.obj *.exe readtex.* showbuffer.* trackball.*
|
||||||
|
|
||||||
clobber::
|
clobber::
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ static GLuint VertProg;
|
|||||||
static GLboolean Anim = GL_TRUE;
|
static GLboolean Anim = GL_TRUE;
|
||||||
static GLboolean Wire = GL_FALSE;
|
static GLboolean Wire = GL_FALSE;
|
||||||
static GLboolean PixelLight = GL_TRUE;
|
static GLboolean PixelLight = GL_TRUE;
|
||||||
|
static GLint Win;
|
||||||
|
|
||||||
static GLint T0 = 0;
|
static GLint T0 = 0;
|
||||||
static GLint Frames = 0;
|
static GLint Frames = 0;
|
||||||
@@ -148,6 +149,7 @@ static void Key( unsigned char key, int x, int y )
|
|||||||
case 27:
|
case 27:
|
||||||
glDeleteProgramsARB_func(1, &VertProg);
|
glDeleteProgramsARB_func(1, &VertProg);
|
||||||
glDeleteProgramsARB_func(1, &FragProg);
|
glDeleteProgramsARB_func(1, &FragProg);
|
||||||
|
glutDestroyWindow(Win);
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -382,7 +384,7 @@ int main( int argc, char *argv[] )
|
|||||||
glutInitWindowPosition( 0, 0 );
|
glutInitWindowPosition( 0, 0 );
|
||||||
glutInitWindowSize( 200, 200 );
|
glutInitWindowSize( 200, 200 );
|
||||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
|
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
|
||||||
glutCreateWindow(argv[0]);
|
Win = glutCreateWindow(argv[0]);
|
||||||
glutReshapeFunc( Reshape );
|
glutReshapeFunc( Reshape );
|
||||||
glutKeyboardFunc( Key );
|
glutKeyboardFunc( Key );
|
||||||
glutSpecialFunc( SpecialKey );
|
glutSpecialFunc( SpecialKey );
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ static PFNGLUNIFORM3FVARBPROC glUniform4fvARB = NULL;
|
|||||||
|
|
||||||
static void normalize (GLfloat *dst, const GLfloat *src)
|
static void normalize (GLfloat *dst, const GLfloat *src)
|
||||||
{
|
{
|
||||||
GLfloat len = sqrtf (src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
|
GLfloat len = sqrt (src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
|
||||||
dst[0] = src[0] / len;
|
dst[0] = src[0] / len;
|
||||||
dst[1] = src[1] / len;
|
dst[1] = src[1] / len;
|
||||||
dst[2] = src[2] / len;
|
dst[2] = src[2] / len;
|
||||||
|
|||||||
@@ -7,151 +7,136 @@
|
|||||||
* Daniel Borca
|
* Daniel Borca
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GL_GLEXT_PROTOTYPES
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
|
|
||||||
#include "readtex.h"
|
#define DEPTH 5.0f
|
||||||
|
|
||||||
#define TEXTURE_FILE "../images/bw.rgb"
|
static PFNGLFOGCOORDFEXTPROC glFogCoordf_ext;
|
||||||
|
static PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext;
|
||||||
|
|
||||||
#define ARRAYS 0 /* use glDrawElements */
|
|
||||||
|
|
||||||
#define VERBOSE 1 /* tell me what happens */
|
|
||||||
|
|
||||||
#define DEPTH 15.0f
|
|
||||||
|
|
||||||
#if !defined(GLAPIENTRYP)
|
|
||||||
# define GLAPIENTRYP *
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP GLFOGCOORDFEXTPROC) (GLfloat f);
|
|
||||||
typedef void (GLAPIENTRYP GLFOGCOORDPOINTEREXTPROC) (GLenum, GLsizei, const GLvoid *);
|
|
||||||
|
|
||||||
static GLFOGCOORDFEXTPROC glFogCoordf_ext;
|
|
||||||
#if ARRAYS
|
|
||||||
static GLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext;
|
|
||||||
#endif
|
|
||||||
static GLboolean have_fog_coord;
|
static GLboolean have_fog_coord;
|
||||||
|
|
||||||
static GLfloat camz;
|
static GLfloat camz;
|
||||||
static GLuint texture[1];
|
|
||||||
|
|
||||||
static GLint fogMode;
|
static GLint fogMode;
|
||||||
static GLboolean fogCoord;
|
static GLboolean fogCoord;
|
||||||
static GLfloat fogDensity = 0.75;
|
static GLfloat fogDensity = 0.75;
|
||||||
static GLfloat fogStart = 1.0, fogEnd = 40.0;
|
static GLfloat fogStart = 1.0, fogEnd = DEPTH;
|
||||||
static GLfloat fogColor[4] = {0.6f, 0.3f, 0.0f, 1.0f};
|
static GLfloat fogColor[4] = {0.6f, 0.3f, 0.0f, 1.0f};
|
||||||
|
static const char *ModeStr = NULL;
|
||||||
|
static GLboolean Arrays = GL_FALSE;
|
||||||
|
static GLboolean Texture = GL_TRUE;
|
||||||
|
|
||||||
|
|
||||||
static void APIENTRY glFogCoordf_nop (GLfloat f)
|
static void
|
||||||
|
Reset(void)
|
||||||
|
{
|
||||||
|
fogMode = 1;
|
||||||
|
fogCoord = 1;
|
||||||
|
fogDensity = 0.75;
|
||||||
|
fogStart = 1.0;
|
||||||
|
fogEnd = DEPTH;
|
||||||
|
Arrays = GL_FALSE;
|
||||||
|
Texture = GL_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void APIENTRY
|
||||||
|
glFogCoordf_nop (GLfloat f)
|
||||||
{
|
{
|
||||||
(void)f;
|
(void)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int BuildTexture (const char *filename, GLuint texid[])
|
static void
|
||||||
|
PrintString(const char *s)
|
||||||
{
|
{
|
||||||
GLubyte *tex_data;
|
while (*s) {
|
||||||
GLenum tex_format;
|
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
|
||||||
GLint tex_width, tex_height;
|
s++;
|
||||||
|
|
||||||
tex_data = LoadRGBImage(filename, &tex_width, &tex_height, &tex_format);
|
|
||||||
if (tex_data == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
GLint tex_max;
|
|
||||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &tex_max);
|
|
||||||
if ((tex_width > tex_max) || (tex_height > tex_max)) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
glGenTextures(1, texid);
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, texid[0]);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
|
||||||
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, tex_format, tex_width, tex_height, 0,
|
|
||||||
tex_format, GL_UNSIGNED_BYTE, tex_data);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int SetFogMode (GLint fogMode)
|
static void
|
||||||
|
PrintInfo(void)
|
||||||
|
{
|
||||||
|
char s[100];
|
||||||
|
|
||||||
|
glDisable(GL_FOG);
|
||||||
|
glColor3f(0, 1, 1);
|
||||||
|
|
||||||
|
sprintf(s, "Mode(m): %s Start(s/S): %g End(e/E): %g Density(d/D): %g",
|
||||||
|
ModeStr, fogStart, fogEnd, fogDensity);
|
||||||
|
glWindowPos2iARB(5, 20);
|
||||||
|
PrintString(s);
|
||||||
|
|
||||||
|
sprintf(s, "Arrays(a): %s glFogCoord(c): %s EyeZ(z/z): %g",
|
||||||
|
(Arrays ? "Yes" : "No"),
|
||||||
|
(fogCoord ? "Yes" : "No"),
|
||||||
|
camz);
|
||||||
|
glWindowPos2iARB(5, 5);
|
||||||
|
PrintString(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
SetFogMode(GLint fogMode)
|
||||||
{
|
{
|
||||||
fogMode &= 3;
|
fogMode &= 3;
|
||||||
switch (fogMode) {
|
switch (fogMode) {
|
||||||
case 0:
|
case 0:
|
||||||
|
ModeStr = "Off";
|
||||||
glDisable(GL_FOG);
|
glDisable(GL_FOG);
|
||||||
#if VERBOSE
|
|
||||||
printf("fog(disable)\n");
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
ModeStr = "GL_LINEAR";
|
||||||
glEnable(GL_FOG);
|
glEnable(GL_FOG);
|
||||||
glFogi(GL_FOG_MODE, GL_LINEAR);
|
glFogi(GL_FOG_MODE, GL_LINEAR);
|
||||||
glFogf(GL_FOG_START, fogStart);
|
glFogf(GL_FOG_START, fogStart);
|
||||||
glFogf(GL_FOG_END, fogEnd);
|
glFogf(GL_FOG_END, fogEnd);
|
||||||
#if VERBOSE
|
|
||||||
printf("fog(GL_LINEAR, %.2f, %.2f)\n", fogStart, fogEnd);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
ModeStr = "GL_EXP";
|
||||||
glEnable(GL_FOG);
|
glEnable(GL_FOG);
|
||||||
glFogi(GL_FOG_MODE, GL_EXP);
|
glFogi(GL_FOG_MODE, GL_EXP);
|
||||||
glFogf(GL_FOG_DENSITY, fogDensity);
|
glFogf(GL_FOG_DENSITY, fogDensity);
|
||||||
#if VERBOSE
|
|
||||||
printf("fog(GL_EXP, %.2f)\n", fogDensity);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
ModeStr = "GL_EXP2";
|
||||||
glEnable(GL_FOG);
|
glEnable(GL_FOG);
|
||||||
glFogi(GL_FOG_MODE, GL_EXP2);
|
glFogi(GL_FOG_MODE, GL_EXP2);
|
||||||
glFogf(GL_FOG_DENSITY, fogDensity);
|
glFogf(GL_FOG_DENSITY, fogDensity);
|
||||||
#if VERBOSE
|
|
||||||
printf("fog(GL_EXP2, %.2f)\n", fogDensity);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return fogMode;
|
return fogMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static GLboolean SetFogCoord (GLboolean fogCoord)
|
static GLboolean
|
||||||
|
SetFogCoord(GLboolean fogCoord)
|
||||||
{
|
{
|
||||||
glFogCoordf_ext = glFogCoordf_nop;
|
glFogCoordf_ext = glFogCoordf_nop;
|
||||||
|
|
||||||
if (!have_fog_coord) {
|
if (!have_fog_coord) {
|
||||||
#if VERBOSE
|
|
||||||
printf("fog(GL_FRAGMENT_DEPTH_EXT)%s\n", fogCoord ? " EXT_fog_coord not available!" : "");
|
|
||||||
#endif
|
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fogCoord) {
|
if (fogCoord) {
|
||||||
glFogCoordf_ext = (GLFOGCOORDFEXTPROC)glutGetProcAddress("glFogCoordfEXT");
|
glFogCoordf_ext = (PFNGLFOGCOORDFEXTPROC)glutGetProcAddress("glFogCoordfEXT");
|
||||||
glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
|
glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
|
||||||
#if VERBOSE
|
}
|
||||||
printf("fog(GL_FOG_COORDINATE_EXT)\n");
|
else {
|
||||||
#endif
|
|
||||||
} else {
|
|
||||||
glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT);
|
glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT);
|
||||||
#if VERBOSE
|
|
||||||
printf("fog(GL_FRAGMENT_DEPTH_EXT)\n");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return fogCoord;
|
return fogCoord;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if ARRAYS
|
|
||||||
/* could reuse vertices */
|
/* could reuse vertices */
|
||||||
static GLuint vertex_index[] = {
|
static GLuint vertex_index[] = {
|
||||||
/* Back */
|
/* Back */
|
||||||
@@ -172,19 +157,19 @@ static GLuint vertex_index[] = {
|
|||||||
|
|
||||||
static GLfloat vertex_pointer[][3] = {
|
static GLfloat vertex_pointer[][3] = {
|
||||||
/* Back */
|
/* Back */
|
||||||
{-2.5f,-2.5f,-DEPTH}, { 2.5f,-2.5f,-DEPTH}, { 2.5f, 2.5f,-DEPTH}, {-2.5f, 2.5f,-DEPTH},
|
{-1.0f,-1.0f,-DEPTH}, { 1.0f,-1.0f,-DEPTH}, { 1.0f, 1.0f,-DEPTH}, {-1.0f, 1.0f,-DEPTH},
|
||||||
|
|
||||||
/* Floor */
|
/* Floor */
|
||||||
{-2.5f,-2.5f,-DEPTH}, { 2.5f,-2.5f,-DEPTH}, { 2.5f,-2.5f, DEPTH}, {-2.5f,-2.5f, DEPTH},
|
{-1.0f,-1.0f,-DEPTH}, { 1.0f,-1.0f,-DEPTH}, { 1.0f,-1.0f, 0.0}, {-1.0f,-1.0f, 0.0},
|
||||||
|
|
||||||
/* Roof */
|
/* Roof */
|
||||||
{-2.5f, 2.5f,-DEPTH}, { 2.5f, 2.5f,-DEPTH}, { 2.5f, 2.5f, DEPTH}, {-2.5f, 2.5f, DEPTH},
|
{-1.0f, 1.0f,-DEPTH}, { 1.0f, 1.0f,-DEPTH}, { 1.0f, 1.0f, 0.0}, {-1.0f, 1.0f, 0.0},
|
||||||
|
|
||||||
/* Right */
|
/* Right */
|
||||||
{ 2.5f,-2.5f, DEPTH}, { 2.5f, 2.5f, DEPTH}, { 2.5f, 2.5f,-DEPTH}, { 2.5f,-2.5f,-DEPTH},
|
{ 1.0f,-1.0f, 0.0}, { 1.0f, 1.0f, 0.0}, { 1.0f, 1.0f,-DEPTH}, { 1.0f,-1.0f,-DEPTH},
|
||||||
|
|
||||||
/* Left */
|
/* Left */
|
||||||
{-2.5f,-2.5f, DEPTH}, {-2.5f, 2.5f, DEPTH}, {-2.5f, 2.5f,-DEPTH}, {-2.5f,-2.5f,-DEPTH}
|
{-1.0f,-1.0f, 0.0}, {-1.0f, 1.0f, 0.0}, {-1.0f, 1.0f,-DEPTH}, {-1.0f,-1.0f,-DEPTH}
|
||||||
};
|
};
|
||||||
|
|
||||||
static GLfloat texcoord_pointer[][2] = {
|
static GLfloat texcoord_pointer[][2] = {
|
||||||
@@ -192,118 +177,139 @@ static GLfloat texcoord_pointer[][2] = {
|
|||||||
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f},
|
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f},
|
||||||
|
|
||||||
/* Floor */
|
/* Floor */
|
||||||
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f},
|
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, DEPTH}, {0.0f, DEPTH},
|
||||||
|
|
||||||
/* Roof */
|
/* Roof */
|
||||||
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f},
|
{1.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, DEPTH}, {1.0f, DEPTH},
|
||||||
|
|
||||||
/* Right */
|
/* Right */
|
||||||
{0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, 0.0f},
|
{0.0f, 1.0f}, {0.0f, 0.0f}, {DEPTH, 0.0f}, {DEPTH, 1.0f},
|
||||||
|
|
||||||
/* Left */
|
/* Left */
|
||||||
{0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, 0.0f}
|
{0.0f, 0.0f}, {0.0f, 1.0f}, {DEPTH, 1.0f}, {DEPTH, 0.0f}
|
||||||
};
|
};
|
||||||
|
|
||||||
static GLfloat fogcoord_pointer[][1] = {
|
static GLfloat fogcoord_pointer[] = {
|
||||||
/* Back */
|
/* Back */
|
||||||
{1.0f}, {1.0f}, {1.0f}, {1.0f},
|
DEPTH, DEPTH, DEPTH, DEPTH,
|
||||||
|
|
||||||
/* Floor */
|
/* Floor */
|
||||||
{1.0f}, {1.0f}, {0.0f}, {0.0f},
|
DEPTH, DEPTH, 0.0, 0.0,
|
||||||
|
|
||||||
/* Roof */
|
/* Roof */
|
||||||
{1.0f}, {1.0f}, {0.0f}, {0.0f},
|
DEPTH, DEPTH, 0.0, 0.0,
|
||||||
|
|
||||||
/* Right */
|
/* Right */
|
||||||
{0.0f}, {0.0f}, {1.0f}, {1.0f},
|
0.0, 0.0, DEPTH, DEPTH,
|
||||||
|
|
||||||
/* Left */
|
/* Left */
|
||||||
{0.0f}, {0.0f}, {1.0f}, {1.0f}
|
0.0, 0.0, DEPTH, DEPTH
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static void Display( void )
|
static void
|
||||||
|
Display( void )
|
||||||
{
|
{
|
||||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glLoadIdentity ();
|
glLoadIdentity ();
|
||||||
|
|
||||||
glTranslatef(0.0f, 0.0f, camz);
|
glTranslatef(0.0f, 0.0f, -camz);
|
||||||
|
|
||||||
#if ARRAYS
|
SetFogMode(fogMode);
|
||||||
glDrawElements(GL_QUADS, sizeof(vertex_index) / sizeof(vertex_index[0]), GL_UNSIGNED_INT, vertex_index);
|
|
||||||
#else
|
|
||||||
/* Back */
|
|
||||||
glBegin(GL_QUADS);
|
|
||||||
glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f,-2.5f,-DEPTH);
|
|
||||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f,-2.5f,-DEPTH);
|
|
||||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f, 2.5f,-DEPTH);
|
|
||||||
glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f, 2.5f,-DEPTH);
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
/* Floor */
|
glColor3f(1, 1, 1);
|
||||||
glBegin(GL_QUADS);
|
|
||||||
glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f,-2.5f,-DEPTH);
|
|
||||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f,-2.5f,-DEPTH);
|
|
||||||
glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f,-2.5f, DEPTH);
|
|
||||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f,-2.5f, DEPTH);
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
/* Roof */
|
if (Texture)
|
||||||
glBegin(GL_QUADS);
|
glEnable(GL_TEXTURE_2D);
|
||||||
glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f, 2.5f,-DEPTH);
|
|
||||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f, 2.5f,-DEPTH);
|
|
||||||
glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f, 2.5f, DEPTH);
|
|
||||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f, 2.5f, DEPTH);
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
/* Right */
|
if (Arrays) {
|
||||||
glBegin(GL_QUADS);
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f( 2.5f,-2.5f, DEPTH);
|
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f( 2.5f, 2.5f, DEPTH);
|
glDrawElements(GL_QUADS, sizeof(vertex_index) / sizeof(vertex_index[0]),
|
||||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f, 2.5f,-DEPTH);
|
GL_UNSIGNED_INT, vertex_index);
|
||||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f,-2.5f,-DEPTH);
|
glDisableClientState(GL_VERTEX_ARRAY);
|
||||||
glEnd();
|
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* Back */
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,-DEPTH);
|
||||||
|
glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f,-DEPTH);
|
||||||
|
glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f,-DEPTH);
|
||||||
|
glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f,-DEPTH);
|
||||||
|
glEnd();
|
||||||
|
|
||||||
/* Left */
|
/* Floor */
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f,-2.5f, DEPTH);
|
glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,-DEPTH);
|
||||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f, 2.5f, DEPTH);
|
glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f,-DEPTH);
|
||||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f(-2.5f, 2.5f,-DEPTH);
|
glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, DEPTH); glVertex3f( 1.0f,-1.0f,0.0);
|
||||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f(-2.5f,-2.5f,-DEPTH);
|
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, DEPTH); glVertex3f(-1.0f,-1.0f,0.0);
|
||||||
glEnd();
|
glEnd();
|
||||||
#endif
|
|
||||||
|
/* Roof */
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, 1.0f,-DEPTH);
|
||||||
|
glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, 1.0f,-DEPTH);
|
||||||
|
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, DEPTH); glVertex3f( 1.0f, 1.0f,0.0);
|
||||||
|
glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, DEPTH); glVertex3f(-1.0f, 1.0f,0.0);
|
||||||
|
glEnd();
|
||||||
|
|
||||||
|
/* Right */
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f,-1.0f,0.0);
|
||||||
|
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, 1.0f,0.0);
|
||||||
|
glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 0.0f); glVertex3f( 1.0f, 1.0f,-DEPTH);
|
||||||
|
glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 1.0f); glVertex3f( 1.0f,-1.0f,-DEPTH);
|
||||||
|
glEnd();
|
||||||
|
|
||||||
|
/* Left */
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,0.0);
|
||||||
|
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f,0.0);
|
||||||
|
glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 1.0f); glVertex3f(-1.0f, 1.0f,-DEPTH);
|
||||||
|
glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 0.0f); glVertex3f(-1.0f,-1.0f,-DEPTH);
|
||||||
|
glEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
|
PrintInfo();
|
||||||
|
|
||||||
glutSwapBuffers();
|
glutSwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void Reshape( int width, int height )
|
static void
|
||||||
|
Reshape( int width, int height )
|
||||||
{
|
{
|
||||||
glViewport(0, 0, width, height);
|
glViewport(0, 0, width, height);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
gluPerspective(45.0f, (GLfloat)(width)/(GLfloat)(height), 0.1f, 100.0f);
|
glFrustum(-1, 1, -1, 1, 1.0, 100);
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void Key( unsigned char key, int x, int y )
|
static void
|
||||||
|
Key( unsigned char key, int x, int y )
|
||||||
{
|
{
|
||||||
(void) x;
|
(void) x;
|
||||||
(void) y;
|
(void) y;
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case 'a':
|
||||||
|
Arrays = !Arrays;
|
||||||
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
|
case 'm':
|
||||||
fogMode = SetFogMode(fogMode + 1);
|
fogMode = SetFogMode(fogMode + 1);
|
||||||
break;
|
break;
|
||||||
case '+':
|
case 'D':
|
||||||
if (fogDensity < 1.0) {
|
fogDensity += 0.05;
|
||||||
fogDensity += 0.05;
|
|
||||||
}
|
|
||||||
SetFogMode(fogMode);
|
SetFogMode(fogMode);
|
||||||
break;
|
break;
|
||||||
case '-':
|
case 'd':
|
||||||
if (fogDensity > 0.0) {
|
if (fogDensity > 0.0) {
|
||||||
fogDensity -= 0.05;
|
fogDensity -= 0.05;
|
||||||
}
|
}
|
||||||
@@ -311,31 +317,43 @@ static void Key( unsigned char key, int x, int y )
|
|||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
if (fogStart > 0.0) {
|
if (fogStart > 0.0) {
|
||||||
fogStart -= 1.0;
|
fogStart -= 0.25;
|
||||||
}
|
}
|
||||||
SetFogMode(fogMode);
|
SetFogMode(fogMode);
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
if (fogStart < fogEnd) {
|
if (fogStart < 100.0) {
|
||||||
fogStart += 1.0;
|
fogStart += 0.25;
|
||||||
}
|
}
|
||||||
SetFogMode(fogMode);
|
SetFogMode(fogMode);
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
if (fogEnd > fogStart) {
|
if (fogEnd > 0.0) {
|
||||||
fogEnd -= 1.0;
|
fogEnd -= 0.25;
|
||||||
}
|
}
|
||||||
SetFogMode(fogMode);
|
SetFogMode(fogMode);
|
||||||
break;
|
break;
|
||||||
case 'E':
|
case 'E':
|
||||||
if (fogEnd < 100.0) {
|
if (fogEnd < 100.0) {
|
||||||
fogEnd += 1.0;
|
fogEnd += 0.25;
|
||||||
}
|
}
|
||||||
SetFogMode(fogMode);
|
SetFogMode(fogMode);
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
fogCoord = SetFogCoord(fogCoord ^ GL_TRUE);
|
fogCoord = SetFogCoord(fogCoord ^ GL_TRUE);
|
||||||
break;
|
break;
|
||||||
|
case 't':
|
||||||
|
Texture = !Texture;
|
||||||
|
break;
|
||||||
|
case 'z':
|
||||||
|
camz -= 0.1;
|
||||||
|
break;
|
||||||
|
case 'Z':
|
||||||
|
camz += 0.1;
|
||||||
|
break;
|
||||||
|
case 'r':
|
||||||
|
Reset();
|
||||||
|
break;
|
||||||
case 27:
|
case 27:
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
@@ -344,37 +362,28 @@ static void Key( unsigned char key, int x, int y )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void SpecialKey( int key, int x, int y )
|
static void
|
||||||
|
Init(void)
|
||||||
{
|
{
|
||||||
(void) x;
|
static const GLubyte teximage[2][2][4] = {
|
||||||
(void) y;
|
{ { 255, 255, 255, 255}, { 128, 128, 128, 255} },
|
||||||
switch (key) {
|
{ { 128, 128, 128, 255}, { 255, 255, 255, 255} }
|
||||||
case GLUT_KEY_UP:
|
};
|
||||||
if (camz < (DEPTH - 1.0)) {
|
|
||||||
camz += 1.0f;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case GLUT_KEY_DOWN:
|
|
||||||
if (camz > -19.0) {
|
|
||||||
camz -= 1.0f;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
glutPostRedisplay();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||||
|
|
||||||
static void Init( void )
|
|
||||||
{
|
|
||||||
have_fog_coord = glutExtensionSupported("GL_EXT_fog_coord");
|
have_fog_coord = glutExtensionSupported("GL_EXT_fog_coord");
|
||||||
|
if (!have_fog_coord) {
|
||||||
if (BuildTexture(TEXTURE_FILE, texture) == -1) {
|
printf("GL_EXT_fog_coord not supported!\n");
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0,
|
||||||
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
|
GL_RGBA, GL_UNSIGNED_BYTE, teximage);
|
||||||
glClearDepth(1.0f);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
|
glClearColor(0.1f, 0.1f, 0.1f, 0.0f);
|
||||||
|
|
||||||
glDepthFunc(GL_LEQUAL);
|
glDepthFunc(GL_LEQUAL);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
glShadeModel(GL_SMOOTH);
|
glShadeModel(GL_SMOOTH);
|
||||||
@@ -383,11 +392,8 @@ static void Init( void )
|
|||||||
glFogfv(GL_FOG_COLOR, fogColor);
|
glFogfv(GL_FOG_COLOR, fogColor);
|
||||||
glHint(GL_FOG_HINT, GL_NICEST);
|
glHint(GL_FOG_HINT, GL_NICEST);
|
||||||
fogCoord = SetFogCoord(GL_TRUE); /* try to enable fog_coord */
|
fogCoord = SetFogCoord(GL_TRUE); /* try to enable fog_coord */
|
||||||
fogMode = SetFogMode(2); /* GL_EXP */
|
fogMode = SetFogMode(1);
|
||||||
|
|
||||||
camz = -19.0f;
|
|
||||||
|
|
||||||
#if ARRAYS
|
|
||||||
glEnableClientState(GL_VERTEX_ARRAY);
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
glVertexPointer(3, GL_FLOAT, 0, vertex_pointer);
|
glVertexPointer(3, GL_FLOAT, 0, vertex_pointer);
|
||||||
|
|
||||||
@@ -395,24 +401,24 @@ static void Init( void )
|
|||||||
glTexCoordPointer(2, GL_FLOAT, 0, texcoord_pointer);
|
glTexCoordPointer(2, GL_FLOAT, 0, texcoord_pointer);
|
||||||
|
|
||||||
if (have_fog_coord) {
|
if (have_fog_coord) {
|
||||||
glFogCoordPointer_ext = (GLFOGCOORDPOINTEREXTPROC)glutGetProcAddress("glFogCoordPointerEXT");
|
glFogCoordPointer_ext = (PFNGLFOGCOORDPOINTEREXTPROC)glutGetProcAddress("glFogCoordPointerEXT");
|
||||||
glEnableClientState(GL_FOG_COORDINATE_ARRAY_EXT);
|
glEnableClientState(GL_FOG_COORDINATE_ARRAY_EXT);
|
||||||
glFogCoordPointer_ext(GL_FLOAT, 0, fogcoord_pointer);
|
glFogCoordPointer_ext(GL_FLOAT, 0, fogcoord_pointer);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main( int argc, char *argv[] )
|
int
|
||||||
|
main( int argc, char *argv[] )
|
||||||
{
|
{
|
||||||
glutInit( &argc, argv );
|
glutInit( &argc, argv );
|
||||||
glutInitWindowPosition( 0, 0 );
|
glutInitWindowSize( 600, 600 );
|
||||||
glutInitWindowSize( 640, 480 );
|
|
||||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
|
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
|
||||||
glutCreateWindow(argv[0]);
|
glutCreateWindow(argv[0]);
|
||||||
glutReshapeFunc( Reshape );
|
glutReshapeFunc( Reshape );
|
||||||
glutKeyboardFunc( Key );
|
glutKeyboardFunc( Key );
|
||||||
glutSpecialFunc( SpecialKey );
|
|
||||||
glutDisplayFunc( Display );
|
glutDisplayFunc( Display );
|
||||||
Init();
|
Init();
|
||||||
glutMainLoop();
|
glutMainLoop();
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ static GLuint VertProg;
|
|||||||
static GLboolean Anim = GL_TRUE;
|
static GLboolean Anim = GL_TRUE;
|
||||||
static GLboolean Wire = GL_FALSE;
|
static GLboolean Wire = GL_FALSE;
|
||||||
static GLboolean PixelLight = GL_TRUE;
|
static GLboolean PixelLight = GL_TRUE;
|
||||||
|
static GLint Win;
|
||||||
static GLfloat Xrot = 0, Yrot = 0;
|
static GLfloat Xrot = 0, Yrot = 0;
|
||||||
|
|
||||||
|
|
||||||
@@ -136,8 +136,8 @@ static void Key( unsigned char key, int x, int y )
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 27:
|
case 27:
|
||||||
|
glutDestroyWindow(Win);
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
glutPostRedisplay();
|
glutPostRedisplay();
|
||||||
}
|
}
|
||||||
@@ -272,7 +272,7 @@ int main( int argc, char *argv[] )
|
|||||||
glutInitWindowPosition( 0, 0 );
|
glutInitWindowPosition( 0, 0 );
|
||||||
glutInitWindowSize( 200, 200 );
|
glutInitWindowSize( 200, 200 );
|
||||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
|
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
|
||||||
glutCreateWindow(argv[0]);
|
Win = glutCreateWindow(argv[0]);
|
||||||
glutReshapeFunc( Reshape );
|
glutReshapeFunc( Reshape );
|
||||||
glutKeyboardFunc( Key );
|
glutKeyboardFunc( Key );
|
||||||
glutSpecialFunc( SpecialKey );
|
glutSpecialFunc( SpecialKey );
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
#include "extfuncs.h"
|
#include "extfuncs.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define TEXTURE 0
|
||||||
|
|
||||||
static GLint CoordAttrib = 0;
|
static GLint CoordAttrib = 0;
|
||||||
|
|
||||||
static char *FragProgFile = NULL;
|
static char *FragProgFile = NULL;
|
||||||
@@ -43,7 +45,7 @@ static GLint uTexture;
|
|||||||
|
|
||||||
static GLuint SphereList, RectList, CurList;
|
static GLuint SphereList, RectList, CurList;
|
||||||
static GLint win = 0;
|
static GLint win = 0;
|
||||||
static GLboolean anim = GL_FALSE;
|
static GLboolean anim = GL_TRUE;
|
||||||
static GLboolean wire = GL_FALSE;
|
static GLboolean wire = GL_FALSE;
|
||||||
static GLboolean pixelLight = GL_TRUE;
|
static GLboolean pixelLight = GL_TRUE;
|
||||||
|
|
||||||
@@ -56,7 +58,7 @@ static GLfloat xRot = 90.0f, yRot = 0.0f;
|
|||||||
static void
|
static void
|
||||||
normalize(GLfloat *dst, const GLfloat *src)
|
normalize(GLfloat *dst, const GLfloat *src)
|
||||||
{
|
{
|
||||||
GLfloat len = sqrtf(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
|
GLfloat len = sqrt(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
|
||||||
dst[0] = src[0] / len;
|
dst[0] = src[0] / len;
|
||||||
dst[1] = src[1] / len;
|
dst[1] = src[1] / len;
|
||||||
dst[2] = src[2] / len;
|
dst[2] = src[2] / len;
|
||||||
@@ -281,11 +283,12 @@ TestFunctions(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if TEXTURE
|
||||||
static void
|
static void
|
||||||
MakeTexture(void)
|
MakeTexture(void)
|
||||||
{
|
{
|
||||||
#define SZ0 128
|
#define SZ0 64
|
||||||
#define SZ1 64
|
#define SZ1 32
|
||||||
GLubyte image0[SZ0][SZ0][SZ0][4];
|
GLubyte image0[SZ0][SZ0][SZ0][4];
|
||||||
GLubyte image1[SZ1][SZ1][SZ1][4];
|
GLubyte image1[SZ1][SZ1][SZ1][4];
|
||||||
GLuint i, j, k;
|
GLuint i, j, k;
|
||||||
@@ -348,6 +351,7 @@ MakeTexture(void)
|
|||||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -473,8 +477,8 @@ Init(void)
|
|||||||
|
|
||||||
version = (const char *) glGetString(GL_VERSION);
|
version = (const char *) glGetString(GL_VERSION);
|
||||||
if (version[0] != '2' || version[1] != '.') {
|
if (version[0] != '2' || version[1] != '.') {
|
||||||
printf("Warning: this program expects OpenGL 2.0\n");
|
printf("This program requires OpenGL 2.x, found %s\n", version);
|
||||||
/*exit(1);*/
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetExtensionFuncs();
|
GetExtensionFuncs();
|
||||||
@@ -540,7 +544,9 @@ Init(void)
|
|||||||
|
|
||||||
CurList = SphereList;
|
CurList = SphereList;
|
||||||
|
|
||||||
|
#if TEXTURE
|
||||||
MakeTexture();
|
MakeTexture();
|
||||||
|
#endif
|
||||||
|
|
||||||
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
||||||
printf("Press p to toggle between per-pixel and per-vertex lighting\n");
|
printf("Press p to toggle between per-pixel and per-vertex lighting\n");
|
||||||
@@ -573,6 +579,8 @@ Init(void)
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
TestFunctions();
|
TestFunctions();
|
||||||
|
#else
|
||||||
|
(void) TestFunctions;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,7 +605,7 @@ main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
glutInit(&argc, argv);
|
glutInit(&argc, argv);
|
||||||
glutInitWindowPosition( 0, 0);
|
glutInitWindowPosition( 0, 0);
|
||||||
glutInitWindowSize(100, 100);
|
glutInitWindowSize(200, 200);
|
||||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||||
win = glutCreateWindow(argv[0]);
|
win = glutCreateWindow(argv[0]);
|
||||||
glutReshapeFunc(Reshape);
|
glutReshapeFunc(Reshape);
|
||||||
|
|||||||
@@ -296,14 +296,27 @@ RenderShadowMap(void)
|
|||||||
0, 1, 0); /* up */
|
0, 1, 0); /* up */
|
||||||
|
|
||||||
if (UseFBO) {
|
if (UseFBO) {
|
||||||
|
GLenum fbo_status;
|
||||||
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, depthFormat,
|
glTexImage2D(GL_TEXTURE_2D, 0, depthFormat,
|
||||||
ShadowTexWidth, ShadowTexHeight, 0,
|
ShadowTexWidth, ShadowTexHeight, 0,
|
||||||
depthFormat, depthType, NULL);
|
depthFormat, depthType, NULL);
|
||||||
|
|
||||||
|
/* Set the filter mode so that the texture is texture-complete.
|
||||||
|
* Otherwise it will cause the framebuffer to fail the framebuffer
|
||||||
|
* completeness test.
|
||||||
|
*/
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, ShadowFBO);
|
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, ShadowFBO);
|
||||||
glDrawBuffer(GL_NONE);
|
glDrawBuffer(GL_NONE);
|
||||||
glReadBuffer(GL_NONE);
|
glReadBuffer(GL_NONE);
|
||||||
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)
|
|
||||||
== GL_FRAMEBUFFER_COMPLETE_EXT);
|
fbo_status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
|
||||||
|
if (fbo_status != GL_FRAMEBUFFER_COMPLETE_EXT) {
|
||||||
|
fprintf(stderr, "FBO not complete! status = 0x%04x\n", fbo_status);
|
||||||
|
assert(fbo_status == GL_FRAMEBUFFER_COMPLETE_EXT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!glIsEnabled(GL_TEXTURE_1D));
|
assert(!glIsEnabled(GL_TEXTURE_1D));
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
* Updated for GLU 1.3 tessellation by Gareth Hughes <gareth@valinux.com>
|
* Updated for GLU 1.3 tessellation by Gareth Hughes <gareth@valinux.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <GL/glut.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <GL/glut.h>
|
||||||
|
|
||||||
#define MAX_POINTS 256
|
#define MAX_POINTS 256
|
||||||
#define MAX_CONTOURS 32
|
#define MAX_CONTOURS 32
|
||||||
|
|||||||
@@ -1,221 +0,0 @@
|
|||||||
LOCAL_LIBRARIES = $(XLIB) $(TOP)\lib\Mesaaux.a $(TOP)\lib\Mesaglu.a $(TOP)\lib\MesaGL.a
|
|
||||||
|
|
||||||
INCLUDES = -I$(TOP)\include
|
|
||||||
|
|
||||||
SRCS = accanti.c \
|
|
||||||
accnot.c \
|
|
||||||
accpersp.c \
|
|
||||||
accum.c \
|
|
||||||
aim.c \
|
|
||||||
alpha.c \
|
|
||||||
alpha3D.c \
|
|
||||||
anti.c \
|
|
||||||
antiindex.c \
|
|
||||||
antipindex.c \
|
|
||||||
antipoint.c \
|
|
||||||
antipoly.c \
|
|
||||||
bezcurve.c \
|
|
||||||
bezmesh.c \
|
|
||||||
bezsurf.c \
|
|
||||||
checker.c \
|
|
||||||
checker2.c \
|
|
||||||
chess.c \
|
|
||||||
clip.c \
|
|
||||||
colormat.c \
|
|
||||||
cone.c \
|
|
||||||
cube.c \
|
|
||||||
curve.c \
|
|
||||||
depthcue.c \
|
|
||||||
disk.c \
|
|
||||||
dof.c \
|
|
||||||
dofnot.c \
|
|
||||||
double.c \
|
|
||||||
drawf.c \
|
|
||||||
feedback.c \
|
|
||||||
fog.c \
|
|
||||||
fogindex.c \
|
|
||||||
font.c \
|
|
||||||
light.c \
|
|
||||||
linelist.c \
|
|
||||||
lines.c \
|
|
||||||
list.c \
|
|
||||||
list2.c \
|
|
||||||
maplight.c \
|
|
||||||
material.c \
|
|
||||||
mipmap.c \
|
|
||||||
model.c \
|
|
||||||
movelight.c \
|
|
||||||
nurbs.c \
|
|
||||||
pickdepth.c \
|
|
||||||
pickline.c \
|
|
||||||
picksquare.c \
|
|
||||||
plane.c \
|
|
||||||
planet.c \
|
|
||||||
planetup.c \
|
|
||||||
polys.c \
|
|
||||||
robot.c \
|
|
||||||
sccolorlight.c \
|
|
||||||
scene.c \
|
|
||||||
scenebamb.c \
|
|
||||||
sceneflat.c \
|
|
||||||
select.c \
|
|
||||||
simple.c \
|
|
||||||
smooth.c \
|
|
||||||
sphere.c \
|
|
||||||
stencil.c \
|
|
||||||
stroke.c \
|
|
||||||
surface.c \
|
|
||||||
tea.c \
|
|
||||||
teaambient.c \
|
|
||||||
teapots.c \
|
|
||||||
texgen.c \
|
|
||||||
texturesurf.c \
|
|
||||||
trim.c \
|
|
||||||
xfont.c
|
|
||||||
|
|
||||||
PROGRAMS = ProgramTargetName(accanti) \
|
|
||||||
ProgramTargetName(accnot) \
|
|
||||||
ProgramTargetName(accpersp) \
|
|
||||||
ProgramTargetName(accum) \
|
|
||||||
ProgramTargetName(aim) \
|
|
||||||
ProgramTargetName(alpha) \
|
|
||||||
ProgramTargetName(alpha3D) \
|
|
||||||
ProgramTargetName(anti) \
|
|
||||||
ProgramTargetName(antiindex) \
|
|
||||||
ProgramTargetName(antipindex) \
|
|
||||||
ProgramTargetName(antipoint) \
|
|
||||||
ProgramTargetName(antipoly) \
|
|
||||||
ProgramTargetName(bezcurve) \
|
|
||||||
ProgramTargetName(bezmesh) \
|
|
||||||
ProgramTargetName(bezsurf) \
|
|
||||||
ProgramTargetName(checker) \
|
|
||||||
ProgramTargetName(checker2) \
|
|
||||||
ProgramTargetName(chess) \
|
|
||||||
ProgramTargetName(clip) \
|
|
||||||
ProgramTargetName(colormat) \
|
|
||||||
ProgramTargetName(cone) \
|
|
||||||
ProgramTargetName(cube) \
|
|
||||||
ProgramTargetName(curve) \
|
|
||||||
ProgramTargetName(depthcue) \
|
|
||||||
ProgramTargetName(disk) \
|
|
||||||
ProgramTargetName(dof) \
|
|
||||||
ProgramTargetName(dofnot) \
|
|
||||||
ProgramTargetName(double) \
|
|
||||||
ProgramTargetName(drawf) \
|
|
||||||
ProgramTargetName(feedback) \
|
|
||||||
ProgramTargetName(fog) \
|
|
||||||
ProgramTargetName(fogindex) \
|
|
||||||
ProgramTargetName(font) \
|
|
||||||
ProgramTargetName(light) \
|
|
||||||
ProgramTargetName(linelist) \
|
|
||||||
ProgramTargetName(lines) \
|
|
||||||
ProgramTargetName(list) \
|
|
||||||
ProgramTargetName(list2) \
|
|
||||||
ProgramTargetName(maplight) \
|
|
||||||
ProgramTargetName(material) \
|
|
||||||
ProgramTargetName(mipmap) \
|
|
||||||
ProgramTargetName(model) \
|
|
||||||
ProgramTargetName(movelight) \
|
|
||||||
ProgramTargetName(nurbs) \
|
|
||||||
ProgramTargetName(pickdepth) \
|
|
||||||
ProgramTargetName(pickline) \
|
|
||||||
ProgramTargetName(picksquare) \
|
|
||||||
ProgramTargetName(plane) \
|
|
||||||
ProgramTargetName(planet) \
|
|
||||||
ProgramTargetName(planetup) \
|
|
||||||
ProgramTargetName(polys) \
|
|
||||||
ProgramTargetName(robot) \
|
|
||||||
ProgramTargetName(sccolorlight) \
|
|
||||||
ProgramTargetName(scene) \
|
|
||||||
ProgramTargetName(scenebamb) \
|
|
||||||
ProgramTargetName(sceneflat) \
|
|
||||||
ProgramTargetName(select) \
|
|
||||||
ProgramTargetName(simple) \
|
|
||||||
ProgramTargetName(smooth) \
|
|
||||||
ProgramTargetName(sphere) \
|
|
||||||
ProgramTargetName(stencil) \
|
|
||||||
ProgramTargetName(stroke) \
|
|
||||||
ProgramTargetName(surface) \
|
|
||||||
ProgramTargetName(tea) \
|
|
||||||
ProgramTargetName(teaambient) \
|
|
||||||
ProgramTargetName(teapots) \
|
|
||||||
ProgramTargetName(texgen) \
|
|
||||||
ProgramTargetName(texturesurf) \
|
|
||||||
ProgramTargetName(trim) \
|
|
||||||
ProgramTargetName(xfont)
|
|
||||||
|
|
||||||
AllTarget($(PROGRAMS))
|
|
||||||
|
|
||||||
NormalProgramTarget(accanti,accanti.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(accnot,accnot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(accpersp,accpersp.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(accum,accum.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(aim,aim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(alpha,alpha.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(alpha3D,alpha3D.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(anti,anti.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(antiindex,antiindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(antipindex,antipindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(antipoint,antipoint.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(antipoly,antipoly.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(bezcurve,bezcurve.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(bezmesh,bezmesh.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(bezsurf,bezsurf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(checker,checker.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(checker2,checker2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(chess,chess.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(clip,clip.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(colormat,colormat.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(cone,cone.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(cube,cube.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(curve,curve.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(depthcue,depthcue.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(disk,disk.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(dof,dof.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(dofnot,dofnot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(double,double.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(drawf,drawf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(feedback,feedback.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(fog,fog.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(fogindex,fogindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(font,font.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(light,light.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(linelist,linelist.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(lines,lines.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(list,list.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(list2,list2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(maplight,maplight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(material,material.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(mipmap,mipmap.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(model,model.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(movelight,movelight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(nurbs,nurbs.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(pickdepth,pickdepth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(pickline,pickline.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(picksquare,picksquare.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(plane,plane.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(planet,planet.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(planetup,planetup.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(polys,polys.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(robot,robot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(sccolorlight,sccolorlight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(scene,scene.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(scenebamb,scenebamb.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(sceneflat,sceneflat.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(select,select.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(simple,simple.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(smooth,smooth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(sphere,sphere.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(stencil,stencil.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(stroke,stroke.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(surface,surface.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(tea,tea.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(teaambient,teaambient.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(teapots,teapots.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(texgen,texgen.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(texturesurf,texturesurf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(trim,trim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(xfont,xfont.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
|
|
||||||
DependTarget()
|
|
||||||
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
LOCAL_LIBRARIES = $(XLIB) $(TOP)\lib\glut.a $(TOP)\lib\Mesaglu.a $(TOP)\lib\MesaGL.a
|
|
||||||
|
|
||||||
INCLUDES = -I$(TOP)\include
|
|
||||||
|
|
||||||
SRCS = accum.c \
|
|
||||||
bitmap1.c \
|
|
||||||
bitmap2.c \
|
|
||||||
blendeq.c \
|
|
||||||
blendxor.c \
|
|
||||||
copy.c \
|
|
||||||
cursor.c \
|
|
||||||
depth.c \
|
|
||||||
eval.c \
|
|
||||||
fog.c \
|
|
||||||
font.c \
|
|
||||||
line.c \
|
|
||||||
logo.c \
|
|
||||||
nurb.c \
|
|
||||||
oglinfo.c \
|
|
||||||
olympic.c \
|
|
||||||
overlay.c \
|
|
||||||
point.c \
|
|
||||||
prim.c \
|
|
||||||
quad.c \
|
|
||||||
select.c \
|
|
||||||
shape.c \
|
|
||||||
speed.c \
|
|
||||||
sphere.c \
|
|
||||||
star.c \
|
|
||||||
stencil.c \
|
|
||||||
stretch.c \
|
|
||||||
texture.c \
|
|
||||||
tri.c \
|
|
||||||
wave.c
|
|
||||||
|
|
||||||
PROGRAMS = ProgramTargetName(accum) \
|
|
||||||
ProgramTargetName(bitmap1) \
|
|
||||||
ProgramTargetName(bitmap2) \
|
|
||||||
ProgramTargetName(blendeq) \
|
|
||||||
ProgramTargetName(blendxor) \
|
|
||||||
ProgramTargetName(copy) \
|
|
||||||
ProgramTargetName(cursor) \
|
|
||||||
ProgramTargetName(depth) \
|
|
||||||
ProgramTargetName(eval) \
|
|
||||||
ProgramTargetName(fog) \
|
|
||||||
ProgramTargetName(font) \
|
|
||||||
ProgramTargetName(line) \
|
|
||||||
ProgramTargetName(logo) \
|
|
||||||
ProgramTargetName(nurb) \
|
|
||||||
ProgramTargetName(oglinfo) \
|
|
||||||
ProgramTargetName(olympic) \
|
|
||||||
ProgramTargetName(overlay) \
|
|
||||||
ProgramTargetName(point) \
|
|
||||||
ProgramTargetName(prim) \
|
|
||||||
ProgramTargetName(quad) \
|
|
||||||
ProgramTargetName(select) \
|
|
||||||
ProgramTargetName(shape) \
|
|
||||||
ProgramTargetName(speed) \
|
|
||||||
ProgramTargetName(sphere) \
|
|
||||||
ProgramTargetName(star) \
|
|
||||||
ProgramTargetName(stencil) \
|
|
||||||
ProgramTargetName(stretch) \
|
|
||||||
ProgramTargetName(texture) \
|
|
||||||
ProgramTargetName(tri) \
|
|
||||||
ProgramTargetName(wave)
|
|
||||||
|
|
||||||
AllTarget($(PROGRAMS))
|
|
||||||
|
|
||||||
NormalProgramTarget(accum,accum.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(bitmap1,bitmap1.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(bitmap2,bitmap2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(blendeq,blendeq.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(blendxor,blendxor.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(copy,copy.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(cursor,cursor.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(depth,depth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(eval,eval.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(fog,fog.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(font,font.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(line,line.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(logo,logo.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(nurb,nurb.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(oglinfo,oglinfo.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(olympic,olympic.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(overlay,overlay.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(point,point.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(prim,prim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(quad,quad.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(select,select.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(shape,shape.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(speed,speed.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(sphere,sphere.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(star,star.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(stencil,stencil.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(stretch,stretch.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(texture,texture.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(tri,tri.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
NormalProgramTarget(wave,wave.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
|
||||||
|
|
||||||
DependTarget()
|
|
||||||
|
|
||||||
@@ -11,6 +11,7 @@ static PFNGLCREATEPROGRAMPROC glCreateProgram_func = NULL;
|
|||||||
static PFNGLCREATESHADERPROC glCreateShader_func = NULL;
|
static PFNGLCREATESHADERPROC glCreateShader_func = NULL;
|
||||||
static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL;
|
static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL;
|
||||||
static PFNGLDELETESHADERPROC glDeleteShader_func = NULL;
|
static PFNGLDELETESHADERPROC glDeleteShader_func = NULL;
|
||||||
|
static PFNGLGETACTIVEATTRIBPROC glGetActiveAttrib_func = NULL;
|
||||||
static PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders_func = NULL;
|
static PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders_func = NULL;
|
||||||
static PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation_func = NULL;
|
static PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation_func = NULL;
|
||||||
static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog_func = NULL;
|
static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog_func = NULL;
|
||||||
@@ -38,6 +39,13 @@ static PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f_func = NULL;
|
|||||||
static PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f_func = NULL;
|
static PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f_func = NULL;
|
||||||
static PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f_func = NULL;
|
static PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f_func = NULL;
|
||||||
|
|
||||||
|
/* OpenGL 2.1 */
|
||||||
|
static PFNGLUNIFORMMATRIX2X3FVPROC glUniformMatrix2x3fv_func = NULL;
|
||||||
|
static PFNGLUNIFORMMATRIX3X2FVPROC glUniformMatrix3x2fv_func = NULL;
|
||||||
|
static PFNGLUNIFORMMATRIX2X4FVPROC glUniformMatrix2x4fv_func = NULL;
|
||||||
|
static PFNGLUNIFORMMATRIX4X2FVPROC glUniformMatrix4x2fv_func = NULL;
|
||||||
|
static PFNGLUNIFORMMATRIX3X4FVPROC glUniformMatrix3x4fv_func = NULL;
|
||||||
|
static PFNGLUNIFORMMATRIX4X3FVPROC glUniformMatrix4x3fv_func = NULL;
|
||||||
|
|
||||||
/* GL_ARB_vertex/fragment_program */
|
/* GL_ARB_vertex/fragment_program */
|
||||||
static PFNGLBINDPROGRAMARBPROC glBindProgramARB_func = NULL;
|
static PFNGLBINDPROGRAMARBPROC glBindProgramARB_func = NULL;
|
||||||
@@ -56,6 +64,8 @@ static PFNGLDELETEVERTEXARRAYSAPPLEPROC glDeleteVertexArraysAPPLE_func = NULL;
|
|||||||
static PFNGLGENVERTEXARRAYSAPPLEPROC glGenVertexArraysAPPLE_func = NULL;
|
static PFNGLGENVERTEXARRAYSAPPLEPROC glGenVertexArraysAPPLE_func = NULL;
|
||||||
static PFNGLISVERTEXARRAYAPPLEPROC glIsVertexArrayAPPLE_func = NULL;
|
static PFNGLISVERTEXARRAYAPPLEPROC glIsVertexArrayAPPLE_func = NULL;
|
||||||
|
|
||||||
|
/* GL_EXT_stencil_two_side */
|
||||||
|
static PFNGLACTIVESTENCILFACEEXTPROC glActiveStencilFaceEXT_func = NULL;
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -69,6 +79,7 @@ GetExtensionFuncs(void)
|
|||||||
glCreateShader_func = (PFNGLCREATESHADERPROC) glutGetProcAddress("glCreateShader");
|
glCreateShader_func = (PFNGLCREATESHADERPROC) glutGetProcAddress("glCreateShader");
|
||||||
glDeleteProgram_func = (PFNGLDELETEPROGRAMPROC) glutGetProcAddress("glDeleteProgram");
|
glDeleteProgram_func = (PFNGLDELETEPROGRAMPROC) glutGetProcAddress("glDeleteProgram");
|
||||||
glDeleteShader_func = (PFNGLDELETESHADERPROC) glutGetProcAddress("glDeleteShader");
|
glDeleteShader_func = (PFNGLDELETESHADERPROC) glutGetProcAddress("glDeleteShader");
|
||||||
|
glGetActiveAttrib_func = (PFNGLGETACTIVEATTRIBPROC) glutGetProcAddress("glGetActiveAttrib");
|
||||||
glGetAttachedShaders_func = (PFNGLGETATTACHEDSHADERSPROC) glutGetProcAddress("glGetAttachedShaders");
|
glGetAttachedShaders_func = (PFNGLGETATTACHEDSHADERSPROC) glutGetProcAddress("glGetAttachedShaders");
|
||||||
glGetAttribLocation_func = (PFNGLGETATTRIBLOCATIONPROC) glutGetProcAddress("glGetAttribLocation");
|
glGetAttribLocation_func = (PFNGLGETATTRIBLOCATIONPROC) glutGetProcAddress("glGetAttribLocation");
|
||||||
glGetProgramInfoLog_func = (PFNGLGETPROGRAMINFOLOGPROC) glutGetProcAddress("glGetProgramInfoLog");
|
glGetProgramInfoLog_func = (PFNGLGETPROGRAMINFOLOGPROC) glutGetProcAddress("glGetProgramInfoLog");
|
||||||
@@ -96,6 +107,13 @@ GetExtensionFuncs(void)
|
|||||||
glVertexAttrib3f_func = (PFNGLVERTEXATTRIB3FPROC) glutGetProcAddress("glVertexAttrib3f");
|
glVertexAttrib3f_func = (PFNGLVERTEXATTRIB3FPROC) glutGetProcAddress("glVertexAttrib3f");
|
||||||
glVertexAttrib4f_func = (PFNGLVERTEXATTRIB4FPROC) glutGetProcAddress("glVertexAttrib4f");
|
glVertexAttrib4f_func = (PFNGLVERTEXATTRIB4FPROC) glutGetProcAddress("glVertexAttrib4f");
|
||||||
|
|
||||||
|
/* OpenGL 2.1 */
|
||||||
|
glUniformMatrix2x3fv_func = (PFNGLUNIFORMMATRIX2X3FVPROC) glutGetProcAddress("glUniformMatrix2x3fv");
|
||||||
|
glUniformMatrix3x2fv_func = (PFNGLUNIFORMMATRIX3X2FVPROC) glutGetProcAddress("glUniformMatrix3x2fv");
|
||||||
|
glUniformMatrix2x4fv_func = (PFNGLUNIFORMMATRIX2X4FVPROC) glutGetProcAddress("glUniformMatrix2x4fv");
|
||||||
|
glUniformMatrix4x2fv_func = (PFNGLUNIFORMMATRIX4X2FVPROC) glutGetProcAddress("glUniformMatrix4x2fv");
|
||||||
|
glUniformMatrix3x4fv_func = (PFNGLUNIFORMMATRIX3X4FVPROC) glutGetProcAddress("glUniformMatrix3x4fv");
|
||||||
|
glUniformMatrix4x3fv_func = (PFNGLUNIFORMMATRIX4X3FVPROC) glutGetProcAddress("glUniformMatrix4x3fv");
|
||||||
|
|
||||||
/* GL_ARB_vertex/fragment_program */
|
/* GL_ARB_vertex/fragment_program */
|
||||||
glBindProgramARB_func = (PFNGLBINDPROGRAMARBPROC) glutGetProcAddress("glBindProgramARB");
|
glBindProgramARB_func = (PFNGLBINDPROGRAMARBPROC) glutGetProcAddress("glBindProgramARB");
|
||||||
@@ -114,5 +132,7 @@ GetExtensionFuncs(void)
|
|||||||
glGenVertexArraysAPPLE_func = (PFNGLGENVERTEXARRAYSAPPLEPROC) glutGetProcAddress("glGenVertexArraysAPPLE");
|
glGenVertexArraysAPPLE_func = (PFNGLGENVERTEXARRAYSAPPLEPROC) glutGetProcAddress("glGenVertexArraysAPPLE");
|
||||||
glIsVertexArrayAPPLE_func = (PFNGLISVERTEXARRAYAPPLEPROC) glutGetProcAddress("glIsVertexArrayAPPLE");
|
glIsVertexArrayAPPLE_func = (PFNGLISVERTEXARRAYAPPLEPROC) glutGetProcAddress("glIsVertexArrayAPPLE");
|
||||||
|
|
||||||
|
/* GL_EXT_stencil_two_side */
|
||||||
|
glActiveStencilFaceEXT_func = (PFNGLACTIVESTENCILFACEEXTPROC) glutGetProcAddress("glActiveStencilFaceEXT");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
DESCRIPTION 'Mesa GLU (OpenGL work-alike) for Win32'
|
;DESCRIPTION 'Mesa GLU (OpenGL work-alike) for Win32'
|
||||||
VERSION 5.1
|
VERSION 5.1
|
||||||
;
|
;
|
||||||
; Module definition file for GLU (GLU32.DLL)
|
; Module definition file for GLU (GLU32.DLL)
|
||||||
|
|||||||
@@ -349,12 +349,18 @@ getVisualInfoRGB(unsigned int mode)
|
|||||||
__glutScreen, list);
|
__glutScreen, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef VisualIDMask
|
||||||
|
#define VisualIDMask 0
|
||||||
|
#endif
|
||||||
|
|
||||||
static XVisualInfo *
|
static XVisualInfo *
|
||||||
getVisualInfoID(int id)
|
getVisualInfoID(int id)
|
||||||
{
|
{
|
||||||
XVisualInfo temp;
|
XVisualInfo temp;
|
||||||
int count;
|
int count;
|
||||||
|
#if !defined(_WIN32)
|
||||||
temp.visualid = id;
|
temp.visualid = id;
|
||||||
|
#endif
|
||||||
return XGetVisualInfo(__glutDisplay, VisualIDMask, &temp, &count);
|
return XGetVisualInfo(__glutDisplay, VisualIDMask, &temp, &count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ C_SOURCES = \
|
|||||||
$(TOP)/src/mesa/main/dispatch.c \
|
$(TOP)/src/mesa/main/dispatch.c \
|
||||||
$(TOP)/src/mesa/glapi/glapi.c \
|
$(TOP)/src/mesa/glapi/glapi.c \
|
||||||
$(TOP)/src/mesa/glapi/glthread.c \
|
$(TOP)/src/mesa/glapi/glthread.c \
|
||||||
$(TOP)/src/mesa/drivers/dri/common/glcontextmodes.c \
|
$(TOP)/src/glx/x11/glcontextmodes.c \
|
||||||
miniglx.c \
|
miniglx.c \
|
||||||
miniglx_events.c
|
miniglx_events.c
|
||||||
|
|
||||||
@@ -27,10 +27,7 @@ INCLUDE_DIRS = \
|
|||||||
-I$(TOP)/src/mesa \
|
-I$(TOP)/src/mesa \
|
||||||
-I$(TOP)/src/mesa/main \
|
-I$(TOP)/src/mesa/main \
|
||||||
-I$(TOP)/src/mesa/glapi \
|
-I$(TOP)/src/mesa/glapi \
|
||||||
-I$(TOP)/src/mesa/math \
|
-I$(TOP)/src/glx/x11 \
|
||||||
-I$(TOP)/src/mesa/transform \
|
|
||||||
-I$(TOP)/src/mesa/swrast \
|
|
||||||
-I$(TOP)/src/mesa/swrast_setup \
|
|
||||||
-I$(TOP)/src/mesa/drivers/dri/common \
|
-I$(TOP)/src/mesa/drivers/dri/common \
|
||||||
`pkg-config --cflags libdrm`
|
`pkg-config --cflags libdrm`
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,6 @@
|
|||||||
#ifndef _driver_H_
|
#ifndef _driver_H_
|
||||||
#define _driver_H_
|
#define _driver_H_
|
||||||
|
|
||||||
#define CAPI /* XXX this should be globally defined somewhere */
|
|
||||||
|
|
||||||
#include "GL/gl.h"
|
#include "GL/gl.h"
|
||||||
#include "GL/internal/glcore.h"
|
#include "GL/internal/glcore.h"
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ INCLUDES = -I. \
|
|||||||
-I$(TOP)/include/GL/internal \
|
-I$(TOP)/include/GL/internal \
|
||||||
-I$(TOP)/src/mesa/main \
|
-I$(TOP)/src/mesa/main \
|
||||||
-I$(TOP)/src/mesa/glapi \
|
-I$(TOP)/src/mesa/glapi \
|
||||||
-I$(TOP)/src/mesa/drivers/dri/common \
|
|
||||||
$(LIBDRM_CFLAGS) \
|
$(LIBDRM_CFLAGS) \
|
||||||
$(X11_INCLUDES)
|
$(X11_INCLUDES)
|
||||||
|
|
||||||
@@ -63,9 +62,6 @@ INCLUDES = -I. \
|
|||||||
|
|
||||||
default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
|
default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
|
||||||
|
|
||||||
glcontextmodes.c:
|
|
||||||
ln -s $(TOP)/src/mesa/drivers/dri/common/glcontextmodes.c .
|
|
||||||
|
|
||||||
# Make libGL
|
# Make libGL
|
||||||
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
|
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
|
||||||
$(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
|
$(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
|
||||||
@@ -81,7 +77,7 @@ depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_ASM_API) Makefile
|
|||||||
|
|
||||||
# Emacs tags
|
# Emacs tags
|
||||||
tags:
|
tags:
|
||||||
etags `find . -name \*.[ch]` `find ../include`
|
etags `find . -name \*.[ch]` `find $(TOP)/include`
|
||||||
|
|
||||||
# Dummy install target
|
# Dummy install target
|
||||||
install:
|
install:
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
#include <X11/Xlibint.h>
|
#include <X11/Xlibint.h>
|
||||||
#include <X11/extensions/Xext.h>
|
#include <X11/extensions/Xext.h>
|
||||||
#include <X11/extensions/extutil.h>
|
#include <X11/extensions/extutil.h>
|
||||||
|
#include "glheader.h"
|
||||||
#include "glxclient.h"
|
#include "glxclient.h"
|
||||||
#include "xf86dri.h"
|
#include "xf86dri.h"
|
||||||
#include "sarea.h"
|
#include "sarea.h"
|
||||||
@@ -81,11 +82,15 @@ static void InfoMessageF(const char *f, ...)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print error to stderr, unless LIBGL_DEBUG=="quiet".
|
||||||
|
*/
|
||||||
static void ErrorMessageF(const char *f, ...)
|
static void ErrorMessageF(const char *f, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
const char *env;
|
||||||
|
|
||||||
if (getenv("LIBGL_DEBUG")) {
|
if ((env = getenv("LIBGL_DEBUG")) && !strstr(env, "quiet")) {
|
||||||
fprintf(stderr, "libGL error: ");
|
fprintf(stderr, "libGL error: ");
|
||||||
va_start(args, f);
|
va_start(args, f);
|
||||||
vfprintf(stderr, f, args);
|
vfprintf(stderr, f, args);
|
||||||
@@ -338,7 +343,7 @@ __DRIdriver *driGetDriver(Display *dpy, int scrNum)
|
|||||||
* The returned char pointer points to a static array that will be
|
* The returned char pointer points to a static array that will be
|
||||||
* overwritten by subsequent calls.
|
* overwritten by subsequent calls.
|
||||||
*/
|
*/
|
||||||
const char *glXGetScreenDriver (Display *dpy, int scrNum) {
|
PUBLIC const char *glXGetScreenDriver (Display *dpy, int scrNum) {
|
||||||
static char ret[32];
|
static char ret[32];
|
||||||
char *driverName;
|
char *driverName;
|
||||||
if (GetDriverName(dpy, scrNum, &driverName)) {
|
if (GetDriverName(dpy, scrNum, &driverName)) {
|
||||||
@@ -367,7 +372,7 @@ const char *glXGetScreenDriver (Display *dpy, int scrNum) {
|
|||||||
*
|
*
|
||||||
* Note: The driver remains opened after this function returns.
|
* Note: The driver remains opened after this function returns.
|
||||||
*/
|
*/
|
||||||
const char *glXGetDriverConfig (const char *driverName) {
|
PUBLIC const char *glXGetDriverConfig (const char *driverName) {
|
||||||
__DRIdriver *driver = OpenDriver (driverName);
|
__DRIdriver *driver = OpenDriver (driverName);
|
||||||
if (driver)
|
if (driver)
|
||||||
return dlsym (driver->handle, "__driConfigOptions");
|
return dlsym (driver->handle, "__driConfigOptions");
|
||||||
|
|||||||
@@ -31,21 +31,25 @@
|
|||||||
* \author Ian Romanick <idr@us.ibm.com>
|
* \author Ian Romanick <idr@us.ibm.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(IN_MINI_GLX)
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#else
|
||||||
|
#if defined(HAVE_DIX_CONFIG_H)
|
||||||
|
# include <dix-config.h>
|
||||||
|
#endif
|
||||||
|
#include <X11/X.h>
|
||||||
|
#include <GL/glx.h>
|
||||||
|
#include "GL/glxint.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Memory macros */
|
||||||
#if defined(IN_MINI_GLX)
|
#if defined(IN_MINI_GLX)
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
# include <string.h>
|
# include <string.h>
|
||||||
# include <GL/gl.h>
|
# define _mesa_malloc(b) malloc(b)
|
||||||
# include "GL/internal/dri_interface.h"
|
# define _mesa_free(m) free(m)
|
||||||
# include "imports.h"
|
|
||||||
# define _mesa_memset memset
|
# define _mesa_memset memset
|
||||||
#else
|
#else
|
||||||
# if defined(HAVE_DIX_CONFIG_H)
|
|
||||||
# include <dix-config.h>
|
|
||||||
# endif
|
|
||||||
# include <X11/X.h>
|
|
||||||
# include <GL/glx.h>
|
|
||||||
# include "GL/glxint.h"
|
|
||||||
|
|
||||||
# ifdef XFree86Server
|
# ifdef XFree86Server
|
||||||
# include <os.h>
|
# include <os.h>
|
||||||
# include <string.h>
|
# include <string.h>
|
||||||
@@ -1246,7 +1246,7 @@ __GLXdisplayPrivate *__glXInitialize(Display* dpy)
|
|||||||
__glXUnlock();
|
__glXUnlock();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
dpyPriv = (__GLXdisplayPrivate *) Xmalloc(sizeof(__GLXdisplayPrivate));
|
dpyPriv = (__GLXdisplayPrivate *) Xcalloc(1, sizeof(__GLXdisplayPrivate));
|
||||||
if (!dpyPriv) {
|
if (!dpyPriv) {
|
||||||
__glXUnlock();
|
__glXUnlock();
|
||||||
Xfree((char*) private);
|
Xfree((char*) private);
|
||||||
@@ -1271,12 +1271,7 @@ __GLXdisplayPrivate *__glXInitialize(Display* dpy)
|
|||||||
** Note: This _must_ be done before calling any other DRI routines
|
** Note: This _must_ be done before calling any other DRI routines
|
||||||
** (e.g., those called in AllocAndFetchScreenConfigs).
|
** (e.g., those called in AllocAndFetchScreenConfigs).
|
||||||
*/
|
*/
|
||||||
if (getenv("LIBGL_ALWAYS_INDIRECT")) {
|
if (getenv("LIBGL_ALWAYS_INDIRECT") == NULL) {
|
||||||
/* Assinging zero here assures we'll never go direct */
|
|
||||||
dpyPriv->driDisplay.private = 0;
|
|
||||||
dpyPriv->driDisplay.destroyDisplay = 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dpyPriv->driDisplay.private =
|
dpyPriv->driDisplay.private =
|
||||||
driCreateDisplay(dpy, &dpyPriv->driDisplay);
|
driCreateDisplay(dpy, &dpyPriv->driDisplay);
|
||||||
}
|
}
|
||||||
@@ -1488,7 +1483,7 @@ void __glXSendLargeCommand(__GLXcontext *ctx,
|
|||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
GLXContext glXGetCurrentContext(void)
|
PUBLIC GLXContext glXGetCurrentContext(void)
|
||||||
{
|
{
|
||||||
GLXContext cx = __glXGetCurrentContext();
|
GLXContext cx = __glXGetCurrentContext();
|
||||||
|
|
||||||
@@ -1499,7 +1494,7 @@ GLXContext glXGetCurrentContext(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLXDrawable glXGetCurrentDrawable(void)
|
PUBLIC GLXDrawable glXGetCurrentDrawable(void)
|
||||||
{
|
{
|
||||||
GLXContext gc = __glXGetCurrentContext();
|
GLXContext gc = __glXGetCurrentContext();
|
||||||
return gc->currentDrawable;
|
return gc->currentDrawable;
|
||||||
|
|||||||
@@ -145,9 +145,10 @@ GLenum __indirect_glGetError(void)
|
|||||||
* On success \c GL_TRUE is returned. Otherwise, \c GL_FALSE is returned.
|
* On success \c GL_TRUE is returned. Otherwise, \c GL_FALSE is returned.
|
||||||
*/
|
*/
|
||||||
static GLboolean
|
static GLboolean
|
||||||
get_client_data( __GLXattribute * state, GLenum cap, GLintptr * data )
|
get_client_data( __GLXcontext * gc, GLenum cap, GLintptr * data )
|
||||||
{
|
{
|
||||||
GLboolean retval = GL_TRUE;
|
GLboolean retval = GL_TRUE;
|
||||||
|
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
|
||||||
const GLint tex_unit = __glXGetActiveTextureUnit( state );
|
const GLint tex_unit = __glXGetActiveTextureUnit( state );
|
||||||
|
|
||||||
|
|
||||||
@@ -281,6 +282,9 @@ get_client_data( __GLXattribute * state, GLenum cap, GLintptr * data )
|
|||||||
case GL_UNPACK_LSB_FIRST:
|
case GL_UNPACK_LSB_FIRST:
|
||||||
*data = (GLintptr)state->storeUnpack.lsbFirst;
|
*data = (GLintptr)state->storeUnpack.lsbFirst;
|
||||||
break;
|
break;
|
||||||
|
case GL_CLIENT_ATTRIB_STACK_DEPTH:
|
||||||
|
*data = (GLintptr)(gc->attributes.stackPointer - gc->attributes.stack);
|
||||||
|
break;
|
||||||
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
|
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
|
||||||
*data = (GLintptr)__GL_CLIENT_ATTRIB_STACK_DEPTH;
|
*data = (GLintptr)__GL_CLIENT_ATTRIB_STACK_DEPTH;
|
||||||
break;
|
break;
|
||||||
@@ -302,7 +306,6 @@ void __indirect_glGetBooleanv(GLenum val, GLboolean *b)
|
|||||||
{
|
{
|
||||||
const GLenum origVal = val;
|
const GLenum origVal = val;
|
||||||
__GLX_SINGLE_DECLARE_VARIABLES();
|
__GLX_SINGLE_DECLARE_VARIABLES();
|
||||||
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
|
|
||||||
xGLXSingleReply reply;
|
xGLXSingleReply reply;
|
||||||
|
|
||||||
val = RemapTransposeEnum( val );
|
val = RemapTransposeEnum( val );
|
||||||
@@ -326,7 +329,7 @@ void __indirect_glGetBooleanv(GLenum val, GLboolean *b)
|
|||||||
** for example, to call a query between glBegin() and glEnd()).
|
** for example, to call a query between glBegin() and glEnd()).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( get_client_data( state, val, & data ) ) {
|
if ( get_client_data( gc, val, & data ) ) {
|
||||||
*b = (GLboolean) data;
|
*b = (GLboolean) data;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -351,7 +354,6 @@ void __indirect_glGetDoublev(GLenum val, GLdouble *d)
|
|||||||
{
|
{
|
||||||
const GLenum origVal = val;
|
const GLenum origVal = val;
|
||||||
__GLX_SINGLE_DECLARE_VARIABLES();
|
__GLX_SINGLE_DECLARE_VARIABLES();
|
||||||
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
|
|
||||||
xGLXSingleReply reply;
|
xGLXSingleReply reply;
|
||||||
|
|
||||||
val = RemapTransposeEnum( val );
|
val = RemapTransposeEnum( val );
|
||||||
@@ -375,7 +377,7 @@ void __indirect_glGetDoublev(GLenum val, GLdouble *d)
|
|||||||
** for example, to call a query between glBegin() and glEnd()).
|
** for example, to call a query between glBegin() and glEnd()).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( get_client_data( state, val, & data ) ) {
|
if ( get_client_data( gc, val, & data ) ) {
|
||||||
*d = (GLdouble) data;
|
*d = (GLdouble) data;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -400,7 +402,6 @@ void __indirect_glGetFloatv(GLenum val, GLfloat *f)
|
|||||||
{
|
{
|
||||||
const GLenum origVal = val;
|
const GLenum origVal = val;
|
||||||
__GLX_SINGLE_DECLARE_VARIABLES();
|
__GLX_SINGLE_DECLARE_VARIABLES();
|
||||||
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
|
|
||||||
xGLXSingleReply reply;
|
xGLXSingleReply reply;
|
||||||
|
|
||||||
val = RemapTransposeEnum( val );
|
val = RemapTransposeEnum( val );
|
||||||
@@ -424,7 +425,7 @@ void __indirect_glGetFloatv(GLenum val, GLfloat *f)
|
|||||||
** for example, to call a query between glBegin() and glEnd()).
|
** for example, to call a query between glBegin() and glEnd()).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( get_client_data( state, val, & data ) ) {
|
if ( get_client_data( gc, val, & data ) ) {
|
||||||
*f = (GLfloat) data;
|
*f = (GLfloat) data;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -449,7 +450,6 @@ void __indirect_glGetIntegerv(GLenum val, GLint *i)
|
|||||||
{
|
{
|
||||||
const GLenum origVal = val;
|
const GLenum origVal = val;
|
||||||
__GLX_SINGLE_DECLARE_VARIABLES();
|
__GLX_SINGLE_DECLARE_VARIABLES();
|
||||||
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
|
|
||||||
xGLXSingleReply reply;
|
xGLXSingleReply reply;
|
||||||
|
|
||||||
val = RemapTransposeEnum( val );
|
val = RemapTransposeEnum( val );
|
||||||
@@ -473,7 +473,7 @@ void __indirect_glGetIntegerv(GLenum val, GLint *i)
|
|||||||
** for example, to call a query between glBegin() and glEnd()).
|
** for example, to call a query between glBegin() and glEnd()).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( get_client_data( state, val, & data ) ) {
|
if ( get_client_data( gc, val, & data ) ) {
|
||||||
*i = (GLint) data;
|
*i = (GLint) data;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -89,9 +89,7 @@ fbdev: $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) $(COMMON_DRIVER_OBJECTS)
|
|||||||
# Stand-alone Mesa libGL and libOSMesa
|
# Stand-alone Mesa libGL and libOSMesa
|
||||||
STAND_ALONE_DRIVER_SOURCES = \
|
STAND_ALONE_DRIVER_SOURCES = \
|
||||||
$(COMMON_DRIVER_SOURCES) \
|
$(COMMON_DRIVER_SOURCES) \
|
||||||
$(X11_DRIVER_SOURCES) \
|
$(X11_DRIVER_SOURCES)
|
||||||
$(GLIDE_DRIVER_SOURCES) \
|
|
||||||
$(SVGA_DRIVER_SOURCES)
|
|
||||||
|
|
||||||
STAND_ALONE_DRIVER_OBJECTS = $(STAND_ALONE_DRIVER_SOURCES:.c=.o)
|
STAND_ALONE_DRIVER_OBJECTS = $(STAND_ALONE_DRIVER_SOURCES:.c=.o)
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,9 @@
|
|||||||
#include "buffers.h"
|
#include "buffers.h"
|
||||||
#include "context.h"
|
#include "context.h"
|
||||||
#include "framebuffer.h"
|
#include "framebuffer.h"
|
||||||
#include "occlude.h"
|
|
||||||
#include "program.h"
|
#include "program.h"
|
||||||
#include "prog_execute.h"
|
#include "prog_execute.h"
|
||||||
|
#include "queryobj.h"
|
||||||
#include "renderbuffer.h"
|
#include "renderbuffer.h"
|
||||||
#include "texcompress.h"
|
#include "texcompress.h"
|
||||||
#include "texformat.h"
|
#include "texformat.h"
|
||||||
|
|||||||
@@ -190,11 +190,16 @@ driBOKernel(struct _DriBufferObject *buf)
|
|||||||
void
|
void
|
||||||
driBOWaitIdle(struct _DriBufferObject *buf, int lazy)
|
driBOWaitIdle(struct _DriBufferObject *buf, int lazy)
|
||||||
{
|
{
|
||||||
assert(buf->private != NULL);
|
struct _DriBufferPool *pool;
|
||||||
|
void *priv;
|
||||||
|
|
||||||
_glthread_LOCK_MUTEX(buf->mutex);
|
_glthread_LOCK_MUTEX(buf->mutex);
|
||||||
BM_CKFATAL(buf->pool->waitIdle(buf->pool, buf->private, lazy));
|
pool = buf->pool;
|
||||||
|
priv = buf->private;
|
||||||
_glthread_UNLOCK_MUTEX(buf->mutex);
|
_glthread_UNLOCK_MUTEX(buf->mutex);
|
||||||
|
|
||||||
|
assert(priv != NULL);
|
||||||
|
BM_CKFATAL(buf->pool->waitIdle(pool, priv, lazy));
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
@@ -296,7 +301,8 @@ driBOData(struct _DriBufferObject *buf,
|
|||||||
pool->destroy(pool, buf->private);
|
pool->destroy(pool, buf->private);
|
||||||
if (!flags)
|
if (!flags)
|
||||||
flags = buf->flags;
|
flags = buf->flags;
|
||||||
buf->private = pool->create(pool, size, flags, 0, buf->alignment);
|
buf->private = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE,
|
||||||
|
buf->alignment);
|
||||||
if (!buf->private)
|
if (!buf->private)
|
||||||
BM_CKFATAL(-ENOMEM);
|
BM_CKFATAL(-ENOMEM);
|
||||||
BM_CKFATAL(pool->map(pool, buf->private,
|
BM_CKFATAL(pool->map(pool, buf->private,
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ pool_setstatic(struct _DriBufferPool *pool, unsigned long offset,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ret = drmBOCreate(pool->fd, offset, size, 0, NULL, drm_bo_type_fake,
|
ret = drmBOCreate(pool->fd, offset, size, 0, NULL, drm_bo_type_fake,
|
||||||
flags, 0, buf);
|
flags, DRM_BO_HINT_DONT_FENCE, buf);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|||||||
@@ -49,8 +49,6 @@
|
|||||||
#ifndef _DRI_UTIL_H_
|
#ifndef _DRI_UTIL_H_
|
||||||
#define _DRI_UTIL_H_
|
#define _DRI_UTIL_H_
|
||||||
|
|
||||||
#define CAPI /* XXX this should be globally defined somewhere */
|
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include "drm.h"
|
#include "drm.h"
|
||||||
#include "drm_sarea.h"
|
#include "drm_sarea.h"
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ driUpdateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv)
|
|||||||
{
|
{
|
||||||
struct gl_framebuffer *fb = (struct gl_framebuffer *) dPriv->driverPrivate;
|
struct gl_framebuffer *fb = (struct gl_framebuffer *) dPriv->driverPrivate;
|
||||||
if (fb && (dPriv->w != fb->Width || dPriv->h != fb->Height)) {
|
if (fb && (dPriv->w != fb->Width || dPriv->h != fb->Height)) {
|
||||||
_mesa_resize_framebuffer(ctx, fb, dPriv->w, dPriv->h);
|
ctx->Driver.ResizeBuffers(ctx, fb, dPriv->w, dPriv->h);
|
||||||
assert(fb->Width == dPriv->w);
|
assert(fb->Width == dPriv->w);
|
||||||
assert(fb->Height == dPriv->h);
|
assert(fb->Height == dPriv->h);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
#include "extensions.h"
|
#include "extensions.h"
|
||||||
#include "framebuffer.h"
|
#include "framebuffer.h"
|
||||||
#include "imports.h"
|
#include "imports.h"
|
||||||
|
#include "points.h"
|
||||||
|
|
||||||
#include "swrast/swrast.h"
|
#include "swrast/swrast.h"
|
||||||
#include "swrast_setup/swrast_setup.h"
|
#include "swrast_setup/swrast_setup.h"
|
||||||
@@ -278,6 +279,11 @@ i810CreateContext( const __GLcontextModes *mesaVis,
|
|||||||
ctx->Const.MaxPointSizeAA = 3.0;
|
ctx->Const.MaxPointSizeAA = 3.0;
|
||||||
ctx->Const.PointSizeGranularity = 1.0;
|
ctx->Const.PointSizeGranularity = 1.0;
|
||||||
|
|
||||||
|
/* reinitialize the context point state.
|
||||||
|
* It depend on constants in __GLcontextRec::Const
|
||||||
|
*/
|
||||||
|
_mesa_init_point(ctx);
|
||||||
|
|
||||||
ctx->Driver.GetBufferSize = i810BufferSize;
|
ctx->Driver.GetBufferSize = i810BufferSize;
|
||||||
ctx->Driver.GetString = i810GetString;
|
ctx->Driver.GetString = i810GetString;
|
||||||
|
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ GLboolean i915CreateContext( const __GLcontextModes *mesaVis,
|
|||||||
ctx->Const.FragmentProgram.MaxNativeTexIndirections = I915_MAX_TEX_INDIRECT;
|
ctx->Const.FragmentProgram.MaxNativeTexIndirections = I915_MAX_TEX_INDIRECT;
|
||||||
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
|
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
|
||||||
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
||||||
|
ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
|
||||||
|
|
||||||
|
|
||||||
driInitExtensions( ctx, i915_extensions, GL_FALSE );
|
driInitExtensions( ctx, i915_extensions, GL_FALSE );
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ void i915_update_fog( GLcontext *ctx )
|
|||||||
GLboolean enabled;
|
GLboolean enabled;
|
||||||
GLboolean try_pixel_fog;
|
GLboolean try_pixel_fog;
|
||||||
|
|
||||||
if (ctx->FragmentProgram._Enabled) {
|
if (ctx->FragmentProgram._Active) {
|
||||||
/* Pull in static fog state from program */
|
/* Pull in static fog state from program */
|
||||||
|
|
||||||
mode = ctx->FragmentProgram._Current->FogOption;
|
mode = ctx->FragmentProgram._Current->FogOption;
|
||||||
@@ -541,17 +541,19 @@ void i915_update_fog( GLcontext *ctx )
|
|||||||
else {
|
else {
|
||||||
enabled = ctx->Fog.Enabled;
|
enabled = ctx->Fog.Enabled;
|
||||||
mode = ctx->Fog.Mode;
|
mode = ctx->Fog.Mode;
|
||||||
|
#if 0
|
||||||
try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT &&
|
/* XXX - DISABLED -- Need ortho fallback */
|
||||||
ctx->Hint.Fog == GL_NICEST &&
|
try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT
|
||||||
0); /* XXX - DISABLE -- Need ortho fallback */
|
&&ctx->Hint.Fog == GL_NICEST);
|
||||||
|
#else
|
||||||
|
try_pixel_fog = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
i915->vertex_fog = I915_FOG_NONE;
|
i915->vertex_fog = I915_FOG_NONE;
|
||||||
}
|
}
|
||||||
else if (try_pixel_fog) {
|
else if (try_pixel_fog) {
|
||||||
|
|
||||||
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
|
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
|
||||||
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
|
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
|
||||||
i915->vertex_fog = I915_FOG_PIXEL;
|
i915->vertex_fog = I915_FOG_PIXEL;
|
||||||
@@ -567,8 +569,8 @@ void i915_update_fog( GLcontext *ctx )
|
|||||||
i915->vertex_fog = I915_FOG_VERTEX;
|
i915->vertex_fog = I915_FOG_VERTEX;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GLfloat c1 = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
|
GLfloat c2 = 1.0 / (ctx->Fog.End - ctx->Fog.Start);
|
||||||
GLfloat c2 = 1.0/(ctx->Fog.End-ctx->Fog.Start);
|
GLfloat c1 = ctx->Fog.End * c2;
|
||||||
|
|
||||||
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_C1_MASK;
|
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_C1_MASK;
|
||||||
i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_LINEAR;
|
i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_LINEAR;
|
||||||
@@ -576,10 +578,11 @@ void i915_update_fog( GLcontext *ctx )
|
|||||||
((GLuint)(c1 * FMC1_C1_ONE)) & FMC1_C1_MASK;
|
((GLuint)(c1 * FMC1_C1_ONE)) & FMC1_C1_MASK;
|
||||||
|
|
||||||
if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
|
if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
|
||||||
i915->state.Fog[I915_FOGREG_MODE2] = (GLuint)(c2 * FMC2_C2_ONE);
|
i915->state.Fog[I915_FOGREG_MODE2]
|
||||||
|
= (GLuint)(c2 * FMC2_C2_ONE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
union { float f; int i; } fi;
|
fi_type fi;
|
||||||
fi.f = c2;
|
fi.f = c2;
|
||||||
i915->state.Fog[I915_FOGREG_MODE2] = fi.i;
|
i915->state.Fog[I915_FOGREG_MODE2] = fi.i;
|
||||||
}
|
}
|
||||||
@@ -602,24 +605,22 @@ void i915_update_fog( GLcontext *ctx )
|
|||||||
i915->vertex_fog = I915_FOG_VERTEX;
|
i915->vertex_fog = I915_FOG_VERTEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
|
||||||
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
|
I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled);
|
||||||
I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled);
|
if (enabled)
|
||||||
if (enabled)
|
i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE;
|
||||||
i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE;
|
else
|
||||||
else
|
i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE;
|
||||||
i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* always enbale pixel fog
|
/* Always enable pixel fog. Vertex fog using fog coord will conflict
|
||||||
* vertex fog use precaculted fog coord will conflict with appended
|
* with fog code appended onto fragment program.
|
||||||
* fog program
|
|
||||||
*/
|
*/
|
||||||
_tnl_allow_vertex_fog( ctx, 0 );
|
_tnl_allow_vertex_fog( ctx, 0 );
|
||||||
_tnl_allow_pixel_fog( ctx, 1 );
|
_tnl_allow_pixel_fog( ctx, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
|
static void
|
||||||
|
i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
|
||||||
{
|
{
|
||||||
i915ContextPtr i915 = I915_CONTEXT(ctx);
|
i915ContextPtr i915 = I915_CONTEXT(ctx);
|
||||||
|
|
||||||
@@ -634,8 +635,8 @@ static void i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
|
|||||||
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
|
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
|
||||||
|
|
||||||
if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
|
if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
|
||||||
i915->state.Fog[I915_FOGREG_MODE3] = (GLuint)(ctx->Fog.Density *
|
i915->state.Fog[I915_FOGREG_MODE3]
|
||||||
FMC3_D_ONE);
|
= (GLuint)(ctx->Fog.Density * FMC3_D_ONE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
union { float f; int i; } fi;
|
union { float f; int i; } fi;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ static void i915_render_start( intelContextPtr intel )
|
|||||||
GLcontext *ctx = &intel->ctx;
|
GLcontext *ctx = &intel->ctx;
|
||||||
i915ContextPtr i915 = I915_CONTEXT(intel);
|
i915ContextPtr i915 = I915_CONTEXT(intel);
|
||||||
|
|
||||||
if (ctx->FragmentProgram._Current)
|
if (ctx->FragmentProgram._Active)
|
||||||
i915ValidateFragmentProgram( i915 );
|
i915ValidateFragmentProgram( i915 );
|
||||||
else {
|
else {
|
||||||
assert(!ctx->FragmentProgram._MaintainTexEnvProgram);
|
assert(!ctx->FragmentProgram._MaintainTexEnvProgram);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include "extensions.h"
|
#include "extensions.h"
|
||||||
#include "framebuffer.h"
|
#include "framebuffer.h"
|
||||||
#include "imports.h"
|
#include "imports.h"
|
||||||
|
#include "points.h"
|
||||||
|
|
||||||
#include "swrast/swrast.h"
|
#include "swrast/swrast.h"
|
||||||
#include "swrast_setup/swrast_setup.h"
|
#include "swrast_setup/swrast_setup.h"
|
||||||
@@ -195,7 +196,6 @@ static const struct tnl_pipeline_stage *intel_pipeline[] = {
|
|||||||
&_tnl_texgen_stage,
|
&_tnl_texgen_stage,
|
||||||
&_tnl_texture_transform_stage,
|
&_tnl_texture_transform_stage,
|
||||||
&_tnl_point_attenuation_stage,
|
&_tnl_point_attenuation_stage,
|
||||||
&_tnl_arb_vertex_program_stage,
|
|
||||||
&_tnl_vertex_program_stage,
|
&_tnl_vertex_program_stage,
|
||||||
#if 1
|
#if 1
|
||||||
&_intel_render_stage, /* ADD: unclipped rastersetup-to-dma */
|
&_intel_render_stage, /* ADD: unclipped rastersetup-to-dma */
|
||||||
@@ -302,6 +302,11 @@ GLboolean intelInitContext( intelContextPtr intel,
|
|||||||
ctx->Const.MaxPointSizeAA = 3.0;
|
ctx->Const.MaxPointSizeAA = 3.0;
|
||||||
ctx->Const.PointSizeGranularity = 1.0;
|
ctx->Const.PointSizeGranularity = 1.0;
|
||||||
|
|
||||||
|
/* reinitialize the context point state.
|
||||||
|
* It depend on constants in __GLcontextRec::Const
|
||||||
|
*/
|
||||||
|
_mesa_init_point(ctx);
|
||||||
|
|
||||||
/* Initialize the software rasterizer and helper modules. */
|
/* Initialize the software rasterizer and helper modules. */
|
||||||
_swrast_CreateContext( ctx );
|
_swrast_CreateContext( ctx );
|
||||||
_vbo_CreateContext( ctx );
|
_vbo_CreateContext( ctx );
|
||||||
@@ -563,7 +568,7 @@ void intelWindowMoved( intelContextPtr intel )
|
|||||||
GLint areaB = driIntersectArea( drw_rect, pipeB_rect );
|
GLint areaB = driIntersectArea( drw_rect, pipeB_rect );
|
||||||
GLuint flags = intel->vblank_flags;
|
GLuint flags = intel->vblank_flags;
|
||||||
|
|
||||||
if (areaB > areaA || (areaA > 0 && areaB > 0)) {
|
if (areaB > areaA || (areaA == areaB && areaB > 0)) {
|
||||||
flags = intel->vblank_flags | VBLANK_FLAG_SECONDARY;
|
flags = intel->vblank_flags | VBLANK_FLAG_SECONDARY;
|
||||||
} else {
|
} else {
|
||||||
flags = intel->vblank_flags & ~VBLANK_FLAG_SECONDARY;
|
flags = intel->vblank_flags & ~VBLANK_FLAG_SECONDARY;
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ i915CreateContext(const __GLcontextModes * mesaVis,
|
|||||||
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
|
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
|
||||||
|
|
||||||
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
||||||
/*ctx->_UseTexEnvProgram = 1;*/
|
ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
|
||||||
|
|
||||||
driInitExtensions(ctx, i915_extensions, GL_FALSE);
|
driInitExtensions(ctx, i915_extensions, GL_FALSE);
|
||||||
|
|
||||||
|
|||||||
@@ -561,9 +561,8 @@ i915_update_fog(GLcontext * ctx)
|
|||||||
GLboolean enabled;
|
GLboolean enabled;
|
||||||
GLboolean try_pixel_fog;
|
GLboolean try_pixel_fog;
|
||||||
|
|
||||||
if (ctx->FragmentProgram._Enabled) {
|
if (ctx->FragmentProgram._Active) {
|
||||||
/* Pull in static fog state from program */
|
/* Pull in static fog state from program */
|
||||||
|
|
||||||
mode = ctx->FragmentProgram._Current->FogOption;
|
mode = ctx->FragmentProgram._Current->FogOption;
|
||||||
enabled = (mode != GL_NONE);
|
enabled = (mode != GL_NONE);
|
||||||
try_pixel_fog = 0;
|
try_pixel_fog = 0;
|
||||||
@@ -571,15 +570,19 @@ i915_update_fog(GLcontext * ctx)
|
|||||||
else {
|
else {
|
||||||
enabled = ctx->Fog.Enabled;
|
enabled = ctx->Fog.Enabled;
|
||||||
mode = ctx->Fog.Mode;
|
mode = ctx->Fog.Mode;
|
||||||
|
#if 0
|
||||||
try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT && ctx->Hint.Fog == GL_NICEST && 0); /* XXX - DISABLE -- Need ortho fallback */
|
/* XXX - DISABLED -- Need ortho fallback */
|
||||||
|
try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT
|
||||||
|
&& ctx->Hint.Fog == GL_NICEST);
|
||||||
|
#else
|
||||||
|
try_pixel_fog = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
i915->vertex_fog = I915_FOG_NONE;
|
i915->vertex_fog = I915_FOG_NONE;
|
||||||
}
|
}
|
||||||
else if (try_pixel_fog) {
|
else if (try_pixel_fog) {
|
||||||
|
|
||||||
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
|
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
|
||||||
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
|
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
|
||||||
i915->vertex_fog = I915_FOG_PIXEL;
|
i915->vertex_fog = I915_FOG_PIXEL;
|
||||||
@@ -591,12 +594,13 @@ i915_update_fog(GLcontext * ctx)
|
|||||||
* either fallback or append fog instructions to end of
|
* either fallback or append fog instructions to end of
|
||||||
* program in the case of linear fog.
|
* program in the case of linear fog.
|
||||||
*/
|
*/
|
||||||
|
printf("vertex fog!\n");
|
||||||
i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX;
|
i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX;
|
||||||
i915->vertex_fog = I915_FOG_VERTEX;
|
i915->vertex_fog = I915_FOG_VERTEX;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GLfloat c1 = ctx->Fog.End / (ctx->Fog.End - ctx->Fog.Start);
|
|
||||||
GLfloat c2 = 1.0 / (ctx->Fog.End - ctx->Fog.Start);
|
GLfloat c2 = 1.0 / (ctx->Fog.End - ctx->Fog.Start);
|
||||||
|
GLfloat c1 = ctx->Fog.End * c2;
|
||||||
|
|
||||||
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_C1_MASK;
|
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_C1_MASK;
|
||||||
i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_LINEAR;
|
i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_LINEAR;
|
||||||
@@ -604,15 +608,11 @@ i915_update_fog(GLcontext * ctx)
|
|||||||
((GLuint) (c1 * FMC1_C1_ONE)) & FMC1_C1_MASK;
|
((GLuint) (c1 * FMC1_C1_ONE)) & FMC1_C1_MASK;
|
||||||
|
|
||||||
if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
|
if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
|
||||||
i915->state.Fog[I915_FOGREG_MODE2] =
|
i915->state.Fog[I915_FOGREG_MODE2]
|
||||||
(GLuint) (c2 * FMC2_C2_ONE);
|
= (GLuint) (c2 * FMC2_C2_ONE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
union
|
fi_type fi;
|
||||||
{
|
|
||||||
float f;
|
|
||||||
int i;
|
|
||||||
} fi;
|
|
||||||
fi.f = c2;
|
fi.f = c2;
|
||||||
i915->state.Fog[I915_FOGREG_MODE2] = fi.i;
|
i915->state.Fog[I915_FOGREG_MODE2] = fi.i;
|
||||||
}
|
}
|
||||||
@@ -628,26 +628,22 @@ i915_update_fog(GLcontext * ctx)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { /* if (i915->vertex_fog != I915_FOG_VERTEX) */
|
else { /* if (i915->vertex_fog != I915_FOG_VERTEX) */
|
||||||
|
|
||||||
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
|
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
|
||||||
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
|
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
|
||||||
i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX;
|
i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX;
|
||||||
i915->vertex_fog = I915_FOG_VERTEX;
|
i915->vertex_fog = I915_FOG_VERTEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
|
||||||
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
|
I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled);
|
||||||
I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled);
|
if (enabled)
|
||||||
if (enabled)
|
i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE;
|
||||||
i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE;
|
else
|
||||||
else
|
i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE;
|
||||||
i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* always enbale pixel fog
|
/* Always enable pixel fog. Vertex fog using fog coord will conflict
|
||||||
* vertex fog use precaculted fog coord will conflict with appended
|
* with fog code appended onto fragment program.
|
||||||
* fog program
|
|
||||||
*/
|
*/
|
||||||
_tnl_allow_vertex_fog( ctx, 0 );
|
_tnl_allow_vertex_fog( ctx, 0 );
|
||||||
_tnl_allow_pixel_fog( ctx, 1 );
|
_tnl_allow_pixel_fog( ctx, 1 );
|
||||||
@@ -669,15 +665,11 @@ i915Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param)
|
|||||||
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
|
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
|
||||||
|
|
||||||
if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
|
if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
|
||||||
i915->state.Fog[I915_FOGREG_MODE3] = (GLuint) (ctx->Fog.Density *
|
i915->state.Fog[I915_FOGREG_MODE3] =
|
||||||
FMC3_D_ONE);
|
(GLuint) (ctx->Fog.Density * FMC3_D_ONE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
union
|
fi_type fi;
|
||||||
{
|
|
||||||
float f;
|
|
||||||
int i;
|
|
||||||
} fi;
|
|
||||||
fi.f = ctx->Fog.Density;
|
fi.f = ctx->Fog.Density;
|
||||||
i915->state.Fog[I915_FOGREG_MODE3] = fi.i;
|
i915->state.Fog[I915_FOGREG_MODE3] = fi.i;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ createBPool(int fd, unsigned long bufSize, unsigned numBufs, unsigned flags,
|
|||||||
_glthread_INIT_MUTEX(p->mutex);
|
_glthread_INIT_MUTEX(p->mutex);
|
||||||
|
|
||||||
if (drmBOCreate(fd, 0, numBufs * bufSize, 0, NULL, drm_bo_type_dc,
|
if (drmBOCreate(fd, 0, numBufs * bufSize, 0, NULL, drm_bo_type_dc,
|
||||||
flags, 0, &p->kernelBO)) {
|
flags, DRM_BO_HINT_DONT_FENCE, &p->kernelBO)) {
|
||||||
free(p->bufs);
|
free(p->bufs);
|
||||||
free(p);
|
free(p);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -76,7 +76,9 @@ intel_bufferobj_release_region(struct intel_context *intel,
|
|||||||
*/
|
*/
|
||||||
driGenBuffers(intel->intelScreen->regionPool,
|
driGenBuffers(intel->intelScreen->regionPool,
|
||||||
"buffer object", 1, &intel_obj->buffer, 64, 0, 0);
|
"buffer object", 1, &intel_obj->buffer, 64, 0, 0);
|
||||||
|
LOCK_HARDWARE(intel);
|
||||||
driBOData(intel_obj->buffer, intel_obj->Base.Size, NULL, 0);
|
driBOData(intel_obj->buffer, intel_obj->Base.Size, NULL, 0);
|
||||||
|
UNLOCK_HARDWARE(intel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Break the COW tie to the region. Both the pbo and the region end
|
/* Break the COW tie to the region. Both the pbo and the region end
|
||||||
@@ -137,7 +139,9 @@ intel_bufferobj_data(GLcontext * ctx,
|
|||||||
if (intel_obj->region)
|
if (intel_obj->region)
|
||||||
intel_bufferobj_release_region(intel, intel_obj);
|
intel_bufferobj_release_region(intel, intel_obj);
|
||||||
|
|
||||||
|
LOCK_HARDWARE(intel);
|
||||||
driBOData(intel_obj->buffer, size, data, 0);
|
driBOData(intel_obj->buffer, size, data, 0);
|
||||||
|
UNLOCK_HARDWARE(intel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include "extensions.h"
|
#include "extensions.h"
|
||||||
#include "framebuffer.h"
|
#include "framebuffer.h"
|
||||||
#include "imports.h"
|
#include "imports.h"
|
||||||
|
#include "points.h"
|
||||||
|
|
||||||
#include "swrast/swrast.h"
|
#include "swrast/swrast.h"
|
||||||
#include "swrast_setup/swrast_setup.h"
|
#include "swrast_setup/swrast_setup.h"
|
||||||
@@ -208,7 +209,6 @@ static const struct tnl_pipeline_stage *intel_pipeline[] = {
|
|||||||
&_tnl_texgen_stage,
|
&_tnl_texgen_stage,
|
||||||
&_tnl_texture_transform_stage,
|
&_tnl_texture_transform_stage,
|
||||||
&_tnl_point_attenuation_stage,
|
&_tnl_point_attenuation_stage,
|
||||||
&_tnl_arb_vertex_program_stage,
|
|
||||||
&_tnl_vertex_program_stage,
|
&_tnl_vertex_program_stage,
|
||||||
#if 1
|
#if 1
|
||||||
&_intel_render_stage, /* ADD: unclipped rastersetup-to-dma */
|
&_intel_render_stage, /* ADD: unclipped rastersetup-to-dma */
|
||||||
@@ -346,7 +346,15 @@ intelInitContext(struct intel_context *intel,
|
|||||||
drmI830Sarea *saPriv = (drmI830Sarea *)
|
drmI830Sarea *saPriv = (drmI830Sarea *)
|
||||||
(((GLubyte *) sPriv->pSAREA) + intelScreen->sarea_priv_offset);
|
(((GLubyte *) sPriv->pSAREA) + intelScreen->sarea_priv_offset);
|
||||||
int fthrottle_mode;
|
int fthrottle_mode;
|
||||||
|
GLboolean havePools;
|
||||||
|
|
||||||
|
DRM_LIGHT_LOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext);
|
||||||
|
havePools = intelCreatePools(intelScreen);
|
||||||
|
DRM_UNLOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext);
|
||||||
|
|
||||||
|
if (!havePools)
|
||||||
|
return GL_FALSE;
|
||||||
|
|
||||||
if (!_mesa_initialize_context(&intel->ctx,
|
if (!_mesa_initialize_context(&intel->ctx,
|
||||||
mesaVis, shareCtx,
|
mesaVis, shareCtx,
|
||||||
functions, (void *) intel))
|
functions, (void *) intel))
|
||||||
@@ -390,6 +398,11 @@ intelInitContext(struct intel_context *intel,
|
|||||||
ctx->Const.MaxPointSizeAA = 3.0;
|
ctx->Const.MaxPointSizeAA = 3.0;
|
||||||
ctx->Const.PointSizeGranularity = 1.0;
|
ctx->Const.PointSizeGranularity = 1.0;
|
||||||
|
|
||||||
|
/* reinitialize the context point state.
|
||||||
|
* It depend on constants in __GLcontextRec::Const
|
||||||
|
*/
|
||||||
|
_mesa_init_point(ctx);
|
||||||
|
|
||||||
ctx->Const.MaxColorAttachments = 4; /* XXX FBO: review this */
|
ctx->Const.MaxColorAttachments = 4; /* XXX FBO: review this */
|
||||||
|
|
||||||
/* Initialize the software rasterizer and helper modules. */
|
/* Initialize the software rasterizer and helper modules. */
|
||||||
@@ -581,10 +594,11 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set GLframebuffer size to match window, if needed */
|
/* set GLframebuffer size to match window, if needed */
|
||||||
if (driReadPriv != driDrawPriv && readFb->Width != driReadPriv->w) {
|
driUpdateFramebufferSize(&intel->ctx, driDrawPriv);
|
||||||
_mesa_resize_framebuffer(&intel->ctx, readFb,
|
|
||||||
driReadPriv->w, driReadPriv->h);
|
if (driReadPriv != driDrawPriv) {
|
||||||
}
|
driUpdateFramebufferSize(&intel->ctx, driReadPriv);
|
||||||
|
}
|
||||||
|
|
||||||
_mesa_make_current(&intel->ctx, &intel_fb->Base, readFb);
|
_mesa_make_current(&intel->ctx, &intel_fb->Base, readFb);
|
||||||
|
|
||||||
|
|||||||
@@ -309,27 +309,39 @@ static GLboolean
|
|||||||
intel_alloc_window_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
|
intel_alloc_window_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
|
||||||
GLenum internalFormat, GLuint width, GLuint height)
|
GLenum internalFormat, GLuint width, GLuint height)
|
||||||
{
|
{
|
||||||
struct intel_context *intel = intel_context(ctx);
|
|
||||||
struct intel_framebuffer *intel_fb;
|
|
||||||
|
|
||||||
ASSERT(rb->Name == 0);
|
ASSERT(rb->Name == 0);
|
||||||
rb->Width = width;
|
rb->Width = width;
|
||||||
rb->Height = height;
|
rb->Height = height;
|
||||||
rb->_ActualFormat = internalFormat;
|
rb->_ActualFormat = internalFormat;
|
||||||
|
|
||||||
if (intel && intel->driDrawable &&
|
|
||||||
(intel_fb = intel->driDrawable->driverPrivate) &&
|
|
||||||
intel_fb->pf_num_pages == 3 &&
|
|
||||||
rb == &intel_fb->color_rb[intel_fb->pf_current_page]->Base &&
|
|
||||||
(rb = &intel_fb->color_rb[(intel_fb->pf_current_page + 2) % 3]->Base)) {
|
|
||||||
rb->Width = width;
|
|
||||||
rb->Height = height;
|
|
||||||
rb->_ActualFormat = internalFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
intel_resize_buffers(GLcontext *ctx, struct gl_framebuffer *fb,
|
||||||
|
GLuint width, GLuint height)
|
||||||
|
{
|
||||||
|
struct intel_framebuffer *intel_fb = (struct intel_framebuffer*)fb;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
_mesa_resize_framebuffer(ctx, fb, width, height);
|
||||||
|
|
||||||
|
fb->Initialized = GL_TRUE; /* XXX remove someday */
|
||||||
|
|
||||||
|
if (fb->Name != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make sure all window system renderbuffers are up to date */
|
||||||
|
for (i = 0; i < 3; i++) {
|
||||||
|
struct gl_renderbuffer *rb = &intel_fb->color_rb[i]->Base;
|
||||||
|
|
||||||
|
/* only resize if size is changing */
|
||||||
|
if (rb && (rb->Width != width || rb->Height != height)) {
|
||||||
|
rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static GLboolean
|
static GLboolean
|
||||||
intel_nop_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
|
intel_nop_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
|
||||||
@@ -508,7 +520,7 @@ intel_framebuffer_renderbuffer(GLcontext * ctx,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When glFramebufferTexture[123]D is called this function sets up the
|
* When glFramebufferTexture[123]D is called this function sets up the
|
||||||
* gl_renderbuffer wrapp around the texture image.
|
* gl_renderbuffer wrapper around the texture image.
|
||||||
* This will have the region info needed for hardware rendering.
|
* This will have the region info needed for hardware rendering.
|
||||||
*/
|
*/
|
||||||
static struct intel_renderbuffer *
|
static struct intel_renderbuffer *
|
||||||
@@ -594,7 +606,7 @@ intel_render_texture(GLcontext * ctx,
|
|||||||
irb = intel_wrap_texture(ctx, newImage);
|
irb = intel_wrap_texture(ctx, newImage);
|
||||||
if (irb) {
|
if (irb) {
|
||||||
/* bind the wrapper to the attachment point */
|
/* bind the wrapper to the attachment point */
|
||||||
att->Renderbuffer = &irb->Base;
|
_mesa_reference_renderbuffer(&att->Renderbuffer, &irb->Base);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* fallback to software rendering */
|
/* fallback to software rendering */
|
||||||
@@ -671,4 +683,5 @@ intel_fbo_init(struct intel_context *intel)
|
|||||||
intel->ctx.Driver.FramebufferRenderbuffer = intel_framebuffer_renderbuffer;
|
intel->ctx.Driver.FramebufferRenderbuffer = intel_framebuffer_renderbuffer;
|
||||||
intel->ctx.Driver.RenderTexture = intel_render_texture;
|
intel->ctx.Driver.RenderTexture = intel_render_texture;
|
||||||
intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture;
|
intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture;
|
||||||
|
intel->ctx.Driver.ResizeBuffers = intel_resize_buffers;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ intel_miptree_image_data(struct intel_context *intel,
|
|||||||
0, 0, /* source x, y */
|
0, 0, /* source x, y */
|
||||||
dst->level[level].width, height); /* width, height */
|
dst->level[level].width, height); /* width, height */
|
||||||
|
|
||||||
src += src_image_pitch;
|
src += src_image_pitch * dst->cpp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ intel_region_alloc(intelScreenPrivate *intelScreen,
|
|||||||
GLuint cpp, GLuint pitch, GLuint height)
|
GLuint cpp, GLuint pitch, GLuint height)
|
||||||
{
|
{
|
||||||
struct intel_region *region = calloc(sizeof(*region), 1);
|
struct intel_region *region = calloc(sizeof(*region), 1);
|
||||||
|
struct intel_context *intel = intelScreenContext(intelScreen);
|
||||||
|
|
||||||
DBG("%s\n", __FUNCTION__);
|
DBG("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
@@ -107,7 +108,9 @@ intel_region_alloc(intelScreenPrivate *intelScreen,
|
|||||||
0,
|
0,
|
||||||
#endif
|
#endif
|
||||||
0);
|
0);
|
||||||
|
LOCK_HARDWARE(intel);
|
||||||
driBOData(region->buffer, pitch * cpp * height, NULL, 0);
|
driBOData(region->buffer, pitch * cpp * height, NULL, 0);
|
||||||
|
UNLOCK_HARDWARE(intel);
|
||||||
return region;
|
return region;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -392,6 +395,8 @@ void
|
|||||||
intel_region_release_pbo(intelScreenPrivate *intelScreen,
|
intel_region_release_pbo(intelScreenPrivate *intelScreen,
|
||||||
struct intel_region *region)
|
struct intel_region *region)
|
||||||
{
|
{
|
||||||
|
struct intel_context *intel = intelScreenContext(intelScreen);
|
||||||
|
|
||||||
assert(region->buffer == region->pbo->buffer);
|
assert(region->buffer == region->pbo->buffer);
|
||||||
region->pbo->region = NULL;
|
region->pbo->region = NULL;
|
||||||
region->pbo = NULL;
|
region->pbo = NULL;
|
||||||
@@ -400,8 +405,11 @@ intel_region_release_pbo(intelScreenPrivate *intelScreen,
|
|||||||
|
|
||||||
driGenBuffers(intelScreen->regionPool,
|
driGenBuffers(intelScreen->regionPool,
|
||||||
"region", 1, ®ion->buffer, 64, 0, 0);
|
"region", 1, ®ion->buffer, 64, 0, 0);
|
||||||
|
|
||||||
|
LOCK_HARDWARE(intel);
|
||||||
driBOData(region->buffer,
|
driBOData(region->buffer,
|
||||||
region->cpp * region->pitch * region->height, NULL, 0);
|
region->cpp * region->pitch * region->height, NULL, 0);
|
||||||
|
UNLOCK_HARDWARE(intel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Break the COW tie to the pbo. Both the pbo and the region end up
|
/* Break the COW tie to the pbo. Both the pbo and the region end up
|
||||||
|
|||||||
@@ -386,6 +386,45 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen,
|
|||||||
intelPrintSAREA(sarea);
|
intelPrintSAREA(sarea);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GLboolean
|
||||||
|
intelCreatePools(intelScreenPrivate *intelScreen)
|
||||||
|
{
|
||||||
|
unsigned batchPoolSize = 1024*1024;
|
||||||
|
__DRIscreenPrivate * sPriv = intelScreen->driScrnPriv;
|
||||||
|
|
||||||
|
if (intelScreen->havePools)
|
||||||
|
return GL_TRUE;
|
||||||
|
|
||||||
|
batchPoolSize /= intelScreen->maxBatchSize;
|
||||||
|
intelScreen->regionPool = driDRMPoolInit(sPriv->fd);
|
||||||
|
|
||||||
|
if (!intelScreen->regionPool)
|
||||||
|
return GL_FALSE;
|
||||||
|
|
||||||
|
intelScreen->staticPool = driDRMStaticPoolInit(sPriv->fd);
|
||||||
|
|
||||||
|
if (!intelScreen->staticPool)
|
||||||
|
return GL_FALSE;
|
||||||
|
|
||||||
|
intelScreen->texPool = intelScreen->regionPool;
|
||||||
|
|
||||||
|
intelScreen->batchPool = driBatchPoolInit(sPriv->fd,
|
||||||
|
DRM_BO_FLAG_EXE |
|
||||||
|
DRM_BO_FLAG_MEM_TT |
|
||||||
|
DRM_BO_FLAG_MEM_LOCAL,
|
||||||
|
intelScreen->maxBatchSize,
|
||||||
|
batchPoolSize, 5);
|
||||||
|
if (!intelScreen->batchPool) {
|
||||||
|
fprintf(stderr, "Failed to initialize batch pool - possible incorrect agpgart installed\n");
|
||||||
|
return GL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
intel_recreate_static_regions(intelScreen);
|
||||||
|
intelScreen->havePools = GL_TRUE;
|
||||||
|
|
||||||
|
return GL_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static GLboolean
|
static GLboolean
|
||||||
intelInitDriver(__DRIscreenPrivate * sPriv)
|
intelInitDriver(__DRIscreenPrivate * sPriv)
|
||||||
@@ -393,7 +432,6 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
|
|||||||
intelScreenPrivate *intelScreen;
|
intelScreenPrivate *intelScreen;
|
||||||
I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
|
I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
|
||||||
drmI830Sarea *sarea;
|
drmI830Sarea *sarea;
|
||||||
unsigned batchPoolSize = 1024*1024;
|
|
||||||
|
|
||||||
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
|
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
|
||||||
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->
|
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->
|
||||||
@@ -426,7 +464,6 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
|
|||||||
intelScreen->deviceID = gDRIPriv->deviceID;
|
intelScreen->deviceID = gDRIPriv->deviceID;
|
||||||
if (intelScreen->deviceID == PCI_CHIP_I865_G)
|
if (intelScreen->deviceID == PCI_CHIP_I865_G)
|
||||||
intelScreen->maxBatchSize = 4096;
|
intelScreen->maxBatchSize = 4096;
|
||||||
batchPoolSize /= intelScreen->maxBatchSize;
|
|
||||||
|
|
||||||
intelScreen->mem = gDRIPriv->mem;
|
intelScreen->mem = gDRIPriv->mem;
|
||||||
intelScreen->cpp = gDRIPriv->cpp;
|
intelScreen->cpp = gDRIPriv->cpp;
|
||||||
@@ -517,31 +554,6 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
|
|||||||
(*glx_enable_extension) (psc, "GLX_SGI_make_current_read");
|
(*glx_enable_extension) (psc, "GLX_SGI_make_current_read");
|
||||||
}
|
}
|
||||||
|
|
||||||
intelScreen->regionPool = driDRMPoolInit(sPriv->fd);
|
|
||||||
|
|
||||||
if (!intelScreen->regionPool)
|
|
||||||
return GL_FALSE;
|
|
||||||
|
|
||||||
intelScreen->staticPool = driDRMStaticPoolInit(sPriv->fd);
|
|
||||||
|
|
||||||
if (!intelScreen->staticPool)
|
|
||||||
return GL_FALSE;
|
|
||||||
|
|
||||||
intelScreen->texPool = intelScreen->regionPool;
|
|
||||||
|
|
||||||
intelScreen->batchPool = driBatchPoolInit(sPriv->fd,
|
|
||||||
DRM_BO_FLAG_EXE |
|
|
||||||
DRM_BO_FLAG_MEM_TT |
|
|
||||||
DRM_BO_FLAG_MEM_LOCAL,
|
|
||||||
intelScreen->maxBatchSize,
|
|
||||||
batchPoolSize, 5);
|
|
||||||
if (!intelScreen->batchPool) {
|
|
||||||
fprintf(stderr, "Failed to initialize batch pool - possible incorrect agpgart installed\n");
|
|
||||||
return GL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
intel_recreate_static_regions(intelScreen);
|
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -553,9 +565,11 @@ intelDestroyScreen(__DRIscreenPrivate * sPriv)
|
|||||||
|
|
||||||
intelUnmapScreenRegions(intelScreen);
|
intelUnmapScreenRegions(intelScreen);
|
||||||
|
|
||||||
driPoolTakeDown(intelScreen->regionPool);
|
if (intelScreen->havePools) {
|
||||||
driPoolTakeDown(intelScreen->staticPool);
|
driPoolTakeDown(intelScreen->regionPool);
|
||||||
driPoolTakeDown(intelScreen->batchPool);
|
driPoolTakeDown(intelScreen->staticPool);
|
||||||
|
driPoolTakeDown(intelScreen->batchPool);
|
||||||
|
}
|
||||||
FREE(intelScreen);
|
FREE(intelScreen);
|
||||||
sPriv->private = NULL;
|
sPriv->private = NULL;
|
||||||
}
|
}
|
||||||
@@ -892,6 +906,7 @@ __driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn,
|
|||||||
ddx_version, dri_version, drm_version,
|
ddx_version, dri_version, drm_version,
|
||||||
frame_buffer, pSAREA, fd,
|
frame_buffer, pSAREA, fd,
|
||||||
internal_api_version, &intelAPI);
|
internal_api_version, &intelAPI);
|
||||||
|
|
||||||
if (psp != NULL) {
|
if (psp != NULL) {
|
||||||
I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
|
I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
|
||||||
*driver_modes = intelFillInModes(dri_priv->cpp * 8,
|
*driver_modes = intelFillInModes(dri_priv->cpp * 8,
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ typedef struct
|
|||||||
struct _DriBufferPool *regionPool;
|
struct _DriBufferPool *regionPool;
|
||||||
struct _DriBufferPool *staticPool;
|
struct _DriBufferPool *staticPool;
|
||||||
unsigned int maxBatchSize;
|
unsigned int maxBatchSize;
|
||||||
|
GLboolean havePools;
|
||||||
} intelScreenPrivate;
|
} intelScreenPrivate;
|
||||||
|
|
||||||
|
|
||||||
@@ -130,5 +131,7 @@ extern struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen)
|
|||||||
|
|
||||||
extern void
|
extern void
|
||||||
intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea);
|
intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea);
|
||||||
|
extern GLboolean
|
||||||
|
intelCreatePools(intelScreenPrivate *intelScreen);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -329,25 +329,7 @@ intelTexImage(GLcontext * ctx,
|
|||||||
texImage->TexFormat = intelChooseTextureFormat(ctx, internalFormat,
|
texImage->TexFormat = intelChooseTextureFormat(ctx, internalFormat,
|
||||||
format, type);
|
format, type);
|
||||||
|
|
||||||
assert(texImage->TexFormat);
|
_mesa_set_fetch_functions(texImage, dims);
|
||||||
|
|
||||||
switch (dims) {
|
|
||||||
case 1:
|
|
||||||
texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D;
|
|
||||||
texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D;
|
|
||||||
texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
texImage->FetchTexelc = texImage->TexFormat->FetchTexel3D;
|
|
||||||
texImage->FetchTexelf = texImage->TexFormat->FetchTexel3Df;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
assert(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (texImage->TexFormat->TexelBytes == 0) {
|
if (texImage->TexFormat->TexelBytes == 0) {
|
||||||
/* must be a compressed format */
|
/* must be a compressed format */
|
||||||
@@ -632,6 +614,7 @@ intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
|
|||||||
intelImage->level,
|
intelImage->level,
|
||||||
&intelImage->base.RowStride,
|
&intelImage->base.RowStride,
|
||||||
intelImage->base.ImageOffsets);
|
intelImage->base.ImageOffsets);
|
||||||
|
intelImage->base.RowStride /= intelImage->mt->cpp;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Otherwise, the image should actually be stored in
|
/* Otherwise, the image should actually be stored in
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
* Keith Whitwell <keith@tungstengraphics.com>
|
* Keith Whitwell <keith@tungstengraphics.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "shader/prog_parameter.h"
|
||||||
#include "brw_context.h"
|
#include "brw_context.h"
|
||||||
#include "brw_aub.h"
|
#include "brw_aub.h"
|
||||||
#include "brw_util.h"
|
#include "brw_util.h"
|
||||||
|
|||||||
@@ -115,6 +115,9 @@ static const GLubyte *intelGetString( GLcontext *ctx, GLenum name )
|
|||||||
case PCI_CHIP_I946_GZ:
|
case PCI_CHIP_I946_GZ:
|
||||||
chipset = "Intel(R) 946GZ"; break;
|
chipset = "Intel(R) 946GZ"; break;
|
||||||
break;
|
break;
|
||||||
|
case PCI_CHIP_I965_GM:
|
||||||
|
chipset = "Intel(R) 965GM"; break;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
chipset = "Unknown Intel Chipset"; break;
|
chipset = "Unknown Intel Chipset"; break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -384,6 +384,7 @@ extern int INTEL_DEBUG;
|
|||||||
#define PCI_CHIP_I965_Q 0x2992
|
#define PCI_CHIP_I965_Q 0x2992
|
||||||
#define PCI_CHIP_I965_G_1 0x2982
|
#define PCI_CHIP_I965_G_1 0x2982
|
||||||
#define PCI_CHIP_I946_GZ 0x2972
|
#define PCI_CHIP_I946_GZ 0x2972
|
||||||
|
#define PCI_CHIP_I965_GM 0x2A02
|
||||||
|
|
||||||
|
|
||||||
/* ================================================================
|
/* ================================================================
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ void TAG(translate_vertex)(GLcontext *ctx,
|
|||||||
dst->specular[2] = ((GLubyte *)p)[0];
|
dst->specular[2] = ((GLubyte *)p)[0];
|
||||||
dst->specular[1] = ((GLubyte *)p)[1];
|
dst->specular[1] = ((GLubyte *)p)[1];
|
||||||
dst->specular[0] = ((GLubyte *)p)[2];
|
dst->specular[0] = ((GLubyte *)p)[2];
|
||||||
dst->fog = ((GLubyte *)p)[3];
|
dst->attrib[FRAG_ATTRIB_FOGC][0] = ((GLubyte *)p)[3];
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
case TINY_VERTEX_FORMAT:
|
case TINY_VERTEX_FORMAT:
|
||||||
|
|||||||
@@ -372,7 +372,6 @@ static const struct tnl_pipeline_stage *mga_pipeline[] = {
|
|||||||
&_tnl_fog_coordinate_stage,
|
&_tnl_fog_coordinate_stage,
|
||||||
&_tnl_texgen_stage,
|
&_tnl_texgen_stage,
|
||||||
&_tnl_texture_transform_stage,
|
&_tnl_texture_transform_stage,
|
||||||
&_tnl_arb_vertex_program_stage,
|
|
||||||
&_tnl_vertex_program_stage,
|
&_tnl_vertex_program_stage,
|
||||||
|
|
||||||
/* REMOVE: point attenuation stage */
|
/* REMOVE: point attenuation stage */
|
||||||
@@ -910,6 +909,7 @@ void mgaGetLock( mgaContextPtr mmesa, GLuint flags )
|
|||||||
|
|
||||||
drmGetLock(mmesa->driFd, mmesa->hHWContext, flags);
|
drmGetLock(mmesa->driFd, mmesa->hHWContext, flags);
|
||||||
|
|
||||||
|
DRI_VALIDATE_DRAWABLE_INFO( mmesa->driScreen, dPriv );
|
||||||
if (*(dPriv->pStamp) != mmesa->lastStamp) {
|
if (*(dPriv->pStamp) != mmesa->lastStamp) {
|
||||||
mmesa->lastStamp = *(dPriv->pStamp);
|
mmesa->lastStamp = *(dPriv->pStamp);
|
||||||
mmesa->SetupNewInputs |= VERT_BIT_POS;
|
mmesa->SetupNewInputs |= VERT_BIT_POS;
|
||||||
@@ -920,7 +920,7 @@ void mgaGetLock( mgaContextPtr mmesa, GLuint flags )
|
|||||||
|
|
||||||
mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_CLIPRECTS;
|
mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_CLIPRECTS;
|
||||||
|
|
||||||
mmesa->sarea->dirty |= MGA_UPLOAD_CONTEXT;
|
mmesa->sarea->dirty |= MGA_UPLOAD_CONTEXT;
|
||||||
|
|
||||||
if (sarea->ctxOwner != me) {
|
if (sarea->ctxOwner != me) {
|
||||||
mmesa->dirty |= (MGA_UPLOAD_CONTEXT | MGA_UPLOAD_TEX0 |
|
mmesa->dirty |= (MGA_UPLOAD_CONTEXT | MGA_UPLOAD_TEX0 |
|
||||||
|
|||||||
@@ -52,8 +52,10 @@ static void
|
|||||||
r128UpdatePageFlipping( r128ContextPtr rmesa )
|
r128UpdatePageFlipping( r128ContextPtr rmesa )
|
||||||
{
|
{
|
||||||
rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip;
|
rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip;
|
||||||
driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
|
if (rmesa->glCtx->WinSysDrawBuffer) {
|
||||||
rmesa->sarea->pfCurrentPage);
|
driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
|
||||||
|
rmesa->sarea->pfCurrentPage);
|
||||||
|
}
|
||||||
rmesa->new_state |= R128_NEW_WINDOW;
|
rmesa->new_state |= R128_NEW_WINDOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -605,9 +605,9 @@ static void r128RenderStart( GLcontext *ctx )
|
|||||||
* build up a hardware vertex.
|
* build up a hardware vertex.
|
||||||
*/
|
*/
|
||||||
if (RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX ))
|
if (RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX ))
|
||||||
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, R128_CCE_VC_FRMT_RHW, 16 );
|
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, R128_CCE_VC_FRMT_RHW, 4 );
|
||||||
else
|
else
|
||||||
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, 0, 12 );
|
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, 0, 3 );
|
||||||
|
|
||||||
rmesa->coloroffset = offset;
|
rmesa->coloroffset = offset;
|
||||||
#if MESA_LITTLE_ENDIAN
|
#if MESA_LITTLE_ENDIAN
|
||||||
|
|||||||
@@ -192,7 +192,6 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = {
|
|||||||
&_tnl_texgen_stage,
|
&_tnl_texgen_stage,
|
||||||
&_tnl_texture_transform_stage,
|
&_tnl_texture_transform_stage,
|
||||||
&_tnl_point_attenuation_stage,
|
&_tnl_point_attenuation_stage,
|
||||||
&_tnl_arb_vertex_program_stage,
|
|
||||||
&_tnl_vertex_program_stage,
|
&_tnl_vertex_program_stage,
|
||||||
/* Try again to go to tcl?
|
/* Try again to go to tcl?
|
||||||
* - no good for asymmetric-twoside (do with multipass)
|
* - no good for asymmetric-twoside (do with multipass)
|
||||||
|
|||||||
@@ -53,8 +53,10 @@ static void
|
|||||||
r200UpdatePageFlipping( r200ContextPtr rmesa )
|
r200UpdatePageFlipping( r200ContextPtr rmesa )
|
||||||
{
|
{
|
||||||
rmesa->doPageFlip = rmesa->sarea->pfState;
|
rmesa->doPageFlip = rmesa->sarea->pfState;
|
||||||
driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
|
if (rmesa->glCtx->WinSysDrawBuffer) {
|
||||||
rmesa->sarea->pfCurrentPage);
|
driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
|
||||||
|
rmesa->sarea->pfCurrentPage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -281,7 +281,11 @@ CHECK( vpu, vpu_count(atom->cmd) ? (1 + vpu_count(atom->cmd)*4) : 0 )
|
|||||||
void r300InitCmdBuf(r300ContextPtr r300)
|
void r300InitCmdBuf(r300ContextPtr r300)
|
||||||
{
|
{
|
||||||
int size, mtu;
|
int size, mtu;
|
||||||
|
int has_tcl = 1;
|
||||||
|
|
||||||
|
if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL))
|
||||||
|
has_tcl = 0;
|
||||||
|
|
||||||
r300->hw.max_state_size = 2+2; /* reserve extra space for WAIT_IDLE and tex cache flush */
|
r300->hw.max_state_size = 2+2; /* reserve extra space for WAIT_IDLE and tex cache flush */
|
||||||
|
|
||||||
mtu = r300->radeon.glCtx->Const.MaxTextureUnits;
|
mtu = r300->radeon.glCtx->Const.MaxTextureUnits;
|
||||||
@@ -291,33 +295,37 @@ void r300InitCmdBuf(r300ContextPtr r300)
|
|||||||
|
|
||||||
/* Initialize state atoms */
|
/* Initialize state atoms */
|
||||||
ALLOC_STATE( vpt, always, R300_VPT_CMDSIZE, "vpt", 0 );
|
ALLOC_STATE( vpt, always, R300_VPT_CMDSIZE, "vpt", 0 );
|
||||||
r300->hw.vpt.cmd[R300_VPT_CMD_0] = cmdpacket0(R300_SE_VPORT_XSCALE, 6);
|
r300->hw.vpt.cmd[R300_VPT_CMD_0] = cmdpacket0(R300_SE_VPORT_XSCALE, 6);
|
||||||
ALLOC_STATE( vap_cntl, always, 2, "vap_cntl", 0 );
|
ALLOC_STATE( vap_cntl, always, 2, "vap_cntl", 0 );
|
||||||
r300->hw.vap_cntl.cmd[0] = cmdpacket0(R300_VAP_CNTL, 1);
|
r300->hw.vap_cntl.cmd[0] = cmdpacket0(R300_VAP_CNTL, 1);
|
||||||
ALLOC_STATE( vte, always, 3, "vte", 0 );
|
ALLOC_STATE( vte, always, 3, "vte", 0 );
|
||||||
r300->hw.vte.cmd[0] = cmdpacket0(R300_SE_VTE_CNTL, 2);
|
r300->hw.vte.cmd[0] = cmdpacket0(R300_SE_VTE_CNTL, 2);
|
||||||
ALLOC_STATE( unk2134, always, 3, "unk2134", 0 );
|
ALLOC_STATE( unk2134, always, 3, "unk2134", 0 );
|
||||||
r300->hw.unk2134.cmd[0] = cmdpacket0(0x2134, 2);
|
r300->hw.unk2134.cmd[0] = cmdpacket0(0x2134, 2);
|
||||||
ALLOC_STATE( vap_cntl_status, always, 2, "vap_cntl_status", 0 );
|
ALLOC_STATE( vap_cntl_status, always, 2, "vap_cntl_status", 0 );
|
||||||
r300->hw.vap_cntl_status.cmd[0] = cmdpacket0(R300_VAP_CNTL_STATUS, 1);
|
r300->hw.vap_cntl_status.cmd[0] = cmdpacket0(R300_VAP_CNTL_STATUS, 1);
|
||||||
ALLOC_STATE( vir[0], variable, R300_VIR_CMDSIZE, "vir/0", 0 );
|
ALLOC_STATE( vir[0], variable, R300_VIR_CMDSIZE, "vir/0", 0 );
|
||||||
r300->hw.vir[0].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_0_0, 1);
|
r300->hw.vir[0].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_0_0, 1);
|
||||||
ALLOC_STATE( vir[1], variable, R300_VIR_CMDSIZE, "vir/1", 1 );
|
ALLOC_STATE( vir[1], variable, R300_VIR_CMDSIZE, "vir/1", 1 );
|
||||||
r300->hw.vir[1].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_1_0, 1);
|
r300->hw.vir[1].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_1_0, 1);
|
||||||
ALLOC_STATE( vic, always, R300_VIC_CMDSIZE, "vic", 0 );
|
ALLOC_STATE( vic, always, R300_VIC_CMDSIZE, "vic", 0 );
|
||||||
r300->hw.vic.cmd[R300_VIC_CMD_0] = cmdpacket0(R300_VAP_INPUT_CNTL_0, 2);
|
r300->hw.vic.cmd[R300_VIC_CMD_0] = cmdpacket0(R300_VAP_INPUT_CNTL_0, 2);
|
||||||
ALLOC_STATE( unk21DC, always, 2, "unk21DC", 0 );
|
ALLOC_STATE( unk21DC, always, 2, "unk21DC", 0 );
|
||||||
r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1);
|
r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1);
|
||||||
ALLOC_STATE( unk221C, always, 2, "unk221C", 0 );
|
ALLOC_STATE( unk221C, always, 2, "unk221C", 0 );
|
||||||
r300->hw.unk221C.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_221C, 1);
|
r300->hw.unk221C.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_221C, 1);
|
||||||
ALLOC_STATE( unk2220, always, 5, "unk2220", 0 );
|
ALLOC_STATE( unk2220, always, 5, "unk2220", 0 );
|
||||||
r300->hw.unk2220.cmd[0] = cmdpacket0(0x2220, 4);
|
r300->hw.unk2220.cmd[0] = cmdpacket0(0x2220, 4);
|
||||||
ALLOC_STATE( unk2288, always, 2, "unk2288", 0 );
|
ALLOC_STATE( unk2288, always, 2, "unk2288", 0 );
|
||||||
r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1);
|
r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1);
|
||||||
ALLOC_STATE( vof, always, R300_VOF_CMDSIZE, "vof", 0 );
|
ALLOC_STATE( vof, always, R300_VOF_CMDSIZE, "vof", 0 );
|
||||||
r300->hw.vof.cmd[R300_VOF_CMD_0] = cmdpacket0(R300_VAP_OUTPUT_VTX_FMT_0, 2);
|
r300->hw.vof.cmd[R300_VOF_CMD_0] = cmdpacket0(R300_VAP_OUTPUT_VTX_FMT_0, 2);
|
||||||
ALLOC_STATE( pvs, always, R300_PVS_CMDSIZE, "pvs", 0 );
|
|
||||||
r300->hw.pvs.cmd[R300_PVS_CMD_0] = cmdpacket0(R300_VAP_PVS_CNTL_1, 3);
|
if (has_tcl) {
|
||||||
|
ALLOC_STATE( pvs, always, R300_PVS_CMDSIZE, "pvs", 0 );
|
||||||
|
r300->hw.pvs.cmd[R300_PVS_CMD_0] = cmdpacket0(R300_VAP_PVS_CNTL_1, 3);
|
||||||
|
}
|
||||||
|
|
||||||
ALLOC_STATE( gb_enable, always, 2, "gb_enable", 0 );
|
ALLOC_STATE( gb_enable, always, 2, "gb_enable", 0 );
|
||||||
r300->hw.gb_enable.cmd[0] = cmdpacket0(R300_GB_ENABLE, 1);
|
r300->hw.gb_enable.cmd[0] = cmdpacket0(R300_GB_ENABLE, 1);
|
||||||
ALLOC_STATE( gb_misc, always, R300_GB_MISC_CMDSIZE, "gb_misc", 0 );
|
ALLOC_STATE( gb_misc, always, R300_GB_MISC_CMDSIZE, "gb_misc", 0 );
|
||||||
@@ -407,51 +415,54 @@ void r300InitCmdBuf(r300ContextPtr r300)
|
|||||||
ALLOC_STATE( zs, always, R300_ZS_CMDSIZE, "zstencil", 0 );
|
ALLOC_STATE( zs, always, R300_ZS_CMDSIZE, "zstencil", 0 );
|
||||||
r300->hw.zs.cmd[R300_ZS_CMD_0] = cmdpacket0(R300_RB3D_ZSTENCIL_CNTL_0, 3);
|
r300->hw.zs.cmd[R300_ZS_CMD_0] = cmdpacket0(R300_RB3D_ZSTENCIL_CNTL_0, 3);
|
||||||
ALLOC_STATE( zstencil_format, always, 5, "zstencil_format", 0 );
|
ALLOC_STATE( zstencil_format, always, 5, "zstencil_format", 0 );
|
||||||
r300->hw.zstencil_format.cmd[0] = cmdpacket0(R300_RB3D_ZSTENCIL_FORMAT, 4);
|
r300->hw.zstencil_format.cmd[0] = cmdpacket0(R300_RB3D_ZSTENCIL_FORMAT, 4);
|
||||||
ALLOC_STATE( zb, always, R300_ZB_CMDSIZE, "zb", 0 );
|
ALLOC_STATE( zb, always, R300_ZB_CMDSIZE, "zb", 0 );
|
||||||
r300->hw.zb.cmd[R300_ZB_CMD_0] = cmdpacket0(R300_RB3D_DEPTHOFFSET, 2);
|
r300->hw.zb.cmd[R300_ZB_CMD_0] = cmdpacket0(R300_RB3D_DEPTHOFFSET, 2);
|
||||||
ALLOC_STATE( unk4F28, always, 2, "unk4F28", 0 );
|
ALLOC_STATE( unk4F28, always, 2, "unk4F28", 0 );
|
||||||
r300->hw.unk4F28.cmd[0] = cmdpacket0(0x4F28, 1);
|
r300->hw.unk4F28.cmd[0] = cmdpacket0(0x4F28, 1);
|
||||||
ALLOC_STATE( unk4F30, always, 3, "unk4F30", 0 );
|
ALLOC_STATE( unk4F30, always, 3, "unk4F30", 0 );
|
||||||
r300->hw.unk4F30.cmd[0] = cmdpacket0(0x4F30, 2);
|
r300->hw.unk4F30.cmd[0] = cmdpacket0(0x4F30, 2);
|
||||||
ALLOC_STATE( unk4F44, always, 2, "unk4F44", 0 );
|
ALLOC_STATE( unk4F44, always, 2, "unk4F44", 0 );
|
||||||
r300->hw.unk4F44.cmd[0] = cmdpacket0(0x4F44, 1);
|
r300->hw.unk4F44.cmd[0] = cmdpacket0(0x4F44, 1);
|
||||||
ALLOC_STATE( unk4F54, always, 2, "unk4F54", 0 );
|
ALLOC_STATE( unk4F54, always, 2, "unk4F54", 0 );
|
||||||
r300->hw.unk4F54.cmd[0] = cmdpacket0(0x4F54, 1);
|
r300->hw.unk4F54.cmd[0] = cmdpacket0(0x4F54, 1);
|
||||||
|
|
||||||
ALLOC_STATE( vpi, vpu, R300_VPI_CMDSIZE, "vpi", 0 );
|
/* VPU only on TCL */
|
||||||
r300->hw.vpi.cmd[R300_VPI_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PROGRAM, 0);
|
if (has_tcl) {
|
||||||
ALLOC_STATE( vpp, vpu, R300_VPP_CMDSIZE, "vpp", 0 );
|
ALLOC_STATE( vpi, vpu, R300_VPI_CMDSIZE, "vpi", 0 );
|
||||||
r300->hw.vpp.cmd[R300_VPP_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PARAMETERS, 0);
|
r300->hw.vpi.cmd[R300_VPI_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PROGRAM, 0);
|
||||||
ALLOC_STATE( vps, vpu, R300_VPS_CMDSIZE, "vps", 0 );
|
ALLOC_STATE( vpp, vpu, R300_VPP_CMDSIZE, "vpp", 0 );
|
||||||
r300->hw.vps.cmd[R300_VPS_CMD_0] = cmdvpu(R300_PVS_UPLOAD_POINTSIZE, 1);
|
r300->hw.vpp.cmd[R300_VPP_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PARAMETERS, 0);
|
||||||
|
ALLOC_STATE( vps, vpu, R300_VPS_CMDSIZE, "vps", 0 );
|
||||||
|
r300->hw.vps.cmd[R300_VPS_CMD_0] = cmdvpu(R300_PVS_UPLOAD_POINTSIZE, 1);
|
||||||
|
}
|
||||||
|
|
||||||
/* Textures */
|
/* Textures */
|
||||||
ALLOC_STATE( tex.filter, variable, mtu+1, "tex_filter", 0 );
|
ALLOC_STATE( tex.filter, variable, mtu+1, "tex_filter", 0 );
|
||||||
r300->hw.tex.filter.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER_0, 0);
|
r300->hw.tex.filter.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER_0, 0);
|
||||||
|
|
||||||
ALLOC_STATE( tex.filter_1, variable, mtu+1, "tex_filter_1", 0 );
|
ALLOC_STATE( tex.filter_1, variable, mtu+1, "tex_filter_1", 0 );
|
||||||
r300->hw.tex.filter_1.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER1_0, 0);
|
r300->hw.tex.filter_1.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER1_0, 0);
|
||||||
|
|
||||||
ALLOC_STATE( tex.size, variable, mtu+1, "tex_size", 0 );
|
ALLOC_STATE( tex.size, variable, mtu+1, "tex_size", 0 );
|
||||||
r300->hw.tex.size.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_SIZE_0, 0);
|
r300->hw.tex.size.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_SIZE_0, 0);
|
||||||
|
|
||||||
ALLOC_STATE( tex.format, variable, mtu+1, "tex_format", 0 );
|
ALLOC_STATE( tex.format, variable, mtu+1, "tex_format", 0 );
|
||||||
r300->hw.tex.format.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FORMAT_0, 0);
|
r300->hw.tex.format.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FORMAT_0, 0);
|
||||||
|
|
||||||
ALLOC_STATE( tex.pitch, variable, mtu+1, "tex_pitch", 0 );
|
ALLOC_STATE( tex.pitch, variable, mtu+1, "tex_pitch", 0 );
|
||||||
r300->hw.tex.pitch.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_PITCH_0, 0);
|
r300->hw.tex.pitch.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_PITCH_0, 0);
|
||||||
|
|
||||||
ALLOC_STATE( tex.offset, variable, mtu+1, "tex_offset", 0 );
|
ALLOC_STATE( tex.offset, variable, mtu+1, "tex_offset", 0 );
|
||||||
r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_OFFSET_0, 0);
|
r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_OFFSET_0, 0);
|
||||||
|
|
||||||
ALLOC_STATE( tex.chroma_key, variable, mtu+1, "tex_chroma_key", 0 );
|
ALLOC_STATE( tex.chroma_key, variable, mtu+1, "tex_chroma_key", 0 );
|
||||||
r300->hw.tex.chroma_key.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_CHROMA_KEY_0, 0);
|
r300->hw.tex.chroma_key.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_CHROMA_KEY_0, 0);
|
||||||
|
|
||||||
ALLOC_STATE( tex.border_color, variable, mtu+1, "tex_border_color", 0 );
|
ALLOC_STATE( tex.border_color, variable, mtu+1, "tex_border_color", 0 );
|
||||||
r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_BORDER_COLOR_0, 0);
|
r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_BORDER_COLOR_0, 0);
|
||||||
|
|
||||||
|
|
||||||
/* Setup the atom linked list */
|
/* Setup the atom linked list */
|
||||||
make_empty_list(&r300->hw.atomlist);
|
make_empty_list(&r300->hw.atomlist);
|
||||||
r300->hw.atomlist.name = "atom-list";
|
r300->hw.atomlist.name = "atom-list";
|
||||||
@@ -469,7 +480,9 @@ void r300InitCmdBuf(r300ContextPtr r300)
|
|||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2220);
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2220);
|
||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2288);
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2288);
|
||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.vof);
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.vof);
|
||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.pvs);
|
|
||||||
|
if (has_tcl)
|
||||||
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.pvs);
|
||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.gb_enable);
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.gb_enable);
|
||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.gb_misc);
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.gb_misc);
|
||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.txe);
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.txe);
|
||||||
@@ -520,9 +533,11 @@ void r300InitCmdBuf(r300ContextPtr r300)
|
|||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F44);
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F44);
|
||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F54);
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F54);
|
||||||
|
|
||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.vpi);
|
if (has_tcl) {
|
||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.vpp);
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.vpi);
|
||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.vps);
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.vpp);
|
||||||
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.vps);
|
||||||
|
}
|
||||||
|
|
||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.filter);
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.filter);
|
||||||
insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.filter_1);
|
insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.filter_1);
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ const struct dri_extension card_extensions[] = {
|
|||||||
// {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
|
// {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
|
||||||
{"GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions},
|
{"GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions},
|
||||||
{"GL_EXT_secondary_color", GL_EXT_secondary_color_functions},
|
{"GL_EXT_secondary_color", GL_EXT_secondary_color_functions},
|
||||||
|
{"GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions},
|
||||||
{"GL_EXT_stencil_wrap", NULL},
|
{"GL_EXT_stencil_wrap", NULL},
|
||||||
{"GL_EXT_texture_edge_clamp", NULL},
|
{"GL_EXT_texture_edge_clamp", NULL},
|
||||||
{"GL_EXT_texture_env_combine", NULL},
|
{"GL_EXT_texture_env_combine", NULL},
|
||||||
@@ -127,10 +128,6 @@ const struct dri_extension card_extensions[] = {
|
|||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct dri_extension stencil_two_side[] = {
|
|
||||||
{"GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions},
|
|
||||||
};
|
|
||||||
|
|
||||||
extern struct tnl_pipeline_stage _r300_render_stage;
|
extern struct tnl_pipeline_stage _r300_render_stage;
|
||||||
extern const struct tnl_pipeline_stage _r300_tcl_stage;
|
extern const struct tnl_pipeline_stage _r300_tcl_stage;
|
||||||
|
|
||||||
@@ -148,7 +145,6 @@ static const struct tnl_pipeline_stage *r300_pipeline[] = {
|
|||||||
&_tnl_fog_coordinate_stage,
|
&_tnl_fog_coordinate_stage,
|
||||||
&_tnl_texgen_stage,
|
&_tnl_texgen_stage,
|
||||||
&_tnl_texture_transform_stage,
|
&_tnl_texture_transform_stage,
|
||||||
&_tnl_arb_vertex_program_stage,
|
|
||||||
&_tnl_vertex_program_stage,
|
&_tnl_vertex_program_stage,
|
||||||
|
|
||||||
/* Try again to go to tcl?
|
/* Try again to go to tcl?
|
||||||
@@ -335,8 +331,8 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
|
|||||||
|
|
||||||
driInitExtensions(ctx, card_extensions, GL_TRUE);
|
driInitExtensions(ctx, card_extensions, GL_TRUE);
|
||||||
|
|
||||||
if (driQueryOptionb(&r300->radeon.optionCache, "disable_stencil_two_side") == 0)
|
if (driQueryOptionb(&r300->radeon.optionCache, "disable_stencil_two_side"))
|
||||||
driInitSingleExtension(ctx, stencil_two_side);
|
_mesa_disable_extension(ctx, "GL_EXT_stencil_two_side");
|
||||||
|
|
||||||
if (r300->radeon.glCtx->Mesa_DXTn && !driQueryOptionb (&r300->radeon.optionCache, "disable_s3tc")) {
|
if (r300->radeon.glCtx->Mesa_DXTn && !driQueryOptionb (&r300->radeon.optionCache, "disable_s3tc")) {
|
||||||
_mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
|
_mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ static __inline__ uint32_t cmdpacify(void)
|
|||||||
cmd_written, cmd_reserved); \
|
cmd_written, cmd_reserved); \
|
||||||
exit(-1); \
|
exit(-1); \
|
||||||
} \
|
} \
|
||||||
} while(0);
|
} while(0)
|
||||||
|
|
||||||
#define efloat(f) e32(r300PackFloat32(f))
|
#define efloat(f) e32(r300PackFloat32(f))
|
||||||
|
|
||||||
|
|||||||
@@ -949,7 +949,9 @@ static void emit_tex(struct r300_fragment_program *rp,
|
|||||||
* \todo Refactor this once we have proper rewriting/optimization
|
* \todo Refactor this once we have proper rewriting/optimization
|
||||||
* support for programs.
|
* support for programs.
|
||||||
*/
|
*/
|
||||||
GLint tokens[6] = { STATE_INTERNAL, STATE_R300_TEXRECT_FACTOR, 0, 0, 0, 0 };
|
gl_state_index tokens[STATE_LENGTH] = {
|
||||||
|
STATE_INTERNAL, STATE_R300_TEXRECT_FACTOR, 0, 0, 0
|
||||||
|
};
|
||||||
int factor_index;
|
int factor_index;
|
||||||
GLuint factorreg;
|
GLuint factorreg;
|
||||||
|
|
||||||
@@ -2053,7 +2055,9 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
|
|||||||
|
|
||||||
static void insert_wpos(struct gl_program *prog)
|
static void insert_wpos(struct gl_program *prog)
|
||||||
{
|
{
|
||||||
GLint tokens[6] = { STATE_INTERNAL, STATE_R300_WINDOW_DIMENSION, 0, 0, 0, 0 };
|
static gl_state_index tokens[STATE_LENGTH] = {
|
||||||
|
STATE_INTERNAL, STATE_R300_WINDOW_DIMENSION, 0, 0, 0
|
||||||
|
};
|
||||||
struct prog_instruction *fpi;
|
struct prog_instruction *fpi;
|
||||||
GLuint window_index;
|
GLuint window_index;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|||||||
@@ -179,11 +179,17 @@ static void r300EmitClearState(GLcontext * ctx)
|
|||||||
int cmd_reserved = 0;
|
int cmd_reserved = 0;
|
||||||
int cmd_written = 0;
|
int cmd_written = 0;
|
||||||
drm_radeon_cmd_header_t *cmd = NULL;
|
drm_radeon_cmd_header_t *cmd = NULL;
|
||||||
|
int has_tcl = 1;
|
||||||
|
|
||||||
|
if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL))
|
||||||
|
has_tcl = 0;
|
||||||
|
|
||||||
R300_STATECHANGE(r300, vir[0]);
|
R300_STATECHANGE(r300, vir[0]);
|
||||||
reg_start(R300_VAP_INPUT_ROUTE_0_0, 0);
|
reg_start(R300_VAP_INPUT_ROUTE_0_0, 0);
|
||||||
e32(0x21030003);
|
if (!has_tcl)
|
||||||
|
e32(0x22030003);
|
||||||
|
else
|
||||||
|
e32(0x21030003);
|
||||||
|
|
||||||
/* disable fog */
|
/* disable fog */
|
||||||
R300_STATECHANGE(r300, fogs);
|
R300_STATECHANGE(r300, fogs);
|
||||||
@@ -198,7 +204,17 @@ static void r300EmitClearState(GLcontext * ctx)
|
|||||||
reg_start(R300_VAP_INPUT_CNTL_0, 1);
|
reg_start(R300_VAP_INPUT_CNTL_0, 1);
|
||||||
e32(0x00000001);
|
e32(0x00000001);
|
||||||
e32(0x00000405);
|
e32(0x00000405);
|
||||||
|
|
||||||
|
if (!has_tcl) {
|
||||||
|
/* comes from fglrx startup of clear */
|
||||||
|
reg_start(R300_SE_VTE_CNTL, 1);
|
||||||
|
e32(0x043f);
|
||||||
|
e32(0x8);
|
||||||
|
|
||||||
|
reg_start(0x21dc, 0);
|
||||||
|
e32(0xaaaaaaaa);
|
||||||
|
}
|
||||||
|
|
||||||
R300_STATECHANGE(r300, vof);
|
R300_STATECHANGE(r300, vof);
|
||||||
reg_start(R300_VAP_OUTPUT_VTX_FMT_0, 1);
|
reg_start(R300_VAP_OUTPUT_VTX_FMT_0, 1);
|
||||||
e32(R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT | R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT);
|
e32(R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT | R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT);
|
||||||
@@ -279,26 +295,28 @@ static void r300EmitClearState(GLcontext * ctx)
|
|||||||
|
|
||||||
reg_start(R300_PFS_INSTR3_0, 0);
|
reg_start(R300_PFS_INSTR3_0, 0);
|
||||||
e32(FP_SELA(0,NO,W,FP_TMP(0),0,0));
|
e32(FP_SELA(0,NO,W,FP_TMP(0),0,0));
|
||||||
|
|
||||||
|
if (has_tcl) {
|
||||||
|
R300_STATECHANGE(r300, pvs);
|
||||||
|
reg_start(R300_VAP_PVS_CNTL_1, 2);
|
||||||
|
e32((0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) |
|
||||||
|
(0 << R300_PVS_CNTL_1_POS_END_SHIFT) |
|
||||||
|
(1 << R300_PVS_CNTL_1_PROGRAM_END_SHIFT));
|
||||||
|
e32(0);
|
||||||
|
e32(1 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT);
|
||||||
|
|
||||||
|
R300_STATECHANGE(r300, vpi);
|
||||||
|
vsf_start_fragment(0x0, 8);
|
||||||
|
e32(VP_OUT(ADD,OUT,0,XYZW));
|
||||||
|
e32(VP_IN(IN,0));
|
||||||
|
e32(VP_ZERO());
|
||||||
|
e32(0);
|
||||||
|
|
||||||
R300_STATECHANGE(r300, pvs);
|
e32(VP_OUT(ADD,OUT,1,XYZW));
|
||||||
reg_start(R300_VAP_PVS_CNTL_1, 2);
|
e32(VP_IN(IN,1));
|
||||||
e32((0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) |
|
e32(VP_ZERO());
|
||||||
(0 << R300_PVS_CNTL_1_POS_END_SHIFT) |
|
e32(0);
|
||||||
(1 << R300_PVS_CNTL_1_PROGRAM_END_SHIFT));
|
}
|
||||||
e32(0);
|
|
||||||
e32(1 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT);
|
|
||||||
|
|
||||||
R300_STATECHANGE(r300, vpi);
|
|
||||||
vsf_start_fragment(0x0, 8);
|
|
||||||
e32(VP_OUT(ADD,OUT,0,XYZW));
|
|
||||||
e32(VP_IN(IN,0));
|
|
||||||
e32(VP_ZERO());
|
|
||||||
e32(0);
|
|
||||||
|
|
||||||
e32(VP_OUT(ADD,OUT,1,XYZW));
|
|
||||||
e32(VP_IN(IN,1));
|
|
||||||
e32(VP_ZERO());
|
|
||||||
e32(0);
|
|
||||||
|
|
||||||
/*reg_start(0x4500,0);
|
/*reg_start(0x4500,0);
|
||||||
e32(2560-1);*/
|
e32(2560-1);*/
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
# define R300_VC_NO_SWAP (0 << 0)
|
# define R300_VC_NO_SWAP (0 << 0)
|
||||||
# define R300_VC_16BIT_SWAP (1 << 0)
|
# define R300_VC_16BIT_SWAP (1 << 0)
|
||||||
# define R300_VC_32BIT_SWAP (2 << 0)
|
# define R300_VC_32BIT_SWAP (2 << 0)
|
||||||
|
# define R300_VAP_TCL_BYPASS (1 << 8)
|
||||||
|
|
||||||
/* gap */
|
/* gap */
|
||||||
|
|
||||||
|
|||||||
@@ -388,7 +388,6 @@ int r300Fallback(GLcontext *ctx)
|
|||||||
struct r300_fragment_program *rp =
|
struct r300_fragment_program *rp =
|
||||||
(struct r300_fragment_program *)
|
(struct r300_fragment_program *)
|
||||||
(char *)ctx->FragmentProgram._Current;
|
(char *)ctx->FragmentProgram._Current;
|
||||||
int i;
|
|
||||||
|
|
||||||
if (rp) {
|
if (rp) {
|
||||||
if (!rp->translated)
|
if (!rp->translated)
|
||||||
|
|||||||
@@ -1269,6 +1269,9 @@ void r300_setup_textures(GLcontext *ctx)
|
|||||||
tmu_mappings[i] = hw_tmu;
|
tmu_mappings[i] = hw_tmu;
|
||||||
|
|
||||||
t=r300->state.texture.unit[i].texobj;
|
t=r300->state.texture.unit[i].texobj;
|
||||||
|
/* XXX questionable fix for bug 9170: */
|
||||||
|
if (!t)
|
||||||
|
continue;
|
||||||
|
|
||||||
if((t->format & 0xffffff00)==0xffffff00) {
|
if((t->format & 0xffffff00)==0xffffff00) {
|
||||||
WARN_ONCE("unknown texture format (entry %x) encountered. Help me !\n", t->format & 0xff);
|
WARN_ONCE("unknown texture format (entry %x) encountered. Help me !\n", t->format & 0xff);
|
||||||
@@ -1660,18 +1663,7 @@ void r300SetupVertexShader(r300ContextPtr rmesa)
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This needs to be replaced by vertex shader generation code */
|
/* This needs to be replaced by vertex shader generation code */
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* textures enabled ? */
|
|
||||||
if(rmesa->state.texture.tc_count>0){
|
|
||||||
rmesa->state.vertex_shader=SINGLE_TEXTURE_VERTEX_SHADER;
|
|
||||||
} else {
|
|
||||||
rmesa->state.vertex_shader=FLAT_COLOR_VERTEX_SHADER;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
r300GenerateSimpleVertexShader(rmesa);
|
r300GenerateSimpleVertexShader(rmesa);
|
||||||
|
|
||||||
rmesa->state.vertex_shader.matrix[0].length=16;
|
rmesa->state.vertex_shader.matrix[0].length=16;
|
||||||
@@ -1805,7 +1797,8 @@ void r300UpdateShaderStates(r300ContextPtr rmesa)
|
|||||||
r300SetupPixelShader(rmesa);
|
r300SetupPixelShader(rmesa);
|
||||||
r300_setup_textures(ctx);
|
r300_setup_textures(ctx);
|
||||||
|
|
||||||
r300SetupVertexShader(rmesa);
|
if ((rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL))
|
||||||
|
r300SetupVertexShader(rmesa);
|
||||||
r300_setup_rs_unit(ctx);
|
r300_setup_rs_unit(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1938,6 +1931,10 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state)
|
|||||||
void r300ResetHwState(r300ContextPtr r300)
|
void r300ResetHwState(r300ContextPtr r300)
|
||||||
{
|
{
|
||||||
GLcontext* ctx = r300->radeon.glCtx;
|
GLcontext* ctx = r300->radeon.glCtx;
|
||||||
|
int has_tcl = 1;
|
||||||
|
|
||||||
|
if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL))
|
||||||
|
has_tcl = 0;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_STATE)
|
if (RADEON_DEBUG & DEBUG_STATE)
|
||||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||||
@@ -2005,8 +2002,10 @@ void r300ResetHwState(r300ContextPtr r300)
|
|||||||
/* Initialize magic registers
|
/* Initialize magic registers
|
||||||
TODO : learn what they really do, or get rid of
|
TODO : learn what they really do, or get rid of
|
||||||
those we don't have to touch */
|
those we don't have to touch */
|
||||||
r300->hw.vap_cntl.cmd[1] = 0x0030045A; //0x0030065a /* Dangerous */
|
if (!has_tcl)
|
||||||
|
r300->hw.vap_cntl.cmd[1] = 0x0014045a;
|
||||||
|
else
|
||||||
|
r300->hw.vap_cntl.cmd[1] = 0x0030045A; //0x0030065a /* Dangerous */
|
||||||
r300->hw.vte.cmd[1] = R300_VPORT_X_SCALE_ENA
|
r300->hw.vte.cmd[1] = R300_VPORT_X_SCALE_ENA
|
||||||
| R300_VPORT_X_OFFSET_ENA
|
| R300_VPORT_X_OFFSET_ENA
|
||||||
| R300_VPORT_Y_SCALE_ENA
|
| R300_VPORT_Y_SCALE_ENA
|
||||||
@@ -2023,6 +2022,10 @@ void r300ResetHwState(r300ContextPtr r300)
|
|||||||
else
|
else
|
||||||
r300->hw.vap_cntl_status.cmd[1] = 0x00000002;
|
r300->hw.vap_cntl_status.cmd[1] = 0x00000002;
|
||||||
|
|
||||||
|
/* disable VAP/TCL on non-TCL capable chips */
|
||||||
|
if (!has_tcl)
|
||||||
|
r300->hw.vap_cntl_status.cmd[1] |= R300_VAP_TCL_BYPASS;
|
||||||
|
|
||||||
#if 0 /* Done in setup routing */
|
#if 0 /* Done in setup routing */
|
||||||
((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->packet0.count = 1;
|
((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->packet0.count = 1;
|
||||||
r300->hw.vir[0].cmd[1] = 0x21030003;
|
r300->hw.vir[0].cmd[1] = 0x21030003;
|
||||||
@@ -2266,10 +2269,12 @@ void r300ResetHwState(r300ContextPtr r300)
|
|||||||
r300->hw.vpp.cmd[i] = 0;
|
r300->hw.vpp.cmd[i] = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
r300->hw.vps.cmd[R300_VPS_ZERO_0] = 0;
|
if (has_tcl) {
|
||||||
r300->hw.vps.cmd[R300_VPS_ZERO_1] = 0;
|
r300->hw.vps.cmd[R300_VPS_ZERO_0] = 0;
|
||||||
r300->hw.vps.cmd[R300_VPS_POINTSIZE] = r300PackFloat32(1.0);
|
r300->hw.vps.cmd[R300_VPS_ZERO_1] = 0;
|
||||||
r300->hw.vps.cmd[R300_VPS_ZERO_3] = 0;
|
r300->hw.vps.cmd[R300_VPS_POINTSIZE] = r300PackFloat32(1.0);
|
||||||
|
r300->hw.vps.cmd[R300_VPS_ZERO_3] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
//END: TODO
|
//END: TODO
|
||||||
r300->hw.all_dirty = GL_TRUE;
|
r300->hw.all_dirty = GL_TRUE;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
WRITEMASK_W != VSF_FLAG_W
|
WRITEMASK_W != VSF_FLAG_W
|
||||||
#error Cannot change these!
|
#error Cannot change these!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SCALAR_FLAG (1<<31)
|
#define SCALAR_FLAG (1<<31)
|
||||||
#define FLAG_MASK (1<<31)
|
#define FLAG_MASK (1<<31)
|
||||||
#define OP_MASK (0xf) /* we are unlikely to have more than 15 */
|
#define OP_MASK (0xf) /* we are unlikely to have more than 15 */
|
||||||
@@ -96,17 +96,17 @@ static struct{
|
|||||||
OPN(END, 0),
|
OPN(END, 0),
|
||||||
};
|
};
|
||||||
#undef OPN
|
#undef OPN
|
||||||
|
|
||||||
int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *vp, float *dst)
|
int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *vp, float *dst)
|
||||||
{
|
{
|
||||||
int pi;
|
int pi;
|
||||||
struct gl_vertex_program *mesa_vp = &vp->mesa_program;
|
struct gl_vertex_program *mesa_vp = &vp->mesa_program;
|
||||||
float *dst_o=dst;
|
float *dst_o=dst;
|
||||||
struct gl_program_parameter_list *paramList;
|
struct gl_program_parameter_list *paramList;
|
||||||
|
|
||||||
if (mesa_vp->IsNVProgram) {
|
if (mesa_vp->IsNVProgram) {
|
||||||
_mesa_load_tracked_matrices(ctx);
|
_mesa_load_tracked_matrices(ctx);
|
||||||
|
|
||||||
for (pi=0; pi < MAX_NV_VERTEX_PROGRAM_PARAMS; pi++) {
|
for (pi=0; pi < MAX_NV_VERTEX_PROGRAM_PARAMS; pi++) {
|
||||||
*dst++=ctx->VertexProgram.Parameters[pi][0];
|
*dst++=ctx->VertexProgram.Parameters[pi][0];
|
||||||
*dst++=ctx->VertexProgram.Parameters[pi][1];
|
*dst++=ctx->VertexProgram.Parameters[pi][1];
|
||||||
@@ -115,19 +115,19 @@ int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *
|
|||||||
}
|
}
|
||||||
return dst - dst_o;
|
return dst - dst_o;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(mesa_vp->Base.Parameters);
|
assert(mesa_vp->Base.Parameters);
|
||||||
_mesa_load_state_parameters(ctx, mesa_vp->Base.Parameters);
|
_mesa_load_state_parameters(ctx, mesa_vp->Base.Parameters);
|
||||||
|
|
||||||
if(mesa_vp->Base.Parameters->NumParameters * 4 > VSF_MAX_FRAGMENT_LENGTH){
|
if(mesa_vp->Base.Parameters->NumParameters * 4 > VSF_MAX_FRAGMENT_LENGTH){
|
||||||
fprintf(stderr, "%s:Params exhausted\n", __FUNCTION__);
|
fprintf(stderr, "%s:Params exhausted\n", __FUNCTION__);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
paramList = mesa_vp->Base.Parameters;
|
paramList = mesa_vp->Base.Parameters;
|
||||||
for(pi=0; pi < paramList->NumParameters; pi++){
|
for(pi=0; pi < paramList->NumParameters; pi++){
|
||||||
switch(paramList->Parameters[pi].Type){
|
switch(paramList->Parameters[pi].Type){
|
||||||
|
|
||||||
case PROGRAM_STATE_VAR:
|
case PROGRAM_STATE_VAR:
|
||||||
case PROGRAM_NAMED_PARAM:
|
case PROGRAM_NAMED_PARAM:
|
||||||
//fprintf(stderr, "%s", vp->Parameters->Parameters[pi].Name);
|
//fprintf(stderr, "%s", vp->Parameters->Parameters[pi].Name);
|
||||||
@@ -137,15 +137,15 @@ int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *
|
|||||||
*dst++=paramList->ParameterValues[pi][2];
|
*dst++=paramList->ParameterValues[pi][2];
|
||||||
*dst++=paramList->ParameterValues[pi][3];
|
*dst++=paramList->ParameterValues[pi][3];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: _mesa_problem(NULL, "Bad param type in %s", __FUNCTION__);
|
default: _mesa_problem(NULL, "Bad param type in %s", __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return dst - dst_o;
|
return dst - dst_o;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned long t_dst_mask(GLuint mask)
|
static unsigned long t_dst_mask(GLuint mask)
|
||||||
{
|
{
|
||||||
/* WRITEMASK_* is equivalent to VSF_FLAG_* */
|
/* WRITEMASK_* is equivalent to VSF_FLAG_* */
|
||||||
@@ -154,7 +154,7 @@ static unsigned long t_dst_mask(GLuint mask)
|
|||||||
|
|
||||||
static unsigned long t_dst_class(enum register_file file)
|
static unsigned long t_dst_class(enum register_file file)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch(file){
|
switch(file){
|
||||||
case PROGRAM_TEMPORARY:
|
case PROGRAM_TEMPORARY:
|
||||||
return VSF_OUT_CLASS_TMP;
|
return VSF_OUT_CLASS_TMP;
|
||||||
@@ -162,7 +162,7 @@ static unsigned long t_dst_class(enum register_file file)
|
|||||||
return VSF_OUT_CLASS_RESULT;
|
return VSF_OUT_CLASS_RESULT;
|
||||||
case PROGRAM_ADDRESS:
|
case PROGRAM_ADDRESS:
|
||||||
return VSF_OUT_CLASS_ADDR;
|
return VSF_OUT_CLASS_ADDR;
|
||||||
/*
|
/*
|
||||||
case PROGRAM_INPUT:
|
case PROGRAM_INPUT:
|
||||||
case PROGRAM_LOCAL_PARAM:
|
case PROGRAM_LOCAL_PARAM:
|
||||||
case PROGRAM_ENV_PARAM:
|
case PROGRAM_ENV_PARAM:
|
||||||
@@ -187,20 +187,20 @@ static unsigned long t_dst_index(struct r300_vertex_program *vp, struct prog_dst
|
|||||||
|
|
||||||
static unsigned long t_src_class(enum register_file file)
|
static unsigned long t_src_class(enum register_file file)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch(file){
|
switch(file){
|
||||||
case PROGRAM_TEMPORARY:
|
case PROGRAM_TEMPORARY:
|
||||||
return VSF_IN_CLASS_TMP;
|
return VSF_IN_CLASS_TMP;
|
||||||
|
|
||||||
case PROGRAM_INPUT:
|
case PROGRAM_INPUT:
|
||||||
return VSF_IN_CLASS_ATTR;
|
return VSF_IN_CLASS_ATTR;
|
||||||
|
|
||||||
case PROGRAM_LOCAL_PARAM:
|
case PROGRAM_LOCAL_PARAM:
|
||||||
case PROGRAM_ENV_PARAM:
|
case PROGRAM_ENV_PARAM:
|
||||||
case PROGRAM_NAMED_PARAM:
|
case PROGRAM_NAMED_PARAM:
|
||||||
case PROGRAM_STATE_VAR:
|
case PROGRAM_STATE_VAR:
|
||||||
return VSF_IN_CLASS_PARAM;
|
return VSF_IN_CLASS_PARAM;
|
||||||
/*
|
/*
|
||||||
case PROGRAM_OUTPUT:
|
case PROGRAM_OUTPUT:
|
||||||
case PROGRAM_WRITE_ONLY:
|
case PROGRAM_WRITE_ONLY:
|
||||||
case PROGRAM_ADDRESS:
|
case PROGRAM_ADDRESS:
|
||||||
@@ -221,17 +221,17 @@ static __inline unsigned long t_swizzle(GLubyte swizzle)
|
|||||||
static void vp_dump_inputs(struct r300_vertex_program *vp, char *caller)
|
static void vp_dump_inputs(struct r300_vertex_program *vp, char *caller)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(vp == NULL){
|
if(vp == NULL){
|
||||||
fprintf(stderr, "vp null in call to %s from %s\n", __FUNCTION__, caller);
|
fprintf(stderr, "vp null in call to %s from %s\n", __FUNCTION__, caller);
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "%s:<", caller);
|
fprintf(stderr, "%s:<", caller);
|
||||||
for(i=0; i < VERT_ATTRIB_MAX; i++)
|
for(i=0; i < VERT_ATTRIB_MAX; i++)
|
||||||
fprintf(stderr, "%d ", vp->inputs[i]);
|
fprintf(stderr, "%d ", vp->inputs[i]);
|
||||||
fprintf(stderr, ">\n");
|
fprintf(stderr, ">\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -239,19 +239,19 @@ static unsigned long t_src_index(struct r300_vertex_program *vp, struct prog_src
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int max_reg=-1;
|
int max_reg=-1;
|
||||||
|
|
||||||
if(src->File == PROGRAM_INPUT){
|
if(src->File == PROGRAM_INPUT){
|
||||||
if(vp->inputs[src->Index] != -1)
|
if(vp->inputs[src->Index] != -1)
|
||||||
return vp->inputs[src->Index];
|
return vp->inputs[src->Index];
|
||||||
|
|
||||||
for(i=0; i < VERT_ATTRIB_MAX; i++)
|
for(i=0; i < VERT_ATTRIB_MAX; i++)
|
||||||
if(vp->inputs[i] > max_reg)
|
if(vp->inputs[i] > max_reg)
|
||||||
max_reg=vp->inputs[i];
|
max_reg=vp->inputs[i];
|
||||||
|
|
||||||
vp->inputs[src->Index]=max_reg+1;
|
vp->inputs[src->Index]=max_reg+1;
|
||||||
|
|
||||||
//vp_dump_inputs(vp, __FUNCTION__);
|
//vp_dump_inputs(vp, __FUNCTION__);
|
||||||
|
|
||||||
return vp->inputs[src->Index];
|
return vp->inputs[src->Index];
|
||||||
}else{
|
}else{
|
||||||
if (src->Index < 0) {
|
if (src->Index < 0) {
|
||||||
@@ -278,7 +278,7 @@ static unsigned long t_src(struct r300_vertex_program *vp, struct prog_src_regis
|
|||||||
|
|
||||||
static unsigned long t_src_scalar(struct r300_vertex_program *vp, struct prog_src_register *src)
|
static unsigned long t_src_scalar(struct r300_vertex_program *vp, struct prog_src_register *src)
|
||||||
{
|
{
|
||||||
|
|
||||||
return MAKE_VSF_SOURCE(t_src_index(vp, src),
|
return MAKE_VSF_SOURCE(t_src_index(vp, src),
|
||||||
t_swizzle(GET_SWZ(src->Swizzle, 0)),
|
t_swizzle(GET_SWZ(src->Swizzle, 0)),
|
||||||
t_swizzle(GET_SWZ(src->Swizzle, 0)),
|
t_swizzle(GET_SWZ(src->Swizzle, 0)),
|
||||||
@@ -307,8 +307,8 @@ static unsigned long t_opcode(enum prog_opcode opcode)
|
|||||||
case OPCODE_SGE: return R300_VPI_OUT_OP_SGE;
|
case OPCODE_SGE: return R300_VPI_OUT_OP_SGE;
|
||||||
case OPCODE_SLT: return R300_VPI_OUT_OP_SLT;
|
case OPCODE_SLT: return R300_VPI_OUT_OP_SLT;
|
||||||
case OPCODE_DP4: return R300_VPI_OUT_OP_DOT;
|
case OPCODE_DP4: return R300_VPI_OUT_OP_DOT;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "%s: Should not be called with opcode %d!", __FUNCTION__, opcode);
|
fprintf(stderr, "%s: Should not be called with opcode %d!", __FUNCTION__, opcode);
|
||||||
}
|
}
|
||||||
exit(-1);
|
exit(-1);
|
||||||
@@ -318,12 +318,12 @@ static unsigned long t_opcode(enum prog_opcode opcode)
|
|||||||
static unsigned long op_operands(enum prog_opcode opcode)
|
static unsigned long op_operands(enum prog_opcode opcode)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Can we trust mesas opcodes to be in order ? */
|
/* Can we trust mesas opcodes to be in order ? */
|
||||||
for(i=0; i < sizeof(op_names) / sizeof(*op_names); i++)
|
for(i=0; i < sizeof(op_names) / sizeof(*op_names); i++)
|
||||||
if(op_names[i].opcode == opcode)
|
if(op_names[i].opcode == opcode)
|
||||||
return op_names[i].ip;
|
return op_names[i].ip;
|
||||||
|
|
||||||
fprintf(stderr, "op %d not found in op_names\n", opcode);
|
fprintf(stderr, "op %d not found in op_names\n", opcode);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -331,13 +331,12 @@ static unsigned long op_operands(enum prog_opcode opcode)
|
|||||||
|
|
||||||
static GLboolean valid_dst(struct r300_vertex_program *vp, struct prog_dst_register *dst)
|
static GLboolean valid_dst(struct r300_vertex_program *vp, struct prog_dst_register *dst)
|
||||||
{
|
{
|
||||||
if(dst->File == PROGRAM_OUTPUT && vp->outputs[dst->Index] == -1){
|
if(dst->File == PROGRAM_OUTPUT && vp->outputs[dst->Index] == -1) {
|
||||||
WARN_ONCE("Output %d not used by fragment program\n", dst->Index);
|
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}else if(dst->File == PROGRAM_ADDRESS) {
|
} else if(dst->File == PROGRAM_ADDRESS) {
|
||||||
assert(dst->Index == 0);
|
assert(dst->Index == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,12 +346,12 @@ static GLboolean valid_dst(struct r300_vertex_program *vp, struct prog_dst_regis
|
|||||||
t_src_class(b.File) == VSF_IN_CLASS_PARAM) || \
|
t_src_class(b.File) == VSF_IN_CLASS_PARAM) || \
|
||||||
(t_src_class(a.File) == VSF_IN_CLASS_ATTR && \
|
(t_src_class(a.File) == VSF_IN_CLASS_ATTR && \
|
||||||
t_src_class(b.File) == VSF_IN_CLASS_ATTR)))) \
|
t_src_class(b.File) == VSF_IN_CLASS_ATTR)))) \
|
||||||
|
|
||||||
#define ZERO_SRC_0 (MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), \
|
#define ZERO_SRC_0 (MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), \
|
||||||
SWIZZLE_ZERO, SWIZZLE_ZERO, \
|
SWIZZLE_ZERO, SWIZZLE_ZERO, \
|
||||||
SWIZZLE_ZERO, SWIZZLE_ZERO, \
|
SWIZZLE_ZERO, SWIZZLE_ZERO, \
|
||||||
t_src_class(src[0].File), VSF_FLAG_NONE) | (src[0].RelAddr << 4))
|
t_src_class(src[0].File), VSF_FLAG_NONE) | (src[0].RelAddr << 4))
|
||||||
|
|
||||||
#define ZERO_SRC_1 (MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), \
|
#define ZERO_SRC_1 (MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), \
|
||||||
SWIZZLE_ZERO, SWIZZLE_ZERO, \
|
SWIZZLE_ZERO, SWIZZLE_ZERO, \
|
||||||
SWIZZLE_ZERO, SWIZZLE_ZERO, \
|
SWIZZLE_ZERO, SWIZZLE_ZERO, \
|
||||||
@@ -362,12 +361,12 @@ static GLboolean valid_dst(struct r300_vertex_program *vp, struct prog_dst_regis
|
|||||||
SWIZZLE_ZERO, SWIZZLE_ZERO, \
|
SWIZZLE_ZERO, SWIZZLE_ZERO, \
|
||||||
SWIZZLE_ZERO, SWIZZLE_ZERO, \
|
SWIZZLE_ZERO, SWIZZLE_ZERO, \
|
||||||
t_src_class(src[2].File), VSF_FLAG_NONE) | (src[2].RelAddr << 4))
|
t_src_class(src[2].File), VSF_FLAG_NONE) | (src[2].RelAddr << 4))
|
||||||
|
|
||||||
#define ONE_SRC_0 (MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), \
|
#define ONE_SRC_0 (MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), \
|
||||||
SWIZZLE_ONE, SWIZZLE_ONE, \
|
SWIZZLE_ONE, SWIZZLE_ONE, \
|
||||||
SWIZZLE_ONE, SWIZZLE_ONE, \
|
SWIZZLE_ONE, SWIZZLE_ONE, \
|
||||||
t_src_class(src[0].File), VSF_FLAG_NONE) | (src[0].RelAddr << 4))
|
t_src_class(src[0].File), VSF_FLAG_NONE) | (src[0].RelAddr << 4))
|
||||||
|
|
||||||
#define ONE_SRC_1 (MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), \
|
#define ONE_SRC_1 (MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), \
|
||||||
SWIZZLE_ONE, SWIZZLE_ONE, \
|
SWIZZLE_ONE, SWIZZLE_ONE, \
|
||||||
SWIZZLE_ONE, SWIZZLE_ONE, \
|
SWIZZLE_ONE, SWIZZLE_ONE, \
|
||||||
@@ -377,7 +376,7 @@ static GLboolean valid_dst(struct r300_vertex_program *vp, struct prog_dst_regis
|
|||||||
SWIZZLE_ONE, SWIZZLE_ONE, \
|
SWIZZLE_ONE, SWIZZLE_ONE, \
|
||||||
SWIZZLE_ONE, SWIZZLE_ONE, \
|
SWIZZLE_ONE, SWIZZLE_ONE, \
|
||||||
t_src_class(src[2].File), VSF_FLAG_NONE) | (src[2].RelAddr << 4))
|
t_src_class(src[2].File), VSF_FLAG_NONE) | (src[2].RelAddr << 4))
|
||||||
|
|
||||||
/* DP4 version seems to trigger some hw peculiarity */
|
/* DP4 version seems to trigger some hw peculiarity */
|
||||||
//#define PREFER_DP4
|
//#define PREFER_DP4
|
||||||
|
|
||||||
@@ -406,46 +405,46 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
vp->pos_end=0; /* Not supported yet */
|
vp->pos_end=0; /* Not supported yet */
|
||||||
vp->program.length=0;
|
vp->program.length=0;
|
||||||
/*vp->num_temporaries=mesa_vp->Base.NumTemporaries;*/
|
/*vp->num_temporaries=mesa_vp->Base.NumTemporaries;*/
|
||||||
|
|
||||||
for(i=0; i < VERT_ATTRIB_MAX; i++)
|
for(i=0; i < VERT_ATTRIB_MAX; i++)
|
||||||
vp->inputs[i] = -1;
|
vp->inputs[i] = -1;
|
||||||
|
|
||||||
for(i=0; i < VERT_RESULT_MAX; i++)
|
for(i=0; i < VERT_RESULT_MAX; i++)
|
||||||
vp->outputs[i] = -1;
|
vp->outputs[i] = -1;
|
||||||
|
|
||||||
assert(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS));
|
assert(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS));
|
||||||
|
|
||||||
/* Assign outputs */
|
/* Assign outputs */
|
||||||
if(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS))
|
if(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS))
|
||||||
vp->outputs[VERT_RESULT_HPOS] = cur_reg++;
|
vp->outputs[VERT_RESULT_HPOS] = cur_reg++;
|
||||||
|
|
||||||
if(vp->key.OutputsWritten & (1 << VERT_RESULT_PSIZ))
|
if(vp->key.OutputsWritten & (1 << VERT_RESULT_PSIZ))
|
||||||
vp->outputs[VERT_RESULT_PSIZ] = cur_reg++;
|
vp->outputs[VERT_RESULT_PSIZ] = cur_reg++;
|
||||||
|
|
||||||
if(vp->key.OutputsWritten & (1 << VERT_RESULT_COL0))
|
if(vp->key.OutputsWritten & (1 << VERT_RESULT_COL0))
|
||||||
vp->outputs[VERT_RESULT_COL0] = cur_reg++;
|
vp->outputs[VERT_RESULT_COL0] = cur_reg++;
|
||||||
|
|
||||||
if(vp->key.OutputsWritten & (1 << VERT_RESULT_COL1))
|
if(vp->key.OutputsWritten & (1 << VERT_RESULT_COL1))
|
||||||
vp->outputs[VERT_RESULT_COL1] = cur_reg++;
|
vp->outputs[VERT_RESULT_COL1] = cur_reg++;
|
||||||
|
|
||||||
#if 0 /* Not supported yet */
|
#if 0 /* Not supported yet */
|
||||||
if(vp->key.OutputsWritten & (1 << VERT_RESULT_BFC0))
|
if(vp->key.OutputsWritten & (1 << VERT_RESULT_BFC0))
|
||||||
vp->outputs[VERT_RESULT_BFC0] = cur_reg++;
|
vp->outputs[VERT_RESULT_BFC0] = cur_reg++;
|
||||||
|
|
||||||
if(vp->key.OutputsWritten & (1 << VERT_RESULT_BFC1))
|
if(vp->key.OutputsWritten & (1 << VERT_RESULT_BFC1))
|
||||||
vp->outputs[VERT_RESULT_BFC1] = cur_reg++;
|
vp->outputs[VERT_RESULT_BFC1] = cur_reg++;
|
||||||
|
|
||||||
if(vp->key.OutputsWritten & (1 << VERT_RESULT_FOGC))
|
if(vp->key.OutputsWritten & (1 << VERT_RESULT_FOGC))
|
||||||
vp->outputs[VERT_RESULT_FOGC] = cur_reg++;
|
vp->outputs[VERT_RESULT_FOGC] = cur_reg++;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(i=VERT_RESULT_TEX0; i <= VERT_RESULT_TEX7; i++)
|
for(i=VERT_RESULT_TEX0; i <= VERT_RESULT_TEX7; i++)
|
||||||
if(vp->key.OutputsWritten & (1 << i))
|
if(vp->key.OutputsWritten & (1 << i))
|
||||||
vp->outputs[i] = cur_reg++;
|
vp->outputs[i] = cur_reg++;
|
||||||
|
|
||||||
vp->translated = GL_TRUE;
|
vp->translated = GL_TRUE;
|
||||||
vp->native = GL_TRUE;
|
vp->native = GL_TRUE;
|
||||||
|
|
||||||
o_inst=vp->program.body.i;
|
o_inst=vp->program.body.i;
|
||||||
for(; vpi->Opcode != OPCODE_END; vpi++, o_inst++){
|
for(; vpi->Opcode != OPCODE_END; vpi++, o_inst++){
|
||||||
FREE_TEMPS();
|
FREE_TEMPS();
|
||||||
@@ -456,19 +455,19 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
vpi->DstReg.File = PROGRAM_TEMPORARY;
|
vpi->DstReg.File = PROGRAM_TEMPORARY;
|
||||||
vpi->DstReg.Index = u_temp_i;
|
vpi->DstReg.Index = u_temp_i;
|
||||||
}
|
}
|
||||||
|
|
||||||
operands=op_operands(vpi->Opcode);
|
operands=op_operands(vpi->Opcode);
|
||||||
are_srcs_scalar=operands & SCALAR_FLAG;
|
are_srcs_scalar=operands & SCALAR_FLAG;
|
||||||
operands &= OP_MASK;
|
operands &= OP_MASK;
|
||||||
|
|
||||||
for(i=0; i < operands; i++)
|
for(i=0; i < operands; i++)
|
||||||
src[i]=vpi->SrcReg[i];
|
src[i]=vpi->SrcReg[i];
|
||||||
|
|
||||||
if(operands == 3){ /* TODO: scalars */
|
if(operands == 3){ /* TODO: scalars */
|
||||||
if( CMP_SRCS(src[1], src[2]) || CMP_SRCS(src[0], src[2]) ){
|
if( CMP_SRCS(src[1], src[2]) || CMP_SRCS(src[0], src[2]) ){
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, u_temp_i,
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, u_temp_i,
|
||||||
VSF_FLAG_ALL, VSF_OUT_CLASS_TMP);
|
VSF_FLAG_ALL, VSF_OUT_CLASS_TMP);
|
||||||
|
|
||||||
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[2]),
|
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[2]),
|
||||||
SWIZZLE_X, SWIZZLE_Y,
|
SWIZZLE_X, SWIZZLE_Y,
|
||||||
SWIZZLE_Z, SWIZZLE_W,
|
SWIZZLE_Z, SWIZZLE_W,
|
||||||
@@ -477,20 +476,20 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
o_inst->src2=ZERO_SRC_2;
|
o_inst->src2=ZERO_SRC_2;
|
||||||
o_inst->src3=ZERO_SRC_2;
|
o_inst->src3=ZERO_SRC_2;
|
||||||
o_inst++;
|
o_inst++;
|
||||||
|
|
||||||
src[2].File=PROGRAM_TEMPORARY;
|
src[2].File=PROGRAM_TEMPORARY;
|
||||||
src[2].Index=u_temp_i;
|
src[2].Index=u_temp_i;
|
||||||
src[2].RelAddr=0;
|
src[2].RelAddr=0;
|
||||||
u_temp_i--;
|
u_temp_i--;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(operands >= 2){
|
if(operands >= 2){
|
||||||
if( CMP_SRCS(src[1], src[0]) ){
|
if( CMP_SRCS(src[1], src[0]) ){
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, u_temp_i,
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, u_temp_i,
|
||||||
VSF_FLAG_ALL, VSF_OUT_CLASS_TMP);
|
VSF_FLAG_ALL, VSF_OUT_CLASS_TMP);
|
||||||
|
|
||||||
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
||||||
SWIZZLE_X, SWIZZLE_Y,
|
SWIZZLE_X, SWIZZLE_Y,
|
||||||
SWIZZLE_Z, SWIZZLE_W,
|
SWIZZLE_Z, SWIZZLE_W,
|
||||||
@@ -499,14 +498,14 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
o_inst->src2=ZERO_SRC_0;
|
o_inst->src2=ZERO_SRC_0;
|
||||||
o_inst->src3=ZERO_SRC_0;
|
o_inst->src3=ZERO_SRC_0;
|
||||||
o_inst++;
|
o_inst++;
|
||||||
|
|
||||||
src[0].File=PROGRAM_TEMPORARY;
|
src[0].File=PROGRAM_TEMPORARY;
|
||||||
src[0].Index=u_temp_i;
|
src[0].Index=u_temp_i;
|
||||||
src[0].RelAddr=0;
|
src[0].RelAddr=0;
|
||||||
u_temp_i--;
|
u_temp_i--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* These ops need special handling. */
|
/* These ops need special handling. */
|
||||||
switch(vpi->Opcode){
|
switch(vpi->Opcode){
|
||||||
case OPCODE_POW:
|
case OPCODE_POW:
|
||||||
@@ -516,8 +515,8 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
o_inst->src2=ZERO_SRC_0;
|
o_inst->src2=ZERO_SRC_0;
|
||||||
o_inst->src3=t_src_scalar(vp, &src[1]);
|
o_inst->src3=t_src_scalar(vp, &src[1]);
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case OPCODE_MOV://ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{} {ZERO ZERO ZERO ZERO}
|
case OPCODE_MOV://ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{} {ZERO ZERO ZERO ZERO}
|
||||||
case OPCODE_SWZ:
|
case OPCODE_SWZ:
|
||||||
#if 1
|
#if 1
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
|
||||||
@@ -527,21 +526,21 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
o_inst->src3=ZERO_SRC_0;
|
o_inst->src3=ZERO_SRC_0;
|
||||||
#else
|
#else
|
||||||
hw_op=(src[0].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
|
hw_op=(src[0].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
|
||||||
|
|
||||||
o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
o_inst->src1=t_src(vp, &src[0]);
|
o_inst->src1=t_src(vp, &src[0]);
|
||||||
o_inst->src2=ONE_SRC_0;
|
o_inst->src2=ONE_SRC_0;
|
||||||
o_inst->src3=ZERO_SRC_0;
|
o_inst->src3=ZERO_SRC_0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case OPCODE_ADD:
|
case OPCODE_ADD:
|
||||||
#if 1
|
#if 1
|
||||||
hw_op=(src[0].File == PROGRAM_TEMPORARY &&
|
hw_op=(src[0].File == PROGRAM_TEMPORARY &&
|
||||||
src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
|
src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
|
||||||
|
|
||||||
o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
o_inst->src1=ONE_SRC_0;
|
o_inst->src1=ONE_SRC_0;
|
||||||
@@ -553,26 +552,26 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
o_inst->src1=t_src(vp, &src[0]);
|
o_inst->src1=t_src(vp, &src[0]);
|
||||||
o_inst->src2=t_src(vp, &src[1]);
|
o_inst->src2=t_src(vp, &src[1]);
|
||||||
o_inst->src3=ZERO_SRC_1;
|
o_inst->src3=ZERO_SRC_1;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case OPCODE_MAD:
|
case OPCODE_MAD:
|
||||||
hw_op=(src[0].File == PROGRAM_TEMPORARY &&
|
hw_op=(src[0].File == PROGRAM_TEMPORARY &&
|
||||||
src[1].File == PROGRAM_TEMPORARY &&
|
src[1].File == PROGRAM_TEMPORARY &&
|
||||||
src[2].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
|
src[2].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
|
||||||
|
|
||||||
o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
o_inst->src1=t_src(vp, &src[0]);
|
o_inst->src1=t_src(vp, &src[0]);
|
||||||
o_inst->src2=t_src(vp, &src[1]);
|
o_inst->src2=t_src(vp, &src[1]);
|
||||||
o_inst->src3=t_src(vp, &src[2]);
|
o_inst->src3=t_src(vp, &src[2]);
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case OPCODE_MUL: /* HW mul can take third arg but appears to have some other limitations. */
|
case OPCODE_MUL: /* HW mul can take third arg but appears to have some other limitations. */
|
||||||
hw_op=(src[0].File == PROGRAM_TEMPORARY &&
|
hw_op=(src[0].File == PROGRAM_TEMPORARY &&
|
||||||
src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
|
src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
|
||||||
|
|
||||||
o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
o_inst->src1=t_src(vp, &src[0]);
|
o_inst->src1=t_src(vp, &src[0]);
|
||||||
@@ -580,11 +579,11 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
|
|
||||||
o_inst->src3=ZERO_SRC_1;
|
o_inst->src3=ZERO_SRC_1;
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case OPCODE_DP3://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ZERO} PARAM 0{} {X Y Z ZERO}
|
case OPCODE_DP3://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ZERO} PARAM 0{} {X Y Z ZERO}
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
|
|
||||||
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
|
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
|
||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 1)),
|
t_swizzle(GET_SWZ(src[0].Swizzle, 1)),
|
||||||
@@ -592,7 +591,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
SWIZZLE_ZERO,
|
SWIZZLE_ZERO,
|
||||||
t_src_class(src[0].File),
|
t_src_class(src[0].File),
|
||||||
src[0].NegateBase ? VSF_FLAG_XYZ : VSF_FLAG_NONE) | (src[0].RelAddr << 4);
|
src[0].NegateBase ? VSF_FLAG_XYZ : VSF_FLAG_NONE) | (src[0].RelAddr << 4);
|
||||||
|
|
||||||
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
|
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
|
||||||
t_swizzle(GET_SWZ(src[1].Swizzle, 0)),
|
t_swizzle(GET_SWZ(src[1].Swizzle, 0)),
|
||||||
t_swizzle(GET_SWZ(src[1].Swizzle, 1)),
|
t_swizzle(GET_SWZ(src[1].Swizzle, 1)),
|
||||||
@@ -608,7 +607,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
#if 1
|
#if 1
|
||||||
hw_op=(src[0].File == PROGRAM_TEMPORARY &&
|
hw_op=(src[0].File == PROGRAM_TEMPORARY &&
|
||||||
src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
|
src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
|
||||||
|
|
||||||
o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
o_inst->src1=t_src(vp, &src[0]);
|
o_inst->src1=t_src(vp, &src[0]);
|
||||||
@@ -623,7 +622,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
#else
|
#else
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
|
|
||||||
o_inst->src1=t_src(vp, &src[0]);
|
o_inst->src1=t_src(vp, &src[0]);
|
||||||
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
|
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
|
||||||
t_swizzle(GET_SWZ(src[1].Swizzle, 0)),
|
t_swizzle(GET_SWZ(src[1].Swizzle, 0)),
|
||||||
@@ -635,11 +634,11 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
o_inst->src3=0;
|
o_inst->src3=0;
|
||||||
#endif
|
#endif
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case OPCODE_ABS://MAX RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W
|
case OPCODE_ABS://MAX RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAX, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAX, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
|
|
||||||
o_inst->src1=t_src(vp, &src[0]);
|
o_inst->src1=t_src(vp, &src[0]);
|
||||||
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
|
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
|
||||||
@@ -650,22 +649,22 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
(!src[0].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4);
|
(!src[0].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4);
|
||||||
o_inst->src3=0;
|
o_inst->src3=0;
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case OPCODE_FLR:
|
case OPCODE_FLR:
|
||||||
/* FRC TMP 0.X Y Z W PARAM 0{} {X Y Z W}
|
/* FRC TMP 0.X Y Z W PARAM 0{} {X Y Z W}
|
||||||
ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} TMP 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W */
|
ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} TMP 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W */
|
||||||
|
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_FRC, u_temp_i,
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_FRC, u_temp_i,
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), VSF_OUT_CLASS_TMP);
|
t_dst_mask(vpi->DstReg.WriteMask), VSF_OUT_CLASS_TMP);
|
||||||
|
|
||||||
o_inst->src1=t_src(vp, &src[0]);
|
o_inst->src1=t_src(vp, &src[0]);
|
||||||
o_inst->src2=ZERO_SRC_0;
|
o_inst->src2=ZERO_SRC_0;
|
||||||
o_inst->src3=ZERO_SRC_0;
|
o_inst->src3=ZERO_SRC_0;
|
||||||
o_inst++;
|
o_inst++;
|
||||||
|
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
|
|
||||||
o_inst->src1=t_src(vp, &src[0]);
|
o_inst->src1=t_src(vp, &src[0]);
|
||||||
o_inst->src2=MAKE_VSF_SOURCE(u_temp_i,
|
o_inst->src2=MAKE_VSF_SOURCE(u_temp_i,
|
||||||
VSF_IN_COMPONENT_X,
|
VSF_IN_COMPONENT_X,
|
||||||
@@ -679,11 +678,11 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
o_inst->src3=ZERO_SRC_0;
|
o_inst->src3=ZERO_SRC_0;
|
||||||
u_temp_i--;
|
u_temp_i--;
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case OPCODE_LG2:// LG2 RESULT 1.X Y Z W PARAM 0{} {X X X X}
|
case OPCODE_LG2:// LG2 RESULT 1.X Y Z W PARAM 0{} {X X X X}
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_LG2, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_LG2, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
|
|
||||||
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
|
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
|
||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
|
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
|
||||||
@@ -694,8 +693,8 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
o_inst->src2=ZERO_SRC_0;
|
o_inst->src2=ZERO_SRC_0;
|
||||||
o_inst->src3=ZERO_SRC_0;
|
o_inst->src3=ZERO_SRC_0;
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case OPCODE_LIT://LIT TMP 1.Y Z TMP 1{} {X W Z Y} TMP 1{} {Y W Z X} TMP 1{} {Y X Z W}
|
case OPCODE_LIT://LIT TMP 1.Y Z TMP 1{} {X W Z Y} TMP 1{} {Y W Z X} TMP 1{} {Y X Z W}
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_LIT, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_LIT, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
/* NOTE: Users swizzling might not work. */
|
/* NOTE: Users swizzling might not work. */
|
||||||
@@ -721,11 +720,11 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
t_src_class(src[0].File),
|
t_src_class(src[0].File),
|
||||||
src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4);
|
src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4);
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case OPCODE_DPH://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ONE} PARAM 0{} {X Y Z W}
|
case OPCODE_DPH://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ONE} PARAM 0{} {X Y Z W}
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
|
|
||||||
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
|
t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
|
||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 1)),
|
t_swizzle(GET_SWZ(src[0].Swizzle, 1)),
|
||||||
@@ -736,16 +735,16 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
o_inst->src2=t_src(vp, &src[1]);
|
o_inst->src2=t_src(vp, &src[1]);
|
||||||
o_inst->src3=ZERO_SRC_1;
|
o_inst->src3=ZERO_SRC_1;
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case OPCODE_XPD:
|
case OPCODE_XPD:
|
||||||
/* mul r0, r1.yzxw, r2.zxyw
|
/* mul r0, r1.yzxw, r2.zxyw
|
||||||
mad r0, -r2.yzxw, r1.zxyw, r0
|
mad r0, -r2.yzxw, r1.zxyw, r0
|
||||||
NOTE: might need MAD_2
|
NOTE: might need MAD_2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, u_temp_i,
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, u_temp_i,
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), VSF_OUT_CLASS_TMP);
|
t_dst_mask(vpi->DstReg.WriteMask), VSF_OUT_CLASS_TMP);
|
||||||
|
|
||||||
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
|
t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
|
||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
|
t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
|
||||||
@@ -753,7 +752,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
|
t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
|
||||||
t_src_class(src[0].File),
|
t_src_class(src[0].File),
|
||||||
src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4);
|
src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4);
|
||||||
|
|
||||||
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
|
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
|
||||||
t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z
|
t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z
|
||||||
t_swizzle(GET_SWZ(src[1].Swizzle, 0)), // x
|
t_swizzle(GET_SWZ(src[1].Swizzle, 0)), // x
|
||||||
@@ -761,14 +760,14 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
t_swizzle(GET_SWZ(src[1].Swizzle, 3)), // w
|
t_swizzle(GET_SWZ(src[1].Swizzle, 3)), // w
|
||||||
t_src_class(src[1].File),
|
t_src_class(src[1].File),
|
||||||
src[1].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[1].RelAddr << 4);
|
src[1].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[1].RelAddr << 4);
|
||||||
|
|
||||||
o_inst->src3=ZERO_SRC_1;
|
o_inst->src3=ZERO_SRC_1;
|
||||||
o_inst++;
|
o_inst++;
|
||||||
u_temp_i--;
|
u_temp_i--;
|
||||||
|
|
||||||
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
|
|
||||||
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
|
o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
|
||||||
t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y
|
t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y
|
||||||
t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z
|
t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z
|
||||||
@@ -776,7 +775,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
t_swizzle(GET_SWZ(src[1].Swizzle, 3)), // w
|
t_swizzle(GET_SWZ(src[1].Swizzle, 3)), // w
|
||||||
t_src_class(src[1].File),
|
t_src_class(src[1].File),
|
||||||
(!src[1].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[1].RelAddr << 4);
|
(!src[1].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[1].RelAddr << 4);
|
||||||
|
|
||||||
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
|
||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
|
t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
|
||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x
|
t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x
|
||||||
@@ -784,7 +783,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
|
t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
|
||||||
t_src_class(src[0].File),
|
t_src_class(src[0].File),
|
||||||
src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4);
|
src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4);
|
||||||
|
|
||||||
o_inst->src3=MAKE_VSF_SOURCE(u_temp_i+1,
|
o_inst->src3=MAKE_VSF_SOURCE(u_temp_i+1,
|
||||||
VSF_IN_COMPONENT_X,
|
VSF_IN_COMPONENT_X,
|
||||||
VSF_IN_COMPONENT_Y,
|
VSF_IN_COMPONENT_Y,
|
||||||
@@ -792,7 +791,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
VSF_IN_COMPONENT_W,
|
VSF_IN_COMPONENT_W,
|
||||||
VSF_IN_CLASS_TMP,
|
VSF_IN_CLASS_TMP,
|
||||||
VSF_FLAG_NONE);
|
VSF_FLAG_NONE);
|
||||||
|
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case OPCODE_RCC:
|
case OPCODE_RCC:
|
||||||
@@ -804,10 +803,10 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
o_inst->op=MAKE_VSF_OP(t_opcode(vpi->Opcode), t_dst_index(vp, &vpi->DstReg),
|
o_inst->op=MAKE_VSF_OP(t_opcode(vpi->Opcode), t_dst_index(vp, &vpi->DstReg),
|
||||||
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
|
||||||
|
|
||||||
if(are_srcs_scalar){
|
if(are_srcs_scalar){
|
||||||
switch(operands){
|
switch(operands){
|
||||||
case 1:
|
case 1:
|
||||||
@@ -815,19 +814,19 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
o_inst->src2=ZERO_SRC_0;
|
o_inst->src2=ZERO_SRC_0;
|
||||||
o_inst->src3=ZERO_SRC_0;
|
o_inst->src3=ZERO_SRC_0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
o_inst->src1=t_src_scalar(vp, &src[0]);
|
o_inst->src1=t_src_scalar(vp, &src[0]);
|
||||||
o_inst->src2=t_src_scalar(vp, &src[1]);
|
o_inst->src2=t_src_scalar(vp, &src[1]);
|
||||||
o_inst->src3=ZERO_SRC_1;
|
o_inst->src3=ZERO_SRC_1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
o_inst->src1=t_src_scalar(vp, &src[0]);
|
o_inst->src1=t_src_scalar(vp, &src[0]);
|
||||||
o_inst->src2=t_src_scalar(vp, &src[1]);
|
o_inst->src2=t_src_scalar(vp, &src[1]);
|
||||||
o_inst->src3=t_src_scalar(vp, &src[2]);
|
o_inst->src3=t_src_scalar(vp, &src[2]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "scalars and op RCC not handled yet");
|
fprintf(stderr, "scalars and op RCC not handled yet");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
@@ -840,19 +839,19 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
o_inst->src2=ZERO_SRC_0;
|
o_inst->src2=ZERO_SRC_0;
|
||||||
o_inst->src3=ZERO_SRC_0;
|
o_inst->src3=ZERO_SRC_0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
o_inst->src1=t_src(vp, &src[0]);
|
o_inst->src1=t_src(vp, &src[0]);
|
||||||
o_inst->src2=t_src(vp, &src[1]);
|
o_inst->src2=t_src(vp, &src[1]);
|
||||||
o_inst->src3=ZERO_SRC_1;
|
o_inst->src3=ZERO_SRC_1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
o_inst->src1=t_src(vp, &src[0]);
|
o_inst->src1=t_src(vp, &src[0]);
|
||||||
o_inst->src2=t_src(vp, &src[1]);
|
o_inst->src2=t_src(vp, &src[1]);
|
||||||
o_inst->src3=t_src(vp, &src[2]);
|
o_inst->src3=t_src(vp, &src[2]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "scalars and op RCC not handled yet");
|
fprintf(stderr, "scalars and op RCC not handled yet");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
@@ -861,7 +860,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
|
|||||||
}
|
}
|
||||||
next: ;
|
next: ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Will most likely segfault before we get here... fix later. */
|
/* Will most likely segfault before we get here... fix later. */
|
||||||
if(o_inst - vp->program.body.i >= VSF_MAX_FRAGMENT_LENGTH/4) {
|
if(o_inst - vp->program.body.i >= VSF_MAX_FRAGMENT_LENGTH/4) {
|
||||||
vp->program.length = 0;
|
vp->program.length = 0;
|
||||||
@@ -945,7 +944,7 @@ static void position_invariant(struct gl_program *prog)
|
|||||||
vpi[i].SrcReg[2].Index = 0;
|
vpi[i].SrcReg[2].Index = 0;
|
||||||
vpi[i].SrcReg[2].Swizzle = SWIZZLE_XYZW;
|
vpi[i].SrcReg[2].Swizzle = SWIZZLE_XYZW;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
_mesa_copy_instructions (&vpi[i], prog->Instructions, prog->NumInstructions);
|
_mesa_copy_instructions (&vpi[i], prog->Instructions, prog->NumInstructions);
|
||||||
@@ -967,7 +966,7 @@ static void insert_wpos(struct r300_vertex_program *vp,
|
|||||||
struct prog_instruction *vpi;
|
struct prog_instruction *vpi;
|
||||||
struct prog_instruction *vpi_insert;
|
struct prog_instruction *vpi_insert;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
vpi = _mesa_alloc_instructions (prog->NumInstructions + 2);
|
vpi = _mesa_alloc_instructions (prog->NumInstructions + 2);
|
||||||
_mesa_init_instructions (vpi, prog->NumInstructions + 2);
|
_mesa_init_instructions (vpi, prog->NumInstructions + 2);
|
||||||
/* all but END */
|
/* all but END */
|
||||||
@@ -1054,7 +1053,7 @@ static struct r300_vertex_program *build_program(struct r300_vertex_program_key
|
|||||||
|
|
||||||
r300_translate_vertex_shader(vp, mesa_vp->Base.Instructions);
|
r300_translate_vertex_shader(vp, mesa_vp->Base.Instructions);
|
||||||
|
|
||||||
return vp;
|
return vp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void r300_select_vertex_shader(r300ContextPtr r300)
|
void r300_select_vertex_shader(r300ContextPtr r300)
|
||||||
@@ -1077,7 +1076,7 @@ void r300_select_vertex_shader(r300ContextPtr r300)
|
|||||||
for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
|
for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
|
||||||
if (!(InputsRead & (FRAG_BIT_TEX0 << i)))
|
if (!(InputsRead & (FRAG_BIT_TEX0 << i)))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if(i == ctx->Const.MaxTextureUnits){
|
if(i == ctx->Const.MaxTextureUnits){
|
||||||
fprintf(stderr, "\tno free texcoord found\n");
|
fprintf(stderr, "\tno free texcoord found\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
@@ -1093,7 +1092,7 @@ void r300_select_vertex_shader(r300ContextPtr r300)
|
|||||||
if ((InputsRead & FRAG_BIT_COL1) /*||
|
if ((InputsRead & FRAG_BIT_COL1) /*||
|
||||||
(InputsRead & FRAG_BIT_FOGC)*/)
|
(InputsRead & FRAG_BIT_FOGC)*/)
|
||||||
wanted_key.OutputsWritten |= 1 << VERT_RESULT_COL1;
|
wanted_key.OutputsWritten |= 1 << VERT_RESULT_COL1;
|
||||||
|
|
||||||
for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
|
for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
|
||||||
if (InputsRead & (FRAG_BIT_TEX0 << i))
|
if (InputsRead & (FRAG_BIT_TEX0 << i))
|
||||||
wanted_key.OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i);
|
wanted_key.OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i);
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ static void radeonUpdatePageFlipping(radeonContextPtr radeon)
|
|||||||
int use_back;
|
int use_back;
|
||||||
|
|
||||||
radeon->doPageFlip = radeon->sarea->pfState;
|
radeon->doPageFlip = radeon->sarea->pfState;
|
||||||
if (!radeon->doPageFlip) {
|
if (radeon->glCtx->WinSysDrawBuffer) {
|
||||||
driFlipRenderbuffers(radeon->glCtx->WinSysDrawBuffer, GL_FALSE);
|
driFlipRenderbuffers(radeon->glCtx->WinSysDrawBuffer, radeon->sarea->pfCurrentPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
use_back = (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT);
|
use_back = (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT);
|
||||||
|
|||||||
@@ -56,8 +56,10 @@ static void
|
|||||||
radeonUpdatePageFlipping( radeonContextPtr rmesa )
|
radeonUpdatePageFlipping( radeonContextPtr rmesa )
|
||||||
{
|
{
|
||||||
rmesa->doPageFlip = rmesa->sarea->pfState;
|
rmesa->doPageFlip = rmesa->sarea->pfState;
|
||||||
driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
|
if (rmesa->glCtx->WinSysDrawBuffer) {
|
||||||
rmesa->sarea->pfCurrentPage);
|
driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
|
||||||
|
rmesa->sarea->pfCurrentPage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -656,7 +656,8 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
|
|||||||
case PCI_CHIP_RC410_5A61:
|
case PCI_CHIP_RC410_5A61:
|
||||||
case PCI_CHIP_RC410_5A62:
|
case PCI_CHIP_RC410_5A62:
|
||||||
screen->chip_family = CHIP_FAMILY_RS400;
|
screen->chip_family = CHIP_FAMILY_RS400;
|
||||||
fprintf(stderr, "Warning, xpress200 detected. Probably won't work.\n");
|
fprintf(stderr, "Warning, xpress200 detected. Won't work.\n");
|
||||||
|
return NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -165,12 +165,6 @@ static const struct tnl_pipeline_stage *tdfx_pipeline[] = {
|
|||||||
&_tnl_texgen_stage,
|
&_tnl_texgen_stage,
|
||||||
&_tnl_texture_transform_stage,
|
&_tnl_texture_transform_stage,
|
||||||
&_tnl_point_attenuation_stage,
|
&_tnl_point_attenuation_stage,
|
||||||
#if 0
|
|
||||||
#if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program)
|
|
||||||
&_tnl_arb_vertex_program_stage,
|
|
||||||
&_tnl_vertex_program_stage,
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
&_tnl_render_stage,
|
&_tnl_render_stage,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -682,9 +682,16 @@ glFBDevDestroyBuffer( GLFBDevBufferPtr buffer )
|
|||||||
if (buffer == curDraw || buffer == curRead) {
|
if (buffer == curDraw || buffer == curRead) {
|
||||||
glFBDevMakeCurrent( NULL, NULL, NULL);
|
glFBDevMakeCurrent( NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
/* free the software depth, stencil, accum buffers */
|
/* free the software depth, stencil, accum buffers */
|
||||||
_mesa_free_framebuffer_data(&buffer->glframebuffer);
|
_mesa_free_framebuffer_data(&buffer->glframebuffer);
|
||||||
_mesa_free(buffer);
|
_mesa_free(buffer);
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
struct gl_framebuffer *fb = &buffer->glframebuffer;
|
||||||
|
_mesa_unreference_framebuffer(&fb);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -799,10 +806,16 @@ glFBDevDestroyContext( GLFBDevContextPtr context )
|
|||||||
GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext();
|
GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext();
|
||||||
|
|
||||||
if (context) {
|
if (context) {
|
||||||
|
GLcontext *mesaCtx = &context->glcontext;
|
||||||
|
|
||||||
|
_swsetup_DestroyContext( mesaCtx );
|
||||||
|
_swrast_DestroyContext( mesaCtx );
|
||||||
|
_tnl_DestroyContext( mesaCtx );
|
||||||
|
_vbo_DestroyContext( mesaCtx );
|
||||||
|
|
||||||
if (fbdevctx == context) {
|
if (fbdevctx == context) {
|
||||||
/* destroying current context */
|
/* destroying current context */
|
||||||
_mesa_make_current(NULL, NULL, NULL);
|
_mesa_make_current(NULL, NULL, NULL);
|
||||||
_mesa_notifyDestroy(&context->glcontext);
|
|
||||||
}
|
}
|
||||||
_mesa_free_context_data(&context->glcontext);
|
_mesa_free_context_data(&context->glcontext);
|
||||||
_mesa_free(context);
|
_mesa_free(context);
|
||||||
|
|||||||
@@ -1663,7 +1663,6 @@ static const struct tnl_pipeline_stage *fx_pipeline[] = {
|
|||||||
&_tnl_texture_transform_stage,
|
&_tnl_texture_transform_stage,
|
||||||
&_tnl_point_attenuation_stage,
|
&_tnl_point_attenuation_stage,
|
||||||
#if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program)
|
#if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program)
|
||||||
&_tnl_arb_vertex_program_stage,
|
|
||||||
&_tnl_vertex_program_stage,
|
&_tnl_vertex_program_stage,
|
||||||
#endif
|
#endif
|
||||||
&_tnl_render_stage,
|
&_tnl_render_stage,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
* Version: 6.5.1
|
* Version: 6.5.3
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -1041,6 +1041,7 @@ new_osmesa_renderbuffer(GLcontext *ctx, GLenum format, GLenum type)
|
|||||||
const GLuint name = 0;
|
const GLuint name = 0;
|
||||||
struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, name);
|
struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, name);
|
||||||
if (rb) {
|
if (rb) {
|
||||||
|
rb->RefCount = 1;
|
||||||
rb->Delete = osmesa_delete_renderbuffer;
|
rb->Delete = osmesa_delete_renderbuffer;
|
||||||
rb->AllocStorage = osmesa_renderbuffer_storage;
|
rb->AllocStorage = osmesa_renderbuffer_storage;
|
||||||
|
|
||||||
@@ -1237,6 +1238,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
|
|||||||
/* create front color buffer in user-provided memory (no back buffer) */
|
/* create front color buffer in user-provided memory (no back buffer) */
|
||||||
osmesa->rb = new_osmesa_renderbuffer(&osmesa->mesa, format, type);
|
osmesa->rb = new_osmesa_renderbuffer(&osmesa->mesa, format, type);
|
||||||
_mesa_add_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT, osmesa->rb);
|
_mesa_add_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT, osmesa->rb);
|
||||||
|
assert(osmesa->rb->RefCount == 2);
|
||||||
|
|
||||||
_mesa_add_soft_renderbuffers(osmesa->gl_buffer,
|
_mesa_add_soft_renderbuffers(osmesa->gl_buffer,
|
||||||
GL_FALSE, /* color */
|
GL_FALSE, /* color */
|
||||||
@@ -1297,6 +1299,9 @@ GLAPI void GLAPIENTRY
|
|||||||
OSMesaDestroyContext( OSMesaContext osmesa )
|
OSMesaDestroyContext( OSMesaContext osmesa )
|
||||||
{
|
{
|
||||||
if (osmesa) {
|
if (osmesa) {
|
||||||
|
if (osmesa->rb)
|
||||||
|
_mesa_reference_renderbuffer(&osmesa->rb, NULL);
|
||||||
|
|
||||||
_swsetup_DestroyContext( &osmesa->mesa );
|
_swsetup_DestroyContext( &osmesa->mesa );
|
||||||
_tnl_DestroyContext( &osmesa->mesa );
|
_tnl_DestroyContext( &osmesa->mesa );
|
||||||
_vbo_DestroyContext( &osmesa->mesa );
|
_vbo_DestroyContext( &osmesa->mesa );
|
||||||
@@ -1570,6 +1575,7 @@ static struct name_function functions[] = {
|
|||||||
{ "OSMesaGetDepthBuffer", (OSMESAproc) OSMesaGetDepthBuffer },
|
{ "OSMesaGetDepthBuffer", (OSMESAproc) OSMesaGetDepthBuffer },
|
||||||
{ "OSMesaGetColorBuffer", (OSMESAproc) OSMesaGetColorBuffer },
|
{ "OSMesaGetColorBuffer", (OSMESAproc) OSMesaGetColorBuffer },
|
||||||
{ "OSMesaGetProcAddress", (OSMESAproc) OSMesaGetProcAddress },
|
{ "OSMesaGetProcAddress", (OSMESAproc) OSMesaGetProcAddress },
|
||||||
|
{ "OSMesaColorClamp", (OSMESAproc) OSMesaColorClamp },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
DESCRIPTION 'Mesa OSMesa lib for Win32'
|
;DESCRIPTION 'Mesa OSMesa lib for Win32'
|
||||||
VERSION 4.1
|
VERSION 4.1
|
||||||
|
|
||||||
EXPORTS
|
EXPORTS
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
; DO NOT EDIT - This file generated automatically by mesadef.py script
|
; DO NOT EDIT - This file generated automatically by mesadef.py script
|
||||||
DESCRIPTION 'Mesa (OpenGL work-alike) for Win32'
|
;DESCRIPTION 'Mesa (OpenGL work-alike) for Win32'
|
||||||
VERSION 6.0
|
VERSION 6.5
|
||||||
;
|
;
|
||||||
; Module definition file for Mesa (OPENGL32.DLL)
|
; Module definition file for Mesa (OPENGL32.DLL)
|
||||||
;
|
;
|
||||||
@@ -867,6 +867,8 @@ EXPORTS
|
|||||||
_glapi_get_proc_address
|
_glapi_get_proc_address
|
||||||
_mesa_add_soft_renderbuffers
|
_mesa_add_soft_renderbuffers
|
||||||
_mesa_add_renderbuffer
|
_mesa_add_renderbuffer
|
||||||
|
_mesa_attach_shader
|
||||||
|
_mesa_bind_attrib_location
|
||||||
_mesa_buffer_data
|
_mesa_buffer_data
|
||||||
_mesa_buffer_get_subdata
|
_mesa_buffer_get_subdata
|
||||||
_mesa_buffer_map
|
_mesa_buffer_map
|
||||||
@@ -875,15 +877,21 @@ EXPORTS
|
|||||||
_mesa_bzero
|
_mesa_bzero
|
||||||
_mesa_calloc
|
_mesa_calloc
|
||||||
_mesa_choose_tex_format
|
_mesa_choose_tex_format
|
||||||
|
_mesa_compile_shader
|
||||||
_mesa_compressed_texture_size
|
_mesa_compressed_texture_size
|
||||||
_mesa_create_framebuffer
|
_mesa_create_framebuffer
|
||||||
|
_mesa_create_program
|
||||||
|
_mesa_create_shader
|
||||||
_mesa_create_visual
|
_mesa_create_visual
|
||||||
_mesa_delete_array_object
|
_mesa_delete_array_object
|
||||||
_mesa_delete_buffer_object
|
_mesa_delete_buffer_object
|
||||||
_mesa_delete_program
|
_mesa_delete_program
|
||||||
|
_mesa_delete_program2
|
||||||
|
_mesa_delete_shader
|
||||||
_mesa_delete_texture_object
|
_mesa_delete_texture_object
|
||||||
_mesa_destroy_framebuffer
|
_mesa_destroy_framebuffer
|
||||||
_mesa_destroy_visual
|
_mesa_destroy_visual
|
||||||
|
_mesa_detach_shader
|
||||||
_mesa_enable_1_3_extensions
|
_mesa_enable_1_3_extensions
|
||||||
_mesa_enable_1_4_extensions
|
_mesa_enable_1_4_extensions
|
||||||
_mesa_enable_1_5_extensions
|
_mesa_enable_1_5_extensions
|
||||||
@@ -894,13 +902,28 @@ EXPORTS
|
|||||||
_mesa_free
|
_mesa_free
|
||||||
_mesa_free_context_data
|
_mesa_free_context_data
|
||||||
_mesa_free_texture_image_data
|
_mesa_free_texture_image_data
|
||||||
|
_mesa_get_active_attrib
|
||||||
|
_mesa_get_active_uniform
|
||||||
|
_mesa_get_attached_shaders
|
||||||
|
_mesa_get_attrib_location
|
||||||
_mesa_get_compressed_teximage
|
_mesa_get_compressed_teximage
|
||||||
_mesa_get_current_context
|
_mesa_get_current_context
|
||||||
|
_mesa_get_handle
|
||||||
|
_mesa_get_programiv
|
||||||
|
_mesa_get_program_info_log
|
||||||
|
_mesa_get_program_register
|
||||||
|
_mesa_get_shaderiv
|
||||||
|
_mesa_get_shader_info_log
|
||||||
|
_mesa_get_shader_source
|
||||||
_mesa_get_teximage
|
_mesa_get_teximage
|
||||||
_mesa_init_default_imports
|
_mesa_get_uniformfv
|
||||||
|
_mesa_get_uniform_location
|
||||||
_mesa_init_driver_functions
|
_mesa_init_driver_functions
|
||||||
_mesa_init_renderbuffer
|
_mesa_init_renderbuffer
|
||||||
_mesa_initialize_context
|
_mesa_initialize_context
|
||||||
|
_mesa_is_program
|
||||||
|
_mesa_is_shader
|
||||||
|
_mesa_link_program
|
||||||
_mesa_make_current
|
_mesa_make_current
|
||||||
_mesa_memcpy
|
_mesa_memcpy
|
||||||
_mesa_memset
|
_mesa_memset
|
||||||
@@ -914,10 +937,12 @@ EXPORTS
|
|||||||
_mesa_new_texture_image
|
_mesa_new_texture_image
|
||||||
_mesa_new_texture_object
|
_mesa_new_texture_object
|
||||||
_mesa_problem
|
_mesa_problem
|
||||||
|
_mesa_reference_renderbuffer
|
||||||
_mesa_remove_renderbuffer
|
_mesa_remove_renderbuffer
|
||||||
_mesa_render_texture
|
_mesa_render_texture
|
||||||
_mesa_ResizeBuffersMESA
|
_mesa_ResizeBuffersMESA
|
||||||
_mesa_resize_framebuffer
|
_mesa_resize_framebuffer
|
||||||
|
_mesa_shader_source
|
||||||
_mesa_store_compressed_teximage1d
|
_mesa_store_compressed_teximage1d
|
||||||
_mesa_store_compressed_teximage2d
|
_mesa_store_compressed_teximage2d
|
||||||
_mesa_store_compressed_teximage3d
|
_mesa_store_compressed_teximage3d
|
||||||
@@ -932,7 +957,12 @@ EXPORTS
|
|||||||
_mesa_store_texsubimage3d
|
_mesa_store_texsubimage3d
|
||||||
_mesa_strcmp
|
_mesa_strcmp
|
||||||
_mesa_test_proxy_teximage
|
_mesa_test_proxy_teximage
|
||||||
|
_mesa_uniform
|
||||||
|
_mesa_uniform_matrix
|
||||||
|
_mesa_unreference_framebuffer
|
||||||
_mesa_update_framebuffer_visual
|
_mesa_update_framebuffer_visual
|
||||||
|
_mesa_use_program
|
||||||
|
_mesa_validate_program
|
||||||
_mesa_Viewport
|
_mesa_Viewport
|
||||||
_swrast_Accum
|
_swrast_Accum
|
||||||
_swrast_Bitmap
|
_swrast_Bitmap
|
||||||
@@ -954,6 +984,7 @@ EXPORTS
|
|||||||
_swrast_copy_texsubimage3d
|
_swrast_copy_texsubimage3d
|
||||||
_swrast_CreateContext
|
_swrast_CreateContext
|
||||||
_swrast_DestroyContext
|
_swrast_DestroyContext
|
||||||
|
_swrast_exec_fragment_program
|
||||||
_swrast_InvalidateState
|
_swrast_InvalidateState
|
||||||
_swrast_ReadPixels
|
_swrast_ReadPixels
|
||||||
_swsetup_Wakeup
|
_swsetup_Wakeup
|
||||||
|
|||||||
@@ -1239,6 +1239,7 @@ WMesaContext WMesaCreateContext(HDC hDC,
|
|||||||
_mesa_enable_1_4_extensions(ctx);
|
_mesa_enable_1_4_extensions(ctx);
|
||||||
_mesa_enable_1_5_extensions(ctx);
|
_mesa_enable_1_5_extensions(ctx);
|
||||||
_mesa_enable_2_0_extensions(ctx);
|
_mesa_enable_2_0_extensions(ctx);
|
||||||
|
_mesa_enable_2_1_extensions(ctx);
|
||||||
|
|
||||||
/* Initialize the software rasterizer and helper modules. */
|
/* Initialize the software rasterizer and helper modules. */
|
||||||
if (!_swrast_CreateContext(ctx) ||
|
if (!_swrast_CreateContext(ctx) ||
|
||||||
@@ -1448,3 +1449,25 @@ void gl_dispatch_stub_761(void){};
|
|||||||
void gl_dispatch_stub_766(void){};
|
void gl_dispatch_stub_766(void){};
|
||||||
void gl_dispatch_stub_767(void){};
|
void gl_dispatch_stub_767(void){};
|
||||||
void gl_dispatch_stub_768(void){};
|
void gl_dispatch_stub_768(void){};
|
||||||
|
|
||||||
|
void gl_dispatch_stub_562(void){};
|
||||||
|
void gl_dispatch_stub_563(void){};
|
||||||
|
void gl_dispatch_stub_564(void){};
|
||||||
|
void gl_dispatch_stub_567(void){};
|
||||||
|
void gl_dispatch_stub_568(void){};
|
||||||
|
void gl_dispatch_stub_569(void){};
|
||||||
|
void gl_dispatch_stub_580(void){};
|
||||||
|
void gl_dispatch_stub_581(void){};
|
||||||
|
void gl_dispatch_stub_606(void){};
|
||||||
|
void gl_dispatch_stub_654(void){};
|
||||||
|
void gl_dispatch_stub_655(void){};
|
||||||
|
void gl_dispatch_stub_656(void){};
|
||||||
|
void gl_dispatch_stub_739(void){};
|
||||||
|
void gl_dispatch_stub_740(void){};
|
||||||
|
void gl_dispatch_stub_741(void){};
|
||||||
|
void gl_dispatch_stub_748(void){};
|
||||||
|
void gl_dispatch_stub_749(void){};
|
||||||
|
void gl_dispatch_stub_769(void){};
|
||||||
|
void gl_dispatch_stub_770(void){};
|
||||||
|
void gl_dispatch_stub_771(void){};
|
||||||
|
|
||||||
|
|||||||
@@ -1440,11 +1440,14 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
|
|||||||
}
|
}
|
||||||
if (!drawBuffer) {
|
if (!drawBuffer) {
|
||||||
/* drawable must be a new window! */
|
/* drawable must be a new window! */
|
||||||
drawBuffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, draw, xmctx);
|
drawBuffer = XMesaCreateWindowBuffer( xmctx->xm_visual, draw );
|
||||||
if (!drawBuffer) {
|
if (!drawBuffer) {
|
||||||
/* Out of memory, or context/drawable depth mismatch */
|
/* Out of memory, or context/drawable depth mismatch */
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
#ifdef FX
|
||||||
|
FXcreateContext( xmctx->xm_visual, draw, xmctx, drawBuffer );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the XMesaBuffer which corresponds to the GLXDrawable 'read' */
|
/* Find the XMesaBuffer which corresponds to the GLXDrawable 'read' */
|
||||||
@@ -1457,12 +1460,14 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
|
|||||||
}
|
}
|
||||||
if (!readBuffer) {
|
if (!readBuffer) {
|
||||||
/* drawable must be a new window! */
|
/* drawable must be a new window! */
|
||||||
readBuffer = XMesaCreateWindowBuffer2(glxCtx->xmesaContext->xm_visual,
|
readBuffer = XMesaCreateWindowBuffer( xmctx->xm_visual, read );
|
||||||
read, xmctx);
|
|
||||||
if (!readBuffer) {
|
if (!readBuffer) {
|
||||||
/* Out of memory, or context/drawable depth mismatch */
|
/* Out of memory, or context/drawable depth mismatch */
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
#ifdef FX
|
||||||
|
FXcreateContext( xmctx->xm_visual, read, xmctx, readBuffer );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
MakeCurrent_PrevContext = ctx;
|
MakeCurrent_PrevContext = ctx;
|
||||||
@@ -2107,10 +2112,15 @@ Fake_glXCreateWindow( Display *dpy, GLXFBConfig config, Window win,
|
|||||||
if (!xmvis)
|
if (!xmvis)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
xmbuf = XMesaCreateWindowBuffer2(xmvis, win, NULL);
|
xmbuf = XMesaCreateWindowBuffer(xmvis, win);
|
||||||
if (!xmbuf)
|
if (!xmbuf)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#ifdef FX
|
||||||
|
/* XXX this will segfault if actually called */
|
||||||
|
FXcreateContext(xmvis, win, NULL, xmbuf);
|
||||||
|
#endif
|
||||||
|
|
||||||
(void) dpy;
|
(void) dpy;
|
||||||
(void) attribList; /* Ignored in GLX 1.3 */
|
(void) attribList; /* Ignored in GLX 1.3 */
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,6 @@
|
|||||||
|
|
||||||
# include "resource.h"
|
# include "resource.h"
|
||||||
# include "windowstr.h"
|
# include "windowstr.h"
|
||||||
# include "gcstruct.h"
|
|
||||||
# include "xf86glx_util.h"
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|||||||
@@ -80,10 +80,6 @@
|
|||||||
#include "tnl/t_pipeline.h"
|
#include "tnl/t_pipeline.h"
|
||||||
#include "drivers/common/driverfuncs.h"
|
#include "drivers/common/driverfuncs.h"
|
||||||
|
|
||||||
#ifdef XFree86Server
|
|
||||||
#include <GL/glxtokens.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global X driver lock
|
* Global X driver lock
|
||||||
*/
|
*/
|
||||||
@@ -179,9 +175,7 @@ static int host_byte_order( void )
|
|||||||
*/
|
*/
|
||||||
static int check_for_xshm( XMesaDisplay *display )
|
static int check_for_xshm( XMesaDisplay *display )
|
||||||
{
|
{
|
||||||
#if defined(XFree86Server)
|
#if defined(USE_XSHM) && !defined(XFree86Server)
|
||||||
return 0;
|
|
||||||
#elif defined(USE_XSHM)
|
|
||||||
int major, minor, ignore;
|
int major, minor, ignore;
|
||||||
Bool pixmaps;
|
Bool pixmaps;
|
||||||
|
|
||||||
@@ -976,42 +970,33 @@ setup_truecolor(XMesaVisual v, XMesaBuffer buffer, XMesaColormap cmap)
|
|||||||
&& GET_BLUEMASK(v) ==0xff0000
|
&& GET_BLUEMASK(v) ==0xff0000
|
||||||
&& CHECK_BYTE_ORDER(v)
|
&& CHECK_BYTE_ORDER(v)
|
||||||
&& v->BitsPerPixel==32
|
&& v->BitsPerPixel==32
|
||||||
&& sizeof(GLuint)==4
|
|
||||||
&& v->RedGamma==1.0 && v->GreenGamma==1.0 && v->BlueGamma==1.0) {
|
&& v->RedGamma==1.0 && v->GreenGamma==1.0 && v->BlueGamma==1.0) {
|
||||||
/* common 32 bpp config used on SGI, Sun */
|
/* common 32 bpp config used on SGI, Sun */
|
||||||
v->undithered_pf = v->dithered_pf = PF_8A8B8G8R;
|
v->undithered_pf = v->dithered_pf = PF_8A8B8G8R; /* ABGR */
|
||||||
}
|
}
|
||||||
else if (GET_REDMASK(v) ==0xff0000
|
else if (GET_REDMASK(v) == 0xff0000
|
||||||
&& GET_GREENMASK(v)==0x00ff00
|
&& GET_GREENMASK(v)== 0x00ff00
|
||||||
&& GET_BLUEMASK(v) ==0x0000ff
|
&& GET_BLUEMASK(v) == 0x0000ff
|
||||||
&& CHECK_BYTE_ORDER(v)
|
&& CHECK_BYTE_ORDER(v)
|
||||||
&& v->BitsPerPixel==32
|
&& v->RedGamma == 1.0 && v->GreenGamma == 1.0 && v->BlueGamma == 1.0){
|
||||||
&& sizeof(GLuint)==4
|
if (v->BitsPerPixel==32) {
|
||||||
&& v->RedGamma==1.0 && v->GreenGamma==1.0 && v->BlueGamma==1.0) {
|
/* if 32 bpp, and visual indicates 8 bpp alpha channel */
|
||||||
/* common 32 bpp config used on Linux, HP, IBM */
|
if (GET_VISUAL_DEPTH(v) == 32 && v->mesa_visual.alphaBits == 8)
|
||||||
if (GET_VISUAL_DEPTH(v)==32)
|
v->undithered_pf = v->dithered_pf = PF_8A8R8G8B; /* ARGB */
|
||||||
v->undithered_pf = v->dithered_pf = PF_8A8R8G8B;
|
else
|
||||||
else
|
v->undithered_pf = v->dithered_pf = PF_8R8G8B; /* xRGB */
|
||||||
v->undithered_pf = v->dithered_pf = PF_8R8G8B;
|
}
|
||||||
}
|
else if (v->BitsPerPixel == 24) {
|
||||||
else if (GET_REDMASK(v) ==0xff0000
|
v->undithered_pf = v->dithered_pf = PF_8R8G8B24; /* RGB */
|
||||||
&& GET_GREENMASK(v)==0x00ff00
|
}
|
||||||
&& GET_BLUEMASK(v) ==0x0000ff
|
|
||||||
&& CHECK_BYTE_ORDER(v)
|
|
||||||
&& v->BitsPerPixel==24
|
|
||||||
&& sizeof(GLuint)==4
|
|
||||||
&& v->RedGamma==1.0 && v->GreenGamma==1.0 && v->BlueGamma==1.0) {
|
|
||||||
/* common packed 24 bpp config used on Linux */
|
|
||||||
v->undithered_pf = v->dithered_pf = PF_8R8G8B24;
|
|
||||||
}
|
}
|
||||||
else if (GET_REDMASK(v) ==0xf800
|
else if (GET_REDMASK(v) ==0xf800
|
||||||
&& GET_GREENMASK(v)==0x07e0
|
&& GET_GREENMASK(v)==0x07e0
|
||||||
&& GET_BLUEMASK(v) ==0x001f
|
&& GET_BLUEMASK(v) ==0x001f
|
||||||
&& CHECK_BYTE_ORDER(v)
|
&& CHECK_BYTE_ORDER(v)
|
||||||
&& v->BitsPerPixel==16
|
&& v->BitsPerPixel==16
|
||||||
&& sizeof(GLushort)==2
|
|
||||||
&& v->RedGamma==1.0 && v->GreenGamma==1.0 && v->BlueGamma==1.0) {
|
&& v->RedGamma==1.0 && v->GreenGamma==1.0 && v->BlueGamma==1.0) {
|
||||||
/* 5-6-5 color weight on common PC VGA boards */
|
/* 5-6-5 RGB */
|
||||||
v->undithered_pf = PF_5R6G5B;
|
v->undithered_pf = PF_5R6G5B;
|
||||||
v->dithered_pf = PF_Dither_5R6G5B;
|
v->dithered_pf = PF_Dither_5R6G5B;
|
||||||
}
|
}
|
||||||
@@ -1019,6 +1004,7 @@ setup_truecolor(XMesaVisual v, XMesaBuffer buffer, XMesaColormap cmap)
|
|||||||
&& GET_GREENMASK(v)==0x1c
|
&& GET_GREENMASK(v)==0x1c
|
||||||
&& GET_BLUEMASK(v) ==0x03
|
&& GET_BLUEMASK(v) ==0x03
|
||||||
&& CHECK_FOR_HPCR(v)) {
|
&& CHECK_FOR_HPCR(v)) {
|
||||||
|
/* 8-bit HP color recovery */
|
||||||
setup_8bit_hpcr( v );
|
setup_8bit_hpcr( v );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1050,10 +1036,16 @@ setup_monochrome( XMesaVisual v, XMesaBuffer b )
|
|||||||
* \return GL_TRUE=success, GL_FALSE=failure
|
* \return GL_TRUE=success, GL_FALSE=failure
|
||||||
*/
|
*/
|
||||||
static GLboolean
|
static GLboolean
|
||||||
initialize_visual_and_buffer(int client, XMesaVisual v, XMesaBuffer b,
|
initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b,
|
||||||
GLboolean rgb_flag, XMesaDrawable window,
|
GLboolean rgb_flag, XMesaDrawable window,
|
||||||
XMesaColormap cmap)
|
XMesaColormap cmap)
|
||||||
{
|
{
|
||||||
|
int client = 0;
|
||||||
|
|
||||||
|
#ifdef XFree86Server
|
||||||
|
client = (window) ? CLIENT_ID(window->id) : 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
ASSERT(!b || b->xm_visual == v);
|
ASSERT(!b || b->xm_visual == v);
|
||||||
|
|
||||||
/* Save true bits/pixel */
|
/* Save true bits/pixel */
|
||||||
@@ -1117,6 +1109,8 @@ initialize_visual_and_buffer(int client, XMesaVisual v, XMesaBuffer b,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (b && window) {
|
if (b && window) {
|
||||||
|
char *data;
|
||||||
|
|
||||||
/* Do window-specific initializations */
|
/* Do window-specific initializations */
|
||||||
|
|
||||||
/* these should have been set in create_xmesa_buffer */
|
/* these should have been set in create_xmesa_buffer */
|
||||||
@@ -1184,15 +1178,15 @@ initialize_visual_and_buffer(int client, XMesaVisual v, XMesaBuffer b,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the row buffer XImage for use in write_color_span() */
|
/* Initialize the row buffer XImage for use in write_color_span() */
|
||||||
|
data = (char*) MALLOC(MAX_WIDTH*4);
|
||||||
#ifdef XFree86Server
|
#ifdef XFree86Server
|
||||||
b->rowimage = XMesaCreateImage(GET_VISUAL_DEPTH(v), MAX_WIDTH, 1,
|
b->rowimage = XMesaCreateImage(GET_VISUAL_DEPTH(v), MAX_WIDTH, 1, data);
|
||||||
(char *)MALLOC(MAX_WIDTH*4));
|
|
||||||
#else
|
#else
|
||||||
b->rowimage = XCreateImage( v->display,
|
b->rowimage = XCreateImage( v->display,
|
||||||
v->visinfo->visual,
|
v->visinfo->visual,
|
||||||
v->visinfo->depth,
|
v->visinfo->depth,
|
||||||
ZPixmap, 0, /*format, offset*/
|
ZPixmap, 0, /*format, offset*/
|
||||||
(char*) MALLOC(MAX_WIDTH*4), /*data*/
|
data, /*data*/
|
||||||
MAX_WIDTH, 1, /*width, height*/
|
MAX_WIDTH, 1, /*width, height*/
|
||||||
32, /*bitmap_pad*/
|
32, /*bitmap_pad*/
|
||||||
0 /*bytes_per_line*/ );
|
0 /*bytes_per_line*/ );
|
||||||
@@ -1322,6 +1316,7 @@ xmesa_convert_from_x_visual_type( int visualType )
|
|||||||
* visualCaveat - ala the GLX extension, usually GLX_NONE
|
* visualCaveat - ala the GLX extension, usually GLX_NONE
|
||||||
* Return; a new XMesaVisual or 0 if error.
|
* Return; a new XMesaVisual or 0 if error.
|
||||||
*/
|
*/
|
||||||
|
PUBLIC
|
||||||
XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
|
XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
|
||||||
XMesaVisualInfo visinfo,
|
XMesaVisualInfo visinfo,
|
||||||
GLboolean rgb_flag,
|
GLboolean rgb_flag,
|
||||||
@@ -1359,11 +1354,6 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* In the X server, NULL is passed in for the display. It will have
|
|
||||||
* to be set before using this visual. See XMesaSetVisualDisplay()
|
|
||||||
* below.
|
|
||||||
*/
|
|
||||||
v->display = display;
|
v->display = display;
|
||||||
|
|
||||||
/* Save a copy of the XVisualInfo struct because the user may X_mesa_free()
|
/* Save a copy of the XVisualInfo struct because the user may X_mesa_free()
|
||||||
@@ -1425,7 +1415,10 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
|
|||||||
|
|
||||||
v->mesa_visual.visualRating = visualCaveat;
|
v->mesa_visual.visualRating = visualCaveat;
|
||||||
|
|
||||||
(void) initialize_visual_and_buffer( 0, v, NULL, rgb_flag, 0, 0 );
|
if (alpha_flag)
|
||||||
|
v->mesa_visual.alphaBits = 8;
|
||||||
|
|
||||||
|
(void) initialize_visual_and_buffer( v, NULL, rgb_flag, 0, 0 );
|
||||||
|
|
||||||
{
|
{
|
||||||
const int xclass = v->mesa_visual.visualType;
|
const int xclass = v->mesa_visual.visualType;
|
||||||
@@ -1433,7 +1426,6 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
|
|||||||
red_bits = _mesa_bitcount(GET_REDMASK(v));
|
red_bits = _mesa_bitcount(GET_REDMASK(v));
|
||||||
green_bits = _mesa_bitcount(GET_GREENMASK(v));
|
green_bits = _mesa_bitcount(GET_GREENMASK(v));
|
||||||
blue_bits = _mesa_bitcount(GET_BLUEMASK(v));
|
blue_bits = _mesa_bitcount(GET_BLUEMASK(v));
|
||||||
alpha_bits = 0;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* this is an approximation */
|
/* this is an approximation */
|
||||||
@@ -1447,11 +1439,9 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
|
|||||||
alpha_bits = 0;
|
alpha_bits = 0;
|
||||||
assert( red_bits + green_bits + blue_bits == GET_VISUAL_DEPTH(v) );
|
assert( red_bits + green_bits + blue_bits == GET_VISUAL_DEPTH(v) );
|
||||||
}
|
}
|
||||||
|
alpha_bits = v->mesa_visual.alphaBits;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alpha_flag && alpha_bits == 0)
|
|
||||||
alpha_bits = 8;
|
|
||||||
|
|
||||||
_mesa_initialize_visual( &v->mesa_visual,
|
_mesa_initialize_visual( &v->mesa_visual,
|
||||||
rgb_flag, db_flag, stereo_flag,
|
rgb_flag, db_flag, stereo_flag,
|
||||||
red_bits, green_bits,
|
red_bits, green_bits,
|
||||||
@@ -1469,12 +1459,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void XMesaSetVisualDisplay( XMesaDisplay *dpy, XMesaVisual v )
|
PUBLIC
|
||||||
{
|
|
||||||
v->display = dpy;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void XMesaDestroyVisual( XMesaVisual v )
|
void XMesaDestroyVisual( XMesaVisual v )
|
||||||
{
|
{
|
||||||
#ifndef XFree86Server
|
#ifndef XFree86Server
|
||||||
@@ -1492,6 +1477,7 @@ void XMesaDestroyVisual( XMesaVisual v )
|
|||||||
* lists or NULL if no sharing is wanted.
|
* lists or NULL if no sharing is wanted.
|
||||||
* \return an XMesaContext or NULL if error.
|
* \return an XMesaContext or NULL if error.
|
||||||
*/
|
*/
|
||||||
|
PUBLIC
|
||||||
XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
|
XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
|
||||||
{
|
{
|
||||||
static GLboolean firstTime = GL_TRUE;
|
static GLboolean firstTime = GL_TRUE;
|
||||||
@@ -1575,15 +1561,15 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PUBLIC
|
||||||
void XMesaDestroyContext( XMesaContext c )
|
void XMesaDestroyContext( XMesaContext c )
|
||||||
{
|
{
|
||||||
GLcontext *mesaCtx = &c->mesa;
|
GLcontext *mesaCtx = &c->mesa;
|
||||||
#ifdef FX
|
|
||||||
XMesaBuffer xmbuf = XMESA_BUFFER(mesaCtx->DrawBuffer);
|
|
||||||
|
|
||||||
if (xmbuf && xmbuf->FXctx)
|
#ifdef FX
|
||||||
fxMesaDestroyContext(xmbuf->FXctx);
|
FXdestroyContext( XMESA_BUFFER(mesaCtx->DrawBuffer) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_swsetup_DestroyContext( mesaCtx );
|
_swsetup_DestroyContext( mesaCtx );
|
||||||
_swrast_DestroyContext( mesaCtx );
|
_swrast_DestroyContext( mesaCtx );
|
||||||
_tnl_DestroyContext( mesaCtx );
|
_tnl_DestroyContext( mesaCtx );
|
||||||
@@ -1599,44 +1585,33 @@ void XMesaDestroyContext( XMesaContext c )
|
|||||||
* X window or pixmap.
|
* X window or pixmap.
|
||||||
* \param v the window's XMesaVisual
|
* \param v the window's XMesaVisual
|
||||||
* \param w the window we're wrapping
|
* \param w the window we're wrapping
|
||||||
* \param c context used to initialize the buffer if 3Dfx mode in use.
|
|
||||||
* \return new XMesaBuffer or NULL if error
|
* \return new XMesaBuffer or NULL if error
|
||||||
*/
|
*/
|
||||||
XMesaBuffer
|
PUBLIC XMesaBuffer
|
||||||
XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c)
|
XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w)
|
||||||
{
|
{
|
||||||
#ifndef XFree86Server
|
#ifndef XFree86Server
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
#endif
|
#endif
|
||||||
#ifdef FX
|
|
||||||
char *fxEnvVar;
|
|
||||||
#endif
|
|
||||||
int client = 0;
|
|
||||||
XMesaBuffer b;
|
XMesaBuffer b;
|
||||||
XMesaColormap cmap;
|
XMesaColormap cmap;
|
||||||
|
int depth;
|
||||||
|
|
||||||
assert(v);
|
assert(v);
|
||||||
assert(w);
|
assert(w);
|
||||||
(void) c;
|
|
||||||
|
|
||||||
/* Check that window depth matches visual depth */
|
/* Check that window depth matches visual depth */
|
||||||
#ifdef XFree86Server
|
#ifdef XFree86Server
|
||||||
client = CLIENT_ID(((XMesaDrawable)w)->id);
|
depth = ((XMesaDrawable)w)->depth;
|
||||||
|
|
||||||
if (GET_VISUAL_DEPTH(v) != ((XMesaDrawable)w)->depth) {
|
|
||||||
_mesa_warning(NULL, "XMesaCreateWindowBuffer: depth mismatch between visual (%d) and window (%d)!\n",
|
|
||||||
GET_VISUAL_DEPTH(v), ((XMesaDrawable) w)->depth);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
XGetWindowAttributes( v->display, w, &attr );
|
XGetWindowAttributes( v->display, w, &attr );
|
||||||
|
depth = attr.depth;
|
||||||
if (GET_VISUAL_DEPTH(v) != attr.depth) {
|
#endif
|
||||||
|
if (GET_VISUAL_DEPTH(v) != depth) {
|
||||||
_mesa_warning(NULL, "XMesaCreateWindowBuffer: depth mismatch between visual (%d) and window (%d)!\n",
|
_mesa_warning(NULL, "XMesaCreateWindowBuffer: depth mismatch between visual (%d) and window (%d)!\n",
|
||||||
GET_VISUAL_DEPTH(v), attr.depth);
|
GET_VISUAL_DEPTH(v), depth);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Find colormap */
|
/* Find colormap */
|
||||||
#ifdef XFree86Server
|
#ifdef XFree86Server
|
||||||
@@ -1657,101 +1632,16 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c)
|
|||||||
if (!b)
|
if (!b)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!initialize_visual_and_buffer( client, v, b, v->mesa_visual.rgbMode,
|
if (!initialize_visual_and_buffer( v, b, v->mesa_visual.rgbMode,
|
||||||
(XMesaDrawable) w, cmap )) {
|
(XMesaDrawable) w, cmap )) {
|
||||||
xmesa_free_buffer(b);
|
xmesa_free_buffer(b);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FX
|
|
||||||
fxEnvVar = _mesa_getenv("MESA_GLX_FX");
|
|
||||||
if (fxEnvVar) {
|
|
||||||
if (fxEnvVar[0]!='d') {
|
|
||||||
int attribs[100];
|
|
||||||
int numAttribs = 0;
|
|
||||||
int hw;
|
|
||||||
if (v->mesa_visual.depthBits > 0) {
|
|
||||||
attribs[numAttribs++] = FXMESA_DEPTH_SIZE;
|
|
||||||
attribs[numAttribs++] = v->mesa_visual.depthBits;
|
|
||||||
}
|
|
||||||
if (v->mesa_visual.doubleBufferMode) {
|
|
||||||
attribs[numAttribs++] = FXMESA_DOUBLEBUFFER;
|
|
||||||
}
|
|
||||||
if (v->mesa_visual.accumRedBits > 0) {
|
|
||||||
attribs[numAttribs++] = FXMESA_ACCUM_SIZE;
|
|
||||||
attribs[numAttribs++] = v->mesa_visual.accumRedBits;
|
|
||||||
}
|
|
||||||
if (v->mesa_visual.stencilBits > 0) {
|
|
||||||
attribs[numAttribs++] = FXMESA_STENCIL_SIZE;
|
|
||||||
attribs[numAttribs++] = v->mesa_visual.stencilBits;
|
|
||||||
}
|
|
||||||
if (v->mesa_visual.alphaBits > 0) {
|
|
||||||
attribs[numAttribs++] = FXMESA_ALPHA_SIZE;
|
|
||||||
attribs[numAttribs++] = v->mesa_visual.alphaBits;
|
|
||||||
}
|
|
||||||
if (1) {
|
|
||||||
attribs[numAttribs++] = FXMESA_SHARE_CONTEXT;
|
|
||||||
attribs[numAttribs++] = (int) &(c->mesa);
|
|
||||||
}
|
|
||||||
attribs[numAttribs++] = FXMESA_NONE;
|
|
||||||
|
|
||||||
/* [dBorca] we should take an envvar for `fxMesaSelectCurrentBoard'!!! */
|
|
||||||
hw = fxMesaSelectCurrentBoard(0);
|
|
||||||
|
|
||||||
/* if these fail, there's a new bug somewhere */
|
|
||||||
ASSERT(b->mesa_buffer.Width > 0);
|
|
||||||
ASSERT(b->mesa_buffer.Height > 0);
|
|
||||||
|
|
||||||
if ((hw == GR_SSTTYPE_VOODOO) || (hw == GR_SSTTYPE_Voodoo2)) {
|
|
||||||
b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width,
|
|
||||||
b->mesa_buffer.Height, attribs);
|
|
||||||
if ((v->undithered_pf!=PF_Index) && (b->backxrb->ximage)) {
|
|
||||||
b->FXisHackUsable = b->FXctx ? GL_TRUE : GL_FALSE;
|
|
||||||
if (b->FXctx && (fxEnvVar[0]=='w' || fxEnvVar[0]=='W')) {
|
|
||||||
b->FXwindowHack = GL_TRUE;
|
|
||||||
FX_grSstControl(GR_CONTROL_DEACTIVATE);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
b->FXwindowHack = GL_FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (fxEnvVar[0]=='w' || fxEnvVar[0]=='W')
|
|
||||||
b->FXctx = fxMesaCreateContext(w, GR_RESOLUTION_NONE,
|
|
||||||
GR_REFRESH_75Hz, attribs);
|
|
||||||
else
|
|
||||||
b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width,
|
|
||||||
b->mesa_buffer.Height, attribs);
|
|
||||||
b->FXisHackUsable = GL_FALSE;
|
|
||||||
b->FXwindowHack = GL_FALSE;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
fprintf(stderr,
|
|
||||||
"voodoo %d, wid %d height %d hack: usable %d active %d\n",
|
|
||||||
hw, b->mesa_buffer.Width, b->mesa_buffer.Height,
|
|
||||||
b->FXisHackUsable, b->FXwindowHack);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_mesa_warning(NULL, "WARNING: This Mesa Library includes the Glide driver but\n");
|
|
||||||
_mesa_warning(NULL, " you have not defined the MESA_GLX_FX env. var.\n");
|
|
||||||
_mesa_warning(NULL, " (check the README.3DFX file for more information).\n\n");
|
|
||||||
_mesa_warning(NULL, " you can disable this message with a 'export MESA_GLX_FX=disable'.\n");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
XMesaBuffer
|
|
||||||
XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w)
|
|
||||||
{
|
|
||||||
return XMesaCreateWindowBuffer2( v, w, NULL );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new XMesaBuffer from an X pixmap.
|
* Create a new XMesaBuffer from an X pixmap.
|
||||||
@@ -1762,10 +1652,9 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w)
|
|||||||
* \c GLX_DIRECT_COLOR visual for the pixmap
|
* \c GLX_DIRECT_COLOR visual for the pixmap
|
||||||
* \returns new XMesaBuffer or NULL if error
|
* \returns new XMesaBuffer or NULL if error
|
||||||
*/
|
*/
|
||||||
XMesaBuffer
|
PUBLIC XMesaBuffer
|
||||||
XMesaCreatePixmapBuffer(XMesaVisual v, XMesaPixmap p, XMesaColormap cmap)
|
XMesaCreatePixmapBuffer(XMesaVisual v, XMesaPixmap p, XMesaColormap cmap)
|
||||||
{
|
{
|
||||||
int client = 0;
|
|
||||||
XMesaBuffer b;
|
XMesaBuffer b;
|
||||||
|
|
||||||
assert(v);
|
assert(v);
|
||||||
@@ -1774,11 +1663,7 @@ XMesaCreatePixmapBuffer(XMesaVisual v, XMesaPixmap p, XMesaColormap cmap)
|
|||||||
if (!b)
|
if (!b)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
#ifdef XFree86Server
|
if (!initialize_visual_and_buffer(v, b, v->mesa_visual.rgbMode,
|
||||||
client = CLIENT_ID(((XMesaDrawable)p)->id);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!initialize_visual_and_buffer(client, v, b, v->mesa_visual.rgbMode,
|
|
||||||
(XMesaDrawable) p, cmap)) {
|
(XMesaDrawable) p, cmap)) {
|
||||||
xmesa_free_buffer(b);
|
xmesa_free_buffer(b);
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -1793,10 +1678,7 @@ XMesaBuffer
|
|||||||
XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap,
|
XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap,
|
||||||
unsigned int width, unsigned int height)
|
unsigned int width, unsigned int height)
|
||||||
{
|
{
|
||||||
#ifdef XFree86Server
|
#ifndef XFree86Server
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
int client = 0;
|
|
||||||
XMesaWindow root;
|
XMesaWindow root;
|
||||||
XMesaDrawable drawable; /* X Pixmap Drawable */
|
XMesaDrawable drawable; /* X Pixmap Drawable */
|
||||||
XMesaBuffer b;
|
XMesaBuffer b;
|
||||||
@@ -1812,13 +1694,15 @@ XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap,
|
|||||||
if (!b)
|
if (!b)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!initialize_visual_and_buffer(client, v, b, v->mesa_visual.rgbMode,
|
if (!initialize_visual_and_buffer(v, b, v->mesa_visual.rgbMode,
|
||||||
drawable, cmap)) {
|
drawable, cmap)) {
|
||||||
xmesa_free_buffer(b);
|
xmesa_free_buffer(b);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1827,7 +1711,7 @@ XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap,
|
|||||||
/*
|
/*
|
||||||
* Deallocate an XMesaBuffer structure and all related info.
|
* Deallocate an XMesaBuffer structure and all related info.
|
||||||
*/
|
*/
|
||||||
void
|
PUBLIC void
|
||||||
XMesaDestroyBuffer(XMesaBuffer b)
|
XMesaDestroyBuffer(XMesaBuffer b)
|
||||||
{
|
{
|
||||||
xmesa_free_buffer(b);
|
xmesa_free_buffer(b);
|
||||||
@@ -1870,6 +1754,7 @@ GLboolean XMesaMakeCurrent( XMesaContext c, XMesaBuffer b )
|
|||||||
/*
|
/*
|
||||||
* Bind buffer b to context c and make c the current rendering context.
|
* Bind buffer b to context c and make c the current rendering context.
|
||||||
*/
|
*/
|
||||||
|
PUBLIC
|
||||||
GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
|
GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
|
||||||
XMesaBuffer readBuffer )
|
XMesaBuffer readBuffer )
|
||||||
{
|
{
|
||||||
@@ -1877,15 +1762,6 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
|
|||||||
if (!drawBuffer || !readBuffer)
|
if (!drawBuffer || !readBuffer)
|
||||||
return GL_FALSE; /* must specify buffers! */
|
return GL_FALSE; /* must specify buffers! */
|
||||||
|
|
||||||
#ifdef FX
|
|
||||||
if (drawBuffer->FXctx) {
|
|
||||||
fxMesaMakeCurrent(drawBuffer->FXctx);
|
|
||||||
|
|
||||||
c->xm_buffer = drawBuffer;
|
|
||||||
|
|
||||||
return GL_TRUE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (&(c->mesa) == _mesa_get_current_context()
|
if (&(c->mesa) == _mesa_get_current_context()
|
||||||
&& c->mesa.DrawBuffer == &drawBuffer->mesa_buffer
|
&& c->mesa.DrawBuffer == &drawBuffer->mesa_buffer
|
||||||
&& c->mesa.ReadBuffer == &readBuffer->mesa_buffer
|
&& c->mesa.ReadBuffer == &readBuffer->mesa_buffer
|
||||||
@@ -1896,6 +1772,11 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
|
|||||||
|
|
||||||
c->xm_buffer = drawBuffer;
|
c->xm_buffer = drawBuffer;
|
||||||
|
|
||||||
|
#ifdef FX
|
||||||
|
if (FXmakeCurrent( drawBuffer ))
|
||||||
|
return GL_TRUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Call this periodically to detect when the user has begun using
|
/* Call this periodically to detect when the user has begun using
|
||||||
* GL rendering from multiple threads.
|
* GL rendering from multiple threads.
|
||||||
*/
|
*/
|
||||||
@@ -1983,9 +1864,13 @@ XMesaBuffer XMesaGetCurrentReadBuffer( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XFree86Server
|
||||||
|
PUBLIC
|
||||||
GLboolean XMesaForceCurrent(XMesaContext c)
|
GLboolean XMesaForceCurrent(XMesaContext c)
|
||||||
{
|
{
|
||||||
if (c) {
|
if (c) {
|
||||||
|
_glapi_set_dispatch(c->mesa.CurrentDispatch);
|
||||||
|
|
||||||
if (&(c->mesa) != _mesa_get_current_context()) {
|
if (&(c->mesa) != _mesa_get_current_context()) {
|
||||||
_mesa_make_current(&c->mesa, c->mesa.DrawBuffer, c->mesa.ReadBuffer);
|
_mesa_make_current(&c->mesa, c->mesa.DrawBuffer, c->mesa.ReadBuffer);
|
||||||
}
|
}
|
||||||
@@ -1997,6 +1882,7 @@ GLboolean XMesaForceCurrent(XMesaContext c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PUBLIC
|
||||||
GLboolean XMesaLoseCurrent(XMesaContext c)
|
GLboolean XMesaLoseCurrent(XMesaContext c)
|
||||||
{
|
{
|
||||||
(void) c;
|
(void) c;
|
||||||
@@ -2005,150 +1891,30 @@ GLboolean XMesaLoseCurrent(XMesaContext c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
PUBLIC
|
||||||
* Switch 3Dfx support hack between window and full-screen mode.
|
GLboolean XMesaCopyContext( XMesaContext xm_src, XMesaContext xm_dst, GLuint mask )
|
||||||
*/
|
{
|
||||||
|
_mesa_copy_context(&xm_src->mesa, &xm_dst->mesa, mask);
|
||||||
|
return GL_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* XFree86Server */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef FX
|
||||||
GLboolean XMesaSetFXmode( GLint mode )
|
GLboolean XMesaSetFXmode( GLint mode )
|
||||||
{
|
{
|
||||||
#ifdef FX
|
|
||||||
const char *fx = _mesa_getenv("MESA_GLX_FX");
|
|
||||||
if (fx && fx[0] != 'd') {
|
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
|
||||||
GrHwConfiguration hw;
|
|
||||||
if (!FX_grSstQueryHardware(&hw)) {
|
|
||||||
/*fprintf(stderr, "!grSstQueryHardware\n");*/
|
|
||||||
return GL_FALSE;
|
|
||||||
}
|
|
||||||
if (hw.num_sst < 1) {
|
|
||||||
/*fprintf(stderr, "hw.num_sst < 1\n");*/
|
|
||||||
return GL_FALSE;
|
|
||||||
}
|
|
||||||
if (ctx) {
|
|
||||||
/* [dBorca] Hack alert:
|
|
||||||
* oh, this is sooo wrong: ctx above is
|
|
||||||
* really an fxMesaContext, not an XMesaContext
|
|
||||||
*/
|
|
||||||
XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
|
|
||||||
if (mode == XMESA_FX_WINDOW) {
|
|
||||||
if (xmbuf->FXisHackUsable) {
|
|
||||||
FX_grSstControl(GR_CONTROL_DEACTIVATE);
|
|
||||||
xmbuf->FXwindowHack = GL_TRUE;
|
|
||||||
return GL_TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (mode == XMESA_FX_FULLSCREEN) {
|
|
||||||
FX_grSstControl(GR_CONTROL_ACTIVATE);
|
|
||||||
xmbuf->FXwindowHack = GL_FALSE;
|
|
||||||
return GL_TRUE;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* Error: Bad mode value */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*fprintf(stderr, "fallthrough\n");*/
|
|
||||||
#else
|
|
||||||
(void) mode;
|
(void) mode;
|
||||||
#endif
|
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef FX
|
|
||||||
/*
|
|
||||||
* Read image from VooDoo frame buffer into X/Mesa's back XImage.
|
|
||||||
*/
|
|
||||||
static void FXgetImage( XMesaBuffer b )
|
|
||||||
{
|
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
|
||||||
static unsigned short pixbuf[MAX_WIDTH];
|
|
||||||
GLuint x, y;
|
|
||||||
GLuint width, height;
|
|
||||||
XMesaContext xmesa = XMESA_CONTEXT(ctx);
|
|
||||||
|
|
||||||
#ifdef XFree86Server
|
|
||||||
x = b->frontxrb->pixmap->x;
|
|
||||||
y = b->frontxrb->pixmap->y;
|
|
||||||
width = b->frontxrb->pixmap->width;
|
|
||||||
height = b->frontxrb->pixmap->height;
|
|
||||||
depth = b->frontxrb->pixmap->depth;
|
|
||||||
#else
|
|
||||||
xmesa_get_window_size(b->display, b, &width, &height);
|
|
||||||
x = y = 0;
|
|
||||||
#endif
|
#endif
|
||||||
if (b->mesa_buffer.Width != width || b->mesa_buffer.Height != height) {
|
|
||||||
b->mesa_buffer.Width = MIN2((int)width, b->FXctx->width);
|
|
||||||
b->mesa_buffer.Height = MIN2((int)height, b->FXctx->height);
|
|
||||||
if (b->mesa_buffer.Width & 1)
|
|
||||||
b->mesa_buffer.Width--; /* prevent odd width */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* [dBorca] we're always in the right GR_COLORFORMAT... aren't we? */
|
|
||||||
/* grLfbWriteColorFormat(GR_COLORFORMAT_ARGB); */
|
|
||||||
if (b->xm_visual->undithered_pf==PF_5R6G5B) {
|
|
||||||
/* Special case: 16bpp RGB */
|
|
||||||
grLfbReadRegion( GR_BUFFER_FRONTBUFFER, /* src buffer */
|
|
||||||
0, b->FXctx->height - b->mesa_buffer.Height, /*pos*/
|
|
||||||
b->mesa_buffer.Width, b->mesa_buffer.Height, /* size */
|
|
||||||
b->mesa_buffer.Width * sizeof(GLushort), /* stride */
|
|
||||||
b->backxrb->ximage->data); /* dest buffer */
|
|
||||||
}
|
|
||||||
else if (b->xm_visual->dithered_pf==PF_Dither
|
|
||||||
&& GET_VISUAL_DEPTH(b->xm_visual)==8) {
|
|
||||||
/* Special case: 8bpp RGB */
|
|
||||||
for (y=0;y<b->mesa_buffer.Height;y++) {
|
|
||||||
GLubyte *ptr = (GLubyte*) b->backxrb->ximage->data
|
|
||||||
+ b->backxrb->ximage->bytes_per_line * y;
|
|
||||||
XDITHER_SETUP(y);
|
|
||||||
|
|
||||||
/* read row from 3Dfx frame buffer */
|
|
||||||
grLfbReadRegion( GR_BUFFER_FRONTBUFFER,
|
|
||||||
0, b->FXctx->height-(b->mesa_buffer.Height-y),
|
|
||||||
b->mesa_buffer.Width, 1,
|
|
||||||
0,
|
|
||||||
pixbuf );
|
|
||||||
|
|
||||||
/* write to XImage back buffer */
|
|
||||||
for (x=0;x<b->mesa_buffer.Width;x++) {
|
|
||||||
GLubyte r = (pixbuf[x] & 0xf800) >> 8;
|
|
||||||
GLubyte g = (pixbuf[x] & 0x07e0) >> 3;
|
|
||||||
GLubyte b = (pixbuf[x] & 0x001f) << 3;
|
|
||||||
*ptr++ = XDITHER( x, r, g, b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* General case: slow! */
|
|
||||||
for (y=0;y<b->mesa_buffer.Height;y++) {
|
|
||||||
/* read row from 3Dfx frame buffer */
|
|
||||||
grLfbReadRegion( GR_BUFFER_FRONTBUFFER,
|
|
||||||
0, b->FXctx->height-(b->mesa_buffer.Height-y),
|
|
||||||
b->mesa_buffer.Width, 1,
|
|
||||||
0,
|
|
||||||
pixbuf );
|
|
||||||
|
|
||||||
/* write to XImage back buffer */
|
|
||||||
for (x=0;x<b->mesa_buffer.Width;x++) {
|
|
||||||
XMesaPutPixel(b->backxrb->ximage,x,y,
|
|
||||||
xmesa_color_to_pixel(ctx,
|
|
||||||
(pixbuf[x] & 0xf800) >> 8,
|
|
||||||
(pixbuf[x] & 0x07e0) >> 3,
|
|
||||||
(pixbuf[x] & 0x001f) << 3,
|
|
||||||
0xff,
|
|
||||||
b->xm_visual->undithered_pf));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy the back buffer to the front buffer. If there's no back buffer
|
* Copy the back buffer to the front buffer. If there's no back buffer
|
||||||
* this is a no-op.
|
* this is a no-op.
|
||||||
*/
|
*/
|
||||||
|
PUBLIC
|
||||||
void XMesaSwapBuffers( XMesaBuffer b )
|
void XMesaSwapBuffers( XMesaBuffer b )
|
||||||
{
|
{
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
@@ -2166,16 +1932,10 @@ void XMesaSwapBuffers( XMesaBuffer b )
|
|||||||
|
|
||||||
if (b->db_mode) {
|
if (b->db_mode) {
|
||||||
#ifdef FX
|
#ifdef FX
|
||||||
if (b->FXctx) {
|
if (FXswapBuffers(b))
|
||||||
fxMesaSwapBuffers();
|
return;
|
||||||
|
|
||||||
if (b->FXwindowHack)
|
|
||||||
FXgetImage(b);
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
if (b->backxrb->ximage) {
|
if (b->backxrb->ximage) {
|
||||||
/* Copy Ximage (back buf) from client memory to server window */
|
/* Copy Ximage (back buf) from client memory to server window */
|
||||||
#if defined(USE_XSHM) && !defined(XFree86Server)
|
#if defined(USE_XSHM) && !defined(XFree86Server)
|
||||||
if (b->shm) {
|
if (b->shm) {
|
||||||
@@ -2242,13 +2002,8 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height )
|
|||||||
if (b->db_mode) {
|
if (b->db_mode) {
|
||||||
int yTop = b->mesa_buffer.Height - y - height;
|
int yTop = b->mesa_buffer.Height - y - height;
|
||||||
#ifdef FX
|
#ifdef FX
|
||||||
if (b->FXctx) {
|
if (FXswapBuffers(b))
|
||||||
fxMesaSwapBuffers();
|
return;
|
||||||
if (b->FXwindowHack)
|
|
||||||
FXgetImage(b);
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
if (b->backxrb->ximage) {
|
if (b->backxrb->ximage) {
|
||||||
/* Copy Ximage from host's memory to server's window */
|
/* Copy Ximage from host's memory to server's window */
|
||||||
@@ -2426,15 +2181,6 @@ void XMesaGarbageCollect( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void XMesaReset( void )
|
|
||||||
{
|
|
||||||
while (XMesaBufferList)
|
|
||||||
XMesaDestroyBuffer(XMesaBufferList);
|
|
||||||
|
|
||||||
XMesaBufferList = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y,
|
unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y,
|
||||||
GLfloat red, GLfloat green,
|
GLfloat red, GLfloat green,
|
||||||
GLfloat blue, GLfloat alpha )
|
GLfloat blue, GLfloat alpha )
|
||||||
@@ -2498,7 +2244,7 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y,
|
|||||||
* This is typically called when the window size changes and we need
|
* This is typically called when the window size changes and we need
|
||||||
* to reallocate the buffer's back/depth/stencil/accum buffers.
|
* to reallocate the buffer's back/depth/stencil/accum buffers.
|
||||||
*/
|
*/
|
||||||
void
|
PUBLIC void
|
||||||
XMesaResizeBuffers( XMesaBuffer b )
|
XMesaResizeBuffers( XMesaBuffer b )
|
||||||
{
|
{
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
#include "renderbuffer.h"
|
#include "renderbuffer.h"
|
||||||
|
|
||||||
|
|
||||||
#ifndef XFree86Server
|
#if defined(USE_XSHM) && !defined(XFree86Server)
|
||||||
static volatile int mesaXErrorFlag = 0;
|
static volatile int mesaXErrorFlag = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,18 +51,14 @@ mesaHandleXError(XMesaDisplay *dpy, XErrorEvent *event)
|
|||||||
mesaXErrorFlag = 1;
|
mesaXErrorFlag = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocate a shared memory XImage back buffer for the given XMesaBuffer.
|
* Allocate a shared memory XImage back buffer for the given XMesaBuffer.
|
||||||
* Return: GL_TRUE if success, GL_FALSE if error
|
* Return: GL_TRUE if success, GL_FALSE if error
|
||||||
*/
|
*/
|
||||||
#ifndef XFree86Server
|
|
||||||
static GLboolean
|
static GLboolean
|
||||||
alloc_back_shm_ximage(XMesaBuffer b, GLuint width, GLuint height)
|
alloc_back_shm_ximage(XMesaBuffer b, GLuint width, GLuint height)
|
||||||
{
|
{
|
||||||
#ifdef USE_XSHM
|
|
||||||
/*
|
/*
|
||||||
* We have to do a _lot_ of error checking here to be sure we can
|
* We have to do a _lot_ of error checking here to be sure we can
|
||||||
* really use the XSHM extension. It seems different servers trigger
|
* really use the XSHM extension. It seems different servers trigger
|
||||||
@@ -152,10 +148,13 @@ alloc_back_shm_ximage(XMesaBuffer b, GLuint width, GLuint height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
|
static GLboolean
|
||||||
|
alloc_back_shm_ximage(XMesaBuffer b, GLuint width, GLuint height)
|
||||||
|
{
|
||||||
/* Can't compile XSHM support */
|
/* Can't compile XSHM support */
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -187,14 +186,12 @@ alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* Allocate new back buffer */
|
/* Allocate new back buffer */
|
||||||
#ifdef XFree86Server
|
|
||||||
/* Allocate a regular XImage for the back buffer. */
|
|
||||||
b->backxrb->ximage = XMesaCreateImage(b->xm_visual->BitsPerPixel,
|
|
||||||
width, height, NULL);
|
|
||||||
{
|
|
||||||
#else
|
|
||||||
if (b->shm == 0 || !alloc_back_shm_ximage(b, width, height)) {
|
if (b->shm == 0 || !alloc_back_shm_ximage(b, width, height)) {
|
||||||
/* Allocate a regular XImage for the back buffer. */
|
/* Allocate a regular XImage for the back buffer. */
|
||||||
|
#ifdef XFree86Server
|
||||||
|
b->backxrb->ximage = XMesaCreateImage(b->xm_visual->BitsPerPixel,
|
||||||
|
width, height, NULL);
|
||||||
|
#else
|
||||||
b->backxrb->ximage = XCreateImage(b->xm_visual->display,
|
b->backxrb->ximage = XCreateImage(b->xm_visual->display,
|
||||||
b->xm_visual->visinfo->visual,
|
b->xm_visual->visinfo->visual,
|
||||||
GET_VISUAL_DEPTH(b->xm_visual),
|
GET_VISUAL_DEPTH(b->xm_visual),
|
||||||
@@ -386,18 +383,18 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (b->gc)
|
if (b->gc)
|
||||||
XMesaFreeGC(b->xm_visual->display, b->gc);
|
XMesaFreeGC(b->display, b->gc);
|
||||||
if (b->cleargc)
|
if (b->cleargc)
|
||||||
XMesaFreeGC(b->xm_visual->display, b->cleargc);
|
XMesaFreeGC(b->display, b->cleargc);
|
||||||
if (b->swapgc)
|
if (b->swapgc)
|
||||||
XMesaFreeGC(b->xm_visual->display, b->swapgc);
|
XMesaFreeGC(b->display, b->swapgc);
|
||||||
|
|
||||||
if (b->xm_visual->mesa_visual.doubleBufferMode) {
|
if (fb->Visual.doubleBufferMode) {
|
||||||
/* free back ximage/pixmap/shmregion */
|
/* free back ximage/pixmap/shmregion */
|
||||||
if (b->backxrb->ximage) {
|
if (b->backxrb->ximage) {
|
||||||
#if defined(USE_XSHM) && !defined(XFree86Server)
|
#if defined(USE_XSHM) && !defined(XFree86Server)
|
||||||
if (b->shm) {
|
if (b->shm) {
|
||||||
XShmDetach( b->xm_visual->display, &b->shminfo );
|
XShmDetach( b->display, &b->shminfo );
|
||||||
XDestroyImage( b->backxrb->ximage );
|
XDestroyImage( b->backxrb->ximage );
|
||||||
shmdt( b->shminfo.shmaddr );
|
shmdt( b->shminfo.shmaddr );
|
||||||
}
|
}
|
||||||
@@ -407,9 +404,9 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb)
|
|||||||
b->backxrb->ximage = NULL;
|
b->backxrb->ximage = NULL;
|
||||||
}
|
}
|
||||||
if (b->backxrb->pixmap) {
|
if (b->backxrb->pixmap) {
|
||||||
XMesaFreePixmap( b->xm_visual->display, b->backxrb->pixmap );
|
XMesaFreePixmap( b->display, b->backxrb->pixmap );
|
||||||
if (b->xm_visual->hpcr_clear_flag) {
|
if (b->xm_visual->hpcr_clear_flag) {
|
||||||
XMesaFreePixmap( b->xm_visual->display,
|
XMesaFreePixmap( b->display,
|
||||||
b->xm_visual->hpcr_clear_pixmap );
|
b->xm_visual->hpcr_clear_pixmap );
|
||||||
XMesaDestroyImage( b->xm_visual->hpcr_clear_ximage );
|
XMesaDestroyImage( b->xm_visual->hpcr_clear_ximage );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,10 +53,6 @@
|
|||||||
#include "tnl/tnl.h"
|
#include "tnl/tnl.h"
|
||||||
#include "tnl/t_context.h"
|
#include "tnl/t_context.h"
|
||||||
|
|
||||||
#ifdef XFree86Server
|
|
||||||
#include <GL/glxtokens.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
276
src/mesa/drivers/x11/xm_glide.c
Normal file
276
src/mesa/drivers/x11/xm_glide.c
Normal file
@@ -0,0 +1,276 @@
|
|||||||
|
/*
|
||||||
|
* Mesa 3-D graphics library
|
||||||
|
* Version: 6.5
|
||||||
|
*
|
||||||
|
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included
|
||||||
|
* in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "glxheader.h"
|
||||||
|
#include "xmesaP.h"
|
||||||
|
|
||||||
|
#ifdef FX
|
||||||
|
#include "../glide/fxdrv.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
FXcreateContext(XMesaVisual v, XMesaWindow w, XMesaContext c, XMesaBuffer b)
|
||||||
|
{
|
||||||
|
char *fxEnvVar = _mesa_getenv("MESA_GLX_FX");
|
||||||
|
if (fxEnvVar) {
|
||||||
|
if (fxEnvVar[0]!='d') {
|
||||||
|
int attribs[100];
|
||||||
|
int numAttribs = 0;
|
||||||
|
int hw;
|
||||||
|
if (v->mesa_visual.depthBits > 0) {
|
||||||
|
attribs[numAttribs++] = FXMESA_DEPTH_SIZE;
|
||||||
|
attribs[numAttribs++] = v->mesa_visual.depthBits;
|
||||||
|
}
|
||||||
|
if (v->mesa_visual.doubleBufferMode) {
|
||||||
|
attribs[numAttribs++] = FXMESA_DOUBLEBUFFER;
|
||||||
|
}
|
||||||
|
if (v->mesa_visual.accumRedBits > 0) {
|
||||||
|
attribs[numAttribs++] = FXMESA_ACCUM_SIZE;
|
||||||
|
attribs[numAttribs++] = v->mesa_visual.accumRedBits;
|
||||||
|
}
|
||||||
|
if (v->mesa_visual.stencilBits > 0) {
|
||||||
|
attribs[numAttribs++] = FXMESA_STENCIL_SIZE;
|
||||||
|
attribs[numAttribs++] = v->mesa_visual.stencilBits;
|
||||||
|
}
|
||||||
|
if (v->mesa_visual.alphaBits > 0) {
|
||||||
|
attribs[numAttribs++] = FXMESA_ALPHA_SIZE;
|
||||||
|
attribs[numAttribs++] = v->mesa_visual.alphaBits;
|
||||||
|
}
|
||||||
|
if (1) {
|
||||||
|
attribs[numAttribs++] = FXMESA_SHARE_CONTEXT;
|
||||||
|
attribs[numAttribs++] = (int) &(c->mesa);
|
||||||
|
}
|
||||||
|
attribs[numAttribs++] = FXMESA_NONE;
|
||||||
|
|
||||||
|
/* [dBorca] we should take an envvar for `fxMesaSelectCurrentBoard'!!! */
|
||||||
|
hw = fxMesaSelectCurrentBoard(0);
|
||||||
|
|
||||||
|
/* if these fail, there's a new bug somewhere */
|
||||||
|
ASSERT(b->mesa_buffer.Width > 0);
|
||||||
|
ASSERT(b->mesa_buffer.Height > 0);
|
||||||
|
|
||||||
|
if ((hw == GR_SSTTYPE_VOODOO) || (hw == GR_SSTTYPE_Voodoo2)) {
|
||||||
|
b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width,
|
||||||
|
b->mesa_buffer.Height, attribs);
|
||||||
|
if ((v->undithered_pf!=PF_Index) && (b->backxrb->ximage)) {
|
||||||
|
b->FXisHackUsable = b->FXctx ? GL_TRUE : GL_FALSE;
|
||||||
|
if (b->FXctx && (fxEnvVar[0]=='w' || fxEnvVar[0]=='W')) {
|
||||||
|
b->FXwindowHack = GL_TRUE;
|
||||||
|
FX_grSstControl(GR_CONTROL_DEACTIVATE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
b->FXwindowHack = GL_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (fxEnvVar[0]=='w' || fxEnvVar[0]=='W')
|
||||||
|
b->FXctx = fxMesaCreateContext(w, GR_RESOLUTION_NONE,
|
||||||
|
GR_REFRESH_75Hz, attribs);
|
||||||
|
else
|
||||||
|
b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width,
|
||||||
|
b->mesa_buffer.Height, attribs);
|
||||||
|
b->FXisHackUsable = GL_FALSE;
|
||||||
|
b->FXwindowHack = GL_FALSE;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
fprintf(stderr,
|
||||||
|
"voodoo %d, wid %d height %d hack: usable %d active %d\n",
|
||||||
|
hw, b->mesa_buffer.Width, b->mesa_buffer.Height,
|
||||||
|
b->FXisHackUsable, b->FXwindowHack);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_warning(NULL, "WARNING: This Mesa Library includes the Glide driver but\n");
|
||||||
|
_mesa_warning(NULL, " you have not defined the MESA_GLX_FX env. var.\n");
|
||||||
|
_mesa_warning(NULL, " (check the README.3DFX file for more information).\n\n");
|
||||||
|
_mesa_warning(NULL, " you can disable this message with a 'export MESA_GLX_FX=disable'.\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FXdestroyContext( XMesaBuffer b )
|
||||||
|
{
|
||||||
|
if (b && b->FXctx)
|
||||||
|
fxMesaDestroyContext(b->FXctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
GLboolean FXmakeCurrent( XMesaBuffer b )
|
||||||
|
{
|
||||||
|
if (b->FXctx) {
|
||||||
|
fxMesaMakeCurrent(b->FXctx);
|
||||||
|
|
||||||
|
return GL_TRUE;
|
||||||
|
}
|
||||||
|
return GL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read image from VooDoo frame buffer into X/Mesa's back XImage.
|
||||||
|
*/
|
||||||
|
static void FXgetImage( XMesaBuffer b )
|
||||||
|
{
|
||||||
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
|
static unsigned short pixbuf[MAX_WIDTH];
|
||||||
|
GLuint x, y;
|
||||||
|
GLuint width, height;
|
||||||
|
|
||||||
|
#ifdef XFree86Server
|
||||||
|
x = b->frontxrb->pixmap->x;
|
||||||
|
y = b->frontxrb->pixmap->y;
|
||||||
|
width = b->frontxrb->pixmap->width;
|
||||||
|
height = b->frontxrb->pixmap->height;
|
||||||
|
depth = b->frontxrb->pixmap->depth;
|
||||||
|
#else
|
||||||
|
xmesa_get_window_size(b->display, b, &width, &height);
|
||||||
|
x = y = 0;
|
||||||
|
#endif
|
||||||
|
if (b->mesa_buffer.Width != width || b->mesa_buffer.Height != height) {
|
||||||
|
b->mesa_buffer.Width = MIN2((int)width, b->FXctx->width);
|
||||||
|
b->mesa_buffer.Height = MIN2((int)height, b->FXctx->height);
|
||||||
|
if (b->mesa_buffer.Width & 1)
|
||||||
|
b->mesa_buffer.Width--; /* prevent odd width */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* [dBorca] we're always in the right GR_COLORFORMAT... aren't we? */
|
||||||
|
/* grLfbWriteColorFormat(GR_COLORFORMAT_ARGB); */
|
||||||
|
if (b->xm_visual->undithered_pf==PF_5R6G5B) {
|
||||||
|
/* Special case: 16bpp RGB */
|
||||||
|
grLfbReadRegion( GR_BUFFER_FRONTBUFFER, /* src buffer */
|
||||||
|
0, b->FXctx->height - b->mesa_buffer.Height, /*pos*/
|
||||||
|
b->mesa_buffer.Width, b->mesa_buffer.Height, /* size */
|
||||||
|
b->mesa_buffer.Width * sizeof(GLushort), /* stride */
|
||||||
|
b->backxrb->ximage->data); /* dest buffer */
|
||||||
|
}
|
||||||
|
else if (b->xm_visual->dithered_pf==PF_Dither
|
||||||
|
&& GET_VISUAL_DEPTH(b->xm_visual)==8) {
|
||||||
|
/* Special case: 8bpp RGB */
|
||||||
|
for (y=0;y<b->mesa_buffer.Height;y++) {
|
||||||
|
GLubyte *ptr = (GLubyte*) b->backxrb->ximage->data
|
||||||
|
+ b->backxrb->ximage->bytes_per_line * y;
|
||||||
|
XDITHER_SETUP(y);
|
||||||
|
|
||||||
|
/* read row from 3Dfx frame buffer */
|
||||||
|
grLfbReadRegion( GR_BUFFER_FRONTBUFFER,
|
||||||
|
0, b->FXctx->height-(b->mesa_buffer.Height-y),
|
||||||
|
b->mesa_buffer.Width, 1,
|
||||||
|
0,
|
||||||
|
pixbuf );
|
||||||
|
|
||||||
|
/* write to XImage back buffer */
|
||||||
|
for (x=0;x<b->mesa_buffer.Width;x++) {
|
||||||
|
GLubyte r = (pixbuf[x] & 0xf800) >> 8;
|
||||||
|
GLubyte g = (pixbuf[x] & 0x07e0) >> 3;
|
||||||
|
GLubyte b = (pixbuf[x] & 0x001f) << 3;
|
||||||
|
*ptr++ = XDITHER( x, r, g, b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* General case: slow! */
|
||||||
|
for (y=0;y<b->mesa_buffer.Height;y++) {
|
||||||
|
/* read row from 3Dfx frame buffer */
|
||||||
|
grLfbReadRegion( GR_BUFFER_FRONTBUFFER,
|
||||||
|
0, b->FXctx->height-(b->mesa_buffer.Height-y),
|
||||||
|
b->mesa_buffer.Width, 1,
|
||||||
|
0,
|
||||||
|
pixbuf );
|
||||||
|
|
||||||
|
/* write to XImage back buffer */
|
||||||
|
for (x=0;x<b->mesa_buffer.Width;x++) {
|
||||||
|
XMesaPutPixel(b->backxrb->ximage,x,y,
|
||||||
|
xmesa_color_to_pixel(ctx,
|
||||||
|
(pixbuf[x] & 0xf800) >> 8,
|
||||||
|
(pixbuf[x] & 0x07e0) >> 3,
|
||||||
|
(pixbuf[x] & 0x001f) << 3,
|
||||||
|
0xff,
|
||||||
|
b->xm_visual->undithered_pf));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
GLboolean FXswapBuffers( XMesaBuffer b )
|
||||||
|
{
|
||||||
|
if (b->FXctx) {
|
||||||
|
fxMesaSwapBuffers();
|
||||||
|
|
||||||
|
if (!b->FXwindowHack)
|
||||||
|
return GL_TRUE;
|
||||||
|
|
||||||
|
FXgetImage(b);
|
||||||
|
}
|
||||||
|
return GL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Switch 3Dfx support hack between window and full-screen mode.
|
||||||
|
*/
|
||||||
|
GLboolean XMesaSetFXmode( GLint mode )
|
||||||
|
{
|
||||||
|
const char *fx = _mesa_getenv("MESA_GLX_FX");
|
||||||
|
if (fx && fx[0] != 'd') {
|
||||||
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
|
GrHwConfiguration hw;
|
||||||
|
if (!FX_grSstQueryHardware(&hw)) {
|
||||||
|
/*fprintf(stderr, "!grSstQueryHardware\n");*/
|
||||||
|
return GL_FALSE;
|
||||||
|
}
|
||||||
|
if (hw.num_sst < 1) {
|
||||||
|
/*fprintf(stderr, "hw.num_sst < 1\n");*/
|
||||||
|
return GL_FALSE;
|
||||||
|
}
|
||||||
|
if (ctx) {
|
||||||
|
/* [dBorca] Hack alert:
|
||||||
|
* oh, this is sooo wrong: ctx above is
|
||||||
|
* really an fxMesaContext, not an XMesaContext
|
||||||
|
*/
|
||||||
|
XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
|
||||||
|
if (mode == XMESA_FX_WINDOW) {
|
||||||
|
if (xmbuf->FXisHackUsable) {
|
||||||
|
FX_grSstControl(GR_CONTROL_DEACTIVATE);
|
||||||
|
xmbuf->FXwindowHack = GL_TRUE;
|
||||||
|
return GL_TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (mode == XMESA_FX_FULLSCREEN) {
|
||||||
|
FX_grSstControl(GR_CONTROL_ACTIVATE);
|
||||||
|
xmbuf->FXwindowHack = GL_FALSE;
|
||||||
|
return GL_TRUE;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* Error: Bad mode value */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*fprintf(stderr, "fallthrough\n");*/
|
||||||
|
return GL_FALSE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
40
src/mesa/drivers/x11/xm_glide.h
Normal file
40
src/mesa/drivers/x11/xm_glide.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Mesa 3-D graphics library
|
||||||
|
* Version: 6.5
|
||||||
|
*
|
||||||
|
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included
|
||||||
|
* in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _XM_GLIDE_H_
|
||||||
|
#define _XM_GLIDE_H_
|
||||||
|
|
||||||
|
extern void FXcreateContext( XMesaVisual v,
|
||||||
|
XMesaWindow w,
|
||||||
|
XMesaContext c,
|
||||||
|
XMesaBuffer b );
|
||||||
|
|
||||||
|
extern void FXdestroyContext( XMesaBuffer b );
|
||||||
|
|
||||||
|
extern GLboolean FXmakeCurrent( XMesaBuffer b );
|
||||||
|
|
||||||
|
extern GLboolean FXswapBuffers( XMesaBuffer b );
|
||||||
|
|
||||||
|
#endif /* _XM_GLIDE_H_ */
|
||||||
133
src/mesa/drivers/x11/xm_image.c
Normal file
133
src/mesa/drivers/x11/xm_image.c
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
|
||||||
|
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||||
|
All Rights Reserved.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sub license, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice (including the
|
||||||
|
next paragraph) shall be included in all copies or substantial portions
|
||||||
|
of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||||
|
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Authors:
|
||||||
|
* Kevin E. Martin <kevin@precisioninsight.com>
|
||||||
|
* Brian Paul <brian@precisioninsight.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <X11/Xmd.h>
|
||||||
|
|
||||||
|
#include "glxheader.h"
|
||||||
|
#include "xmesaP.h"
|
||||||
|
|
||||||
|
#ifdef XFree86Server
|
||||||
|
|
||||||
|
#ifdef ROUNDUP
|
||||||
|
#undef ROUNDUP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define ROUNDUP(nbytes, pad) ((((nbytes) + ((pad)-1)) / (pad)) * ((pad)>>3))
|
||||||
|
|
||||||
|
XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height, char *data)
|
||||||
|
{
|
||||||
|
XMesaImage *image;
|
||||||
|
|
||||||
|
image = (XMesaImage *)xalloc(sizeof(XMesaImage));
|
||||||
|
|
||||||
|
if (image) {
|
||||||
|
image->width = width;
|
||||||
|
image->height = height;
|
||||||
|
image->data = data;
|
||||||
|
/* Always pad to 32 bits */
|
||||||
|
image->bytes_per_line = ROUNDUP((bitsPerPixel * width), 32);
|
||||||
|
image->bits_per_pixel = bitsPerPixel;
|
||||||
|
}
|
||||||
|
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XMesaDestroyImage(XMesaImage *image)
|
||||||
|
{
|
||||||
|
if (image->data)
|
||||||
|
free(image->data);
|
||||||
|
xfree(image);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned long XMesaGetPixel(XMesaImage *image, int x, int y)
|
||||||
|
{
|
||||||
|
CARD8 *row = (CARD8 *)(image->data + y*image->bytes_per_line);
|
||||||
|
CARD8 *i8;
|
||||||
|
CARD16 *i16;
|
||||||
|
CARD32 *i32;
|
||||||
|
switch (image->bits_per_pixel) {
|
||||||
|
case 8:
|
||||||
|
i8 = (CARD8 *)row;
|
||||||
|
return i8[x];
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
case 16:
|
||||||
|
i16 = (CARD16 *)row;
|
||||||
|
return i16[x];
|
||||||
|
break;
|
||||||
|
case 24: /* WARNING: architecture specific code */
|
||||||
|
i8 = (CARD8 *)row;
|
||||||
|
return (((CARD32)i8[x*3]) |
|
||||||
|
(((CARD32)i8[x*3+1])<<8) |
|
||||||
|
(((CARD32)i8[x*3+2])<<16));
|
||||||
|
break;
|
||||||
|
case 32:
|
||||||
|
i32 = (CARD32 *)row;
|
||||||
|
return i32[x];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef XMESA_USE_PUTPIXEL_MACRO
|
||||||
|
void XMesaPutPixel(XMesaImage *image, int x, int y, unsigned long pixel)
|
||||||
|
{
|
||||||
|
CARD8 *row = (CARD8 *)(image->data + y*image->bytes_per_line);
|
||||||
|
CARD8 *i8;
|
||||||
|
CARD16 *i16;
|
||||||
|
CARD32 *i32;
|
||||||
|
switch (image->bits_per_pixel) {
|
||||||
|
case 8:
|
||||||
|
i8 = (CARD8 *)row;
|
||||||
|
i8[x] = (CARD8)pixel;
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
case 16:
|
||||||
|
i16 = (CARD16 *)row;
|
||||||
|
i16[x] = (CARD16)pixel;
|
||||||
|
break;
|
||||||
|
case 24: /* WARNING: architecture specific code */
|
||||||
|
i8 = (CARD8 *)__row;
|
||||||
|
i8[x*3] = (CARD8)(p);
|
||||||
|
i8[x*3+1] = (CARD8)(p>>8);
|
||||||
|
i8[x*3+2] = (CARD8)(p>>16);
|
||||||
|
case 32:
|
||||||
|
i32 = (CARD32 *)row;
|
||||||
|
i32[x] = (CARD32)pixel;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* XFree86Server */
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user