Compare commits
	
		
			187 Commits
		
	
	
		
			mesa-7.5-1
			...
			mesa_7_5_2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					18f3afbe88 | ||
| 
						 | 
					b807d49f18 | ||
| 
						 | 
					d09941c8cc | ||
| 
						 | 
					fc613848e6 | ||
| 
						 | 
					c7d0f0b46c | ||
| 
						 | 
					c7fddaf612 | ||
| 
						 | 
					e3a6f57ad6 | ||
| 
						 | 
					41d0606b7f | ||
| 
						 | 
					126d62edd1 | ||
| 
						 | 
					1730b8db12 | ||
| 
						 | 
					60b152a1b3 | ||
| 
						 | 
					adfa778c8e | ||
| 
						 | 
					2acd5de226 | ||
| 
						 | 
					890f37d4d9 | ||
| 
						 | 
					ad935c3f47 | ||
| 
						 | 
					be66ff51ec | ||
| 
						 | 
					bc75464760 | ||
| 
						 | 
					52cadf7592 | ||
| 
						 | 
					e857303305 | ||
| 
						 | 
					2b83483fb4 | ||
| 
						 | 
					5a0b29050f | ||
| 
						 | 
					077e3de989 | ||
| 
						 | 
					999592745f | ||
| 
						 | 
					c4ce6f6a7c | ||
| 
						 | 
					9666529b5a | ||
| 
						 | 
					08d39251a7 | ||
| 
						 | 
					cfa1a0a609 | ||
| 
						 | 
					2921a2555d | ||
| 
						 | 
					d9ddbc3f47 | ||
| 
						 | 
					41fff1b9a1 | ||
| 
						 | 
					6681981fe1 | ||
| 
						 | 
					3ad108b77f | ||
| 
						 | 
					f42c66c138 | ||
| 
						 | 
					81de9d68f7 | ||
| 
						 | 
					1f309c40b8 | ||
| 
						 | 
					799631acb1 | ||
| 
						 | 
					ac3c8e3b53 | ||
| 
						 | 
					3129b2403e | ||
| 
						 | 
					b8b774c775 | ||
| 
						 | 
					1402ea8f39 | ||
| 
						 | 
					9c8b69302c | ||
| 
						 | 
					0fa1692f14 | ||
| 
						 | 
					4d9bbabb83 | ||
| 
						 | 
					3f4d776199 | ||
| 
						 | 
					988db64119 | ||
| 
						 | 
					79a3e298c5 | ||
| 
						 | 
					2dd3da3a4a | ||
| 
						 | 
					d27d659043 | ||
| 
						 | 
					42943a4cf9 | ||
| 
						 | 
					8de625c7cf | ||
| 
						 | 
					18bdb6e712 | ||
| 
						 | 
					bf19638a00 | ||
| 
						 | 
					b2cba25f9e | ||
| 
						 | 
					cf820a045f | ||
| 
						 | 
					2855ee82c6 | ||
| 
						 | 
					04081a164c | ||
| 
						 | 
					1d1dfc96c4 | ||
| 
						 | 
					a9504edee3 | ||
| 
						 | 
					945d34e88a | ||
| 
						 | 
					94d3b832cc | ||
| 
						 | 
					8c764d5c34 | ||
| 
						 | 
					a0b7850f1d | ||
| 
						 | 
					3d6c73513c | ||
| 
						 | 
					83e6c67363 | ||
| 
						 | 
					f396263651 | ||
| 
						 | 
					63b3fa2bce | ||
| 
						 | 
					217af32c2d | ||
| 
						 | 
					456a16491b | ||
| 
						 | 
					9eca0e5350 | ||
| 
						 | 
					7e26bdb849 | ||
| 
						 | 
					213ac4bb5d | ||
| 
						 | 
					cab307ce6b | ||
| 
						 | 
					1960da2e09 | ||
| 
						 | 
					7d3af894d6 | ||
| 
						 | 
					32156f3a11 | ||
| 
						 | 
					1c32caf075 | ||
| 
						 | 
					67c286d20e | ||
| 
						 | 
					0b4e835b13 | ||
| 
						 | 
					08575509e4 | ||
| 
						 | 
					ccb081414b | ||
| 
						 | 
					47df7900fd | ||
| 
						 | 
					c3a0624ef0 | ||
| 
						 | 
					e79054cc40 | ||
| 
						 | 
					de343680a3 | ||
| 
						 | 
					1d7a989b10 | ||
| 
						 | 
					d9b7d7875b | ||
| 
						 | 
					3f785080db | ||
| 
						 | 
					fcf0804c05 | ||
| 
						 | 
					9f36473a8e | ||
| 
						 | 
					2241665dc6 | ||
| 
						 | 
					6bf86681f5 | ||
| 
						 | 
					f7654faf16 | ||
| 
						 | 
					a48ee529a2 | ||
| 
						 | 
					edb1178798 | ||
| 
						 | 
					9399b9a0e2 | ||
| 
						 | 
					0d7bed9f89 | ||
| 
						 | 
					8f4d66c5f8 | ||
| 
						 | 
					43a064e06d | ||
| 
						 | 
					32f95f8c17 | ||
| 
						 | 
					f8ae968d28 | ||
| 
						 | 
					babb5ba9a9 | ||
| 
						 | 
					d09d03aa42 | ||
| 
						 | 
					488b3c4d1b | ||
| 
						 | 
					f6d34c2058 | ||
| 
						 | 
					04d170794a | ||
| 
						 | 
					bf7e4b10cb | ||
| 
						 | 
					96f7b42242 | ||
| 
						 | 
					b5ecbbe636 | ||
| 
						 | 
					b9b04872d5 | ||
| 
						 | 
					f785b35b47 | ||
| 
						 | 
					1aba1baa62 | ||
| 
						 | 
					ce723d8d8b | ||
| 
						 | 
					4c7c294fff | ||
| 
						 | 
					5e6d21afa4 | ||
| 
						 | 
					3097d7dbf8 | ||
| 
						 | 
					fab17c1216 | ||
| 
						 | 
					ee0984e299 | ||
| 
						 | 
					e8957f4800 | ||
| 
						 | 
					e3bc1fb6bc | ||
| 
						 | 
					10430f47a4 | ||
| 
						 | 
					cdf56eb68d | ||
| 
						 | 
					1574b05189 | ||
| 
						 | 
					a7ca80ff6a | ||
| 
						 | 
					467b3d9a6f | ||
| 
						 | 
					e691b0e533 | ||
| 
						 | 
					3ffaa11f88 | ||
| 
						 | 
					1e0f621b50 | ||
| 
						 | 
					6d55fd705d | ||
| 
						 | 
					ecb177eaea | ||
| 
						 | 
					36df6a6e91 | ||
| 
						 | 
					ad8a6937ae | ||
| 
						 | 
					f418d18ea6 | ||
| 
						 | 
					a531a5cf94 | ||
| 
						 | 
					1ce3f5a806 | ||
| 
						 | 
					d80b36f64f | ||
| 
						 | 
					9676ed27fe | ||
| 
						 | 
					98f00e8eb9 | ||
| 
						 | 
					24fdf8aadb | ||
| 
						 | 
					ffb1f9bded | ||
| 
						 | 
					8c223e8eb6 | ||
| 
						 | 
					5b3428d745 | ||
| 
						 | 
					a59579c983 | ||
| 
						 | 
					dcebe220f4 | ||
| 
						 | 
					f792137593 | ||
| 
						 | 
					2cd33afa00 | ||
| 
						 | 
					727b2d747e | ||
| 
						 | 
					4f36164024 | ||
| 
						 | 
					05d393f59f | ||
| 
						 | 
					854ea483d4 | ||
| 
						 | 
					3a221a9018 | ||
| 
						 | 
					61673aebb0 | ||
| 
						 | 
					f5f8be8bb2 | ||
| 
						 | 
					2bec909c69 | ||
| 
						 | 
					f0df08abbe | ||
| 
						 | 
					9d3929b60c | ||
| 
						 | 
					9185a61c8a | ||
| 
						 | 
					0ce73f84e9 | ||
| 
						 | 
					fb7cf731f9 | ||
| 
						 | 
					b59eb3b8b1 | ||
| 
						 | 
					ed6125fe9b | ||
| 
						 | 
					35e3449ad7 | ||
| 
						 | 
					7d93f817c9 | ||
| 
						 | 
					6842829539 | ||
| 
						 | 
					2420b283b7 | ||
| 
						 | 
					4d99e14535 | ||
| 
						 | 
					45f4e8842e | ||
| 
						 | 
					d090ba9e00 | ||
| 
						 | 
					82f4dc21cc | ||
| 
						 | 
					e32b601e7d | ||
| 
						 | 
					ce0ad53281 | ||
| 
						 | 
					bc60b88411 | ||
| 
						 | 
					3dbaf68bdc | ||
| 
						 | 
					722d136f7b | ||
| 
						 | 
					a7427b0f7b | ||
| 
						 | 
					0ad9eba333 | ||
| 
						 | 
					7e2f26cbbf | ||
| 
						 | 
					d2f56fe687 | ||
| 
						 | 
					09ef339b69 | ||
| 
						 | 
					25e371fb7b | ||
| 
						 | 
					5276b049b4 | ||
| 
						 | 
					c57d81ddc9 | ||
| 
						 | 
					b4ba6a66b7 | ||
| 
						 | 
					9c4b877519 | ||
| 
						 | 
					b9e2e32daf | ||
| 
						 | 
					a6b314150c | ||
| 
						 | 
					1b445f9673 | ||
| 
						 | 
					5ed4404005 | 
							
								
								
									
										12
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Makefile
									
									
									
									
									
								
							@@ -182,7 +182,7 @@ ultrix-gcc:
 | 
			
		||||
 | 
			
		||||
# Rules for making release tarballs
 | 
			
		||||
 | 
			
		||||
VERSION=7.5
 | 
			
		||||
VERSION=7.5.2
 | 
			
		||||
DIRECTORY = Mesa-$(VERSION)
 | 
			
		||||
LIB_NAME = MesaLib-$(VERSION)
 | 
			
		||||
DEMO_NAME = MesaDemos-$(VERSION)
 | 
			
		||||
@@ -388,7 +388,17 @@ GLW_FILES = \
 | 
			
		||||
	$(DIRECTORY)/src/glw/glw.pc.in			\
 | 
			
		||||
	$(DIRECTORY)/src/glw/depend
 | 
			
		||||
 | 
			
		||||
GLEW_FILES = \
 | 
			
		||||
	$(DIRECTORY)/include/GL/glew.h			\
 | 
			
		||||
	$(DIRECTORY)/include/GL/glxew.h			\
 | 
			
		||||
	$(DIRECTORY)/include/GL/wglew.h			\
 | 
			
		||||
	$(DIRECTORY)/src/glew/*.c			\
 | 
			
		||||
	$(DIRECTORY)/src/glew/Makefile			\
 | 
			
		||||
	$(DIRECTORY)/src/glew/SConscript		\
 | 
			
		||||
	$(DIRECTORY)/src/glew/LICENSE.txt
 | 
			
		||||
 | 
			
		||||
DEMO_FILES = \
 | 
			
		||||
	$(GLEW_FILES)					\
 | 
			
		||||
	$(DIRECTORY)/progs/beos/*.cpp			\
 | 
			
		||||
	$(DIRECTORY)/progs/beos/Makefile		\
 | 
			
		||||
	$(DIRECTORY)/progs/images/*.rgb			\
 | 
			
		||||
 
 | 
			
		||||
@@ -971,5 +971,6 @@ esac
 | 
			
		||||
#
 | 
			
		||||
if [ ${INSTALLDIR} != "." ] ; then
 | 
			
		||||
    echo "mklib: Installing" ${FINAL_LIBS} "in" ${INSTALLDIR}
 | 
			
		||||
    test -d ${INSTALLDIR} || mkdir -p ${INSTALLDIR}
 | 
			
		||||
    mv ${FINAL_LIBS} ${INSTALLDIR}/
 | 
			
		||||
fi
 | 
			
		||||
 
 | 
			
		||||
@@ -33,9 +33,9 @@ else:
 | 
			
		||||
	default_machine = _platform.machine()
 | 
			
		||||
default_machine = _machine_map.get(default_machine, 'generic')
 | 
			
		||||
 | 
			
		||||
if default_platform in ('linux', 'freebsd', 'darwin'):
 | 
			
		||||
if default_platform in ('linux', 'freebsd'):
 | 
			
		||||
	default_dri = 'yes'
 | 
			
		||||
elif default_platform in ('winddk', 'windows', 'wince'):
 | 
			
		||||
elif default_platform in ('winddk', 'windows', 'wince', 'darwin'):
 | 
			
		||||
	default_dri = 'no'
 | 
			
		||||
else:
 | 
			
		||||
	default_dri = 'no'
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ CONFIG_NAME = default
 | 
			
		||||
# Version info
 | 
			
		||||
MESA_MAJOR=7
 | 
			
		||||
MESA_MINOR=5
 | 
			
		||||
MESA_TINY=0
 | 
			
		||||
MESA_TINY=2
 | 
			
		||||
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
 | 
			
		||||
 | 
			
		||||
# external projects.  This should be useless now that we use libdrm.
 | 
			
		||||
@@ -23,6 +23,7 @@ HOST_CC = $(CC)
 | 
			
		||||
CFLAGS = -O
 | 
			
		||||
CXXFLAGS = -O
 | 
			
		||||
LDFLAGS =
 | 
			
		||||
HOST_CFLAGS = $(CFLAGS)
 | 
			
		||||
GLU_CFLAGS = 
 | 
			
		||||
 | 
			
		||||
# Compiler for building demos/tests/etc
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								configure.ac
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								configure.ac
									
									
									
									
									
								
							@@ -121,6 +121,7 @@ AC_ARG_ENABLE([32-bit],
 | 
			
		||||
if test "x$enable_32bit" = xyes; then
 | 
			
		||||
    if test "x$GCC" = xyes; then
 | 
			
		||||
        CFLAGS="$CFLAGS -m32"
 | 
			
		||||
        ARCH_FLAGS="$ARCH_FLAGS -m32"
 | 
			
		||||
    fi
 | 
			
		||||
    if test "x$GXX" = xyes; then
 | 
			
		||||
        CXXFLAGS="$CXXFLAGS -m32"
 | 
			
		||||
@@ -1145,6 +1146,21 @@ AC_ARG_WITH([xorg-driver-dir],
 | 
			
		||||
    [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
 | 
			
		||||
AC_SUBST([XORG_DRIVER_INSTALL_DIR])
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH([max-width],
 | 
			
		||||
    [AS_HELP_STRING([--with-max-width=N],
 | 
			
		||||
                    [Maximum framebuffer width (4096)])],
 | 
			
		||||
    [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
 | 
			
		||||
     AS_IF([test "${withval}" -gt "4096"],
 | 
			
		||||
           [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
 | 
			
		||||
)
 | 
			
		||||
AC_ARG_WITH([max-height],
 | 
			
		||||
    [AS_HELP_STRING([--with-max-height=N],
 | 
			
		||||
                    [Maximum framebuffer height (4096)])],
 | 
			
		||||
    [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
 | 
			
		||||
     AS_IF([test "${withval}" -gt "4096"],
 | 
			
		||||
           [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
dnl
 | 
			
		||||
dnl Gallium Intel configuration
 | 
			
		||||
dnl
 | 
			
		||||
@@ -1172,7 +1188,7 @@ if test "x$enable_gallium_radeon" = xyes; then
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
dnl
 | 
			
		||||
dnl Gallium Radeon configuration
 | 
			
		||||
dnl Gallium Nouveau configuration
 | 
			
		||||
dnl
 | 
			
		||||
AC_ARG_ENABLE([gallium-nouveau],
 | 
			
		||||
    [AS_HELP_STRING([--enable-gallium-nouveau],
 | 
			
		||||
 
 | 
			
		||||
@@ -39,7 +39,6 @@ a:visited {
 | 
			
		||||
<ul>
 | 
			
		||||
<li><a href="download.html" target="MainFrame">Downloading / Unpacking</a>
 | 
			
		||||
<li><a href="install.html" target="MainFrame">Compiling / Installing</a>
 | 
			
		||||
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>
 | 
			
		||||
<li><a href="precompiled.html" target="MainFrame">Precompiled Libraries</a>
 | 
			
		||||
</ul>
 | 
			
		||||
 | 
			
		||||
@@ -68,6 +67,7 @@ a:visited {
 | 
			
		||||
<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="glu.html" target="MainFrame">SGI's GLU</a>
 | 
			
		||||
<li><a href="utilities.html" target="MainFrame">Utilities</a>
 | 
			
		||||
<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a>
 | 
			
		||||
<li><a href="devinfo.html" target="MainFrame">Development Notes</a>
 | 
			
		||||
 
 | 
			
		||||
@@ -9,14 +9,14 @@
 | 
			
		||||
<H1>Downloading</H1>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
Primary download site:
 | 
			
		||||
<a href="http://sourceforge.net/project/showfiles.php?group_id=3"
 | 
			
		||||
target="_parent">SourceForge</a>
 | 
			
		||||
Primary Mesa download site:
 | 
			
		||||
<a href="ftp://ftp.freedesktop.org/pub/mesa/"
 | 
			
		||||
target="_parent">freedesktop.org</a> (FTP)
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
When a new release is coming, release candidates (betas) can be found
 | 
			
		||||
<a href="http://www.mesa3d.org/beta/">here</a>.
 | 
			
		||||
When a new release is coming, release candidates (betas) may be found
 | 
			
		||||
<a href="ftp://ftp.freedesktop.org/pub/mesa/beta/" target="_parent">here</a>.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -316,6 +316,19 @@ Basically, applying a translation of (0.375, 0.375, 0.0) to your coordinates
 | 
			
		||||
will fix the problem.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<h2>3.6 How can I change the maximum framebuffer size in Mesa's
 | 
			
		||||
<tt>swrast</tt> backend?</h2>
 | 
			
		||||
<p>
 | 
			
		||||
These can be overridden by using the <tt>--with-max-width</tt> and
 | 
			
		||||
<tt>--with-max-height</tt> options.  The two need not be equal.
 | 
			
		||||
</p><p>
 | 
			
		||||
Do note that Mesa uses these values to size some internal buffers,
 | 
			
		||||
so increasing these sizes will cause Mesa to require additional
 | 
			
		||||
memory.  Furthermore, increasing these limits beyond <tt>4096</tt>
 | 
			
		||||
may introduce rasterization artifacts; see the leading comments in
 | 
			
		||||
<tt>src/mesa/swrast/s_tritemp.h</tt>.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<br>
 | 
			
		||||
<br>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -11,6 +11,13 @@
 | 
			
		||||
<H1>News</H1>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<h2>September 3, 2009</h2>
 | 
			
		||||
<p>
 | 
			
		||||
<a href="relnotes-7.5.1.html">Mesa 7.5.1</a> is released.
 | 
			
		||||
This is a bug-fix release which fixes bugs found in version 7.5.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<h2>July 17, 2009</h2>
 | 
			
		||||
<p>
 | 
			
		||||
<a href="relnotes-7.5.html">Mesa 7.5</a> is released.
 | 
			
		||||
 
 | 
			
		||||
@@ -9,17 +9,11 @@
 | 
			
		||||
<H1>Precompiled Libraries</H1>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
In general, precompiled libraries are not available.
 | 
			
		||||
However, people occasionally prepare packages of precompiled libraries
 | 
			
		||||
for some systems.
 | 
			
		||||
In general, precompiled Mesa libraries are not available.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<H2>Mesa-6.0 for Solaris</H2>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
Steve Christensen has submitted precompiled Mesa-6.0 libraries for
 | 
			
		||||
Solaris at <a href="http://sunfreeware.com/" target="_parent">
 | 
			
		||||
sunfreeware.com</a>.
 | 
			
		||||
However, some Linux distros (such as Ubuntu) seem to closely track
 | 
			
		||||
Mesa and often have the latest Mesa release available as an update.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
</BODY>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										72
									
								
								docs/relnotes-7.5.1.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								docs/relnotes-7.5.1.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,72 @@
 | 
			
		||||
<HTML>
 | 
			
		||||
 | 
			
		||||
<TITLE>Mesa Release Notes</TITLE>
 | 
			
		||||
 | 
			
		||||
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
 | 
			
		||||
 | 
			
		||||
<BODY>
 | 
			
		||||
 | 
			
		||||
<body bgcolor="#eeeeee">
 | 
			
		||||
 | 
			
		||||
<H1>Mesa 7.5.1 Release Notes, 3 September 2009</H1>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
Mesa 7.5.1 is a bug-fix release fixing issues found since the 7.5 release.
 | 
			
		||||
</p>
 | 
			
		||||
<p>
 | 
			
		||||
The main new feature of Mesa 7.5.x is the
 | 
			
		||||
<a href="http://wiki.freedesktop.org/wiki/Software/gallium"
 | 
			
		||||
target="_parent">Gallium3D</a> infrastructure.
 | 
			
		||||
</p>
 | 
			
		||||
<p>
 | 
			
		||||
Mesa 7.5.1 implements the OpenGL 2.1 API, but the version reported by
 | 
			
		||||
glGetString(GL_VERSION) depends on the particular driver being used.
 | 
			
		||||
Some drivers don't support all the features required in OpenGL 2.1.
 | 
			
		||||
</p>
 | 
			
		||||
<p>
 | 
			
		||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
 | 
			
		||||
for DRI hardware acceleration.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<h2>MD5 checksums</h2>
 | 
			
		||||
<pre>
 | 
			
		||||
d7269e93bc7484430637d54ced250876  MesaLib-7.5.1.tar.gz
 | 
			
		||||
877d6a4b24efc2b1d02aa553f262cba8  MesaLib-7.5.1.tar.bz2
 | 
			
		||||
23f4fb757a05c8396425681234ae20e5  MesaLib-7.5.1.zip
 | 
			
		||||
5af4bd113652108f5cec5113dad813f2  MesaDemos-7.5.1.tar.gz
 | 
			
		||||
785402e3b9f0e335538fcc6bf19f6987  MesaDemos-7.5.1.tar.bz2
 | 
			
		||||
950058cc6d6106e9c7d5876a03789fe9  MesaDemos-7.5.1.zip
 | 
			
		||||
cb52ce2c93389c2711cbe8d857ec5303  MesaGLUT-7.5.1.tar.gz
 | 
			
		||||
e3a9892e056d625c5353617a7c5b7e9c  MesaGLUT-7.5.1.tar.bz2
 | 
			
		||||
da1de364df148c94b4994006191a1e69  MesaGLUT-7.5.1.zip
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<h2>New features</h2>
 | 
			
		||||
<ul>
 | 
			
		||||
<li>Added configure --with-max-width=W, --with-max-height=H options to specify
 | 
			
		||||
    max framebuffer, viewport size.
 | 
			
		||||
</ul>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<h2>Bug fixes</h2>
 | 
			
		||||
<ul>
 | 
			
		||||
<li>Added missing GLEW library to MesaDemos tarballs.
 | 
			
		||||
<li>Fixed swapbuffers jerkiness in Doom3/etc in Intel drivers.
 | 
			
		||||
<li>Fixed front buffer rendering bug in Intel drivers.
 | 
			
		||||
<li>Fixed minor GLX memory leaks.
 | 
			
		||||
<li>Fixed some texture env / fragment program state bugs.
 | 
			
		||||
<li>Fixed some Gallium glBlitFramebuffer() bugs
 | 
			
		||||
<li>Empty glBegin/glEnd() pair could cause divide by zero (bug 23489)
 | 
			
		||||
<li>Fixed Gallium glBitmap() Z position bug
 | 
			
		||||
<li>Setting arrays of sampler uniforms did not work
 | 
			
		||||
<li>Selection/Feedback mode didn't handle polygon culling correctly (bug 16866)
 | 
			
		||||
<li>Fixed 32/64-bit cross compilation issue in gen_matypes.c
 | 
			
		||||
<li>Fixed glXCreateGLXPixmap() for direct rendering.
 | 
			
		||||
<li>Fixed Gallium glCopyPixels(GL_STENCIL_INDEX) mispositioned image bug.
 | 
			
		||||
</ul>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										67
									
								
								docs/relnotes-7.5.2.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								docs/relnotes-7.5.2.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,67 @@
 | 
			
		||||
<HTML>
 | 
			
		||||
 | 
			
		||||
<TITLE>Mesa Release Notes</TITLE>
 | 
			
		||||
 | 
			
		||||
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
 | 
			
		||||
 | 
			
		||||
<BODY>
 | 
			
		||||
 | 
			
		||||
<body bgcolor="#eeeeee">
 | 
			
		||||
 | 
			
		||||
<H1>Mesa 7.5.2 Release Notes, 28 September 2009</H1>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
Mesa 7.5.2 is a bug-fix release fixing issues found since the 7.5.1 release.
 | 
			
		||||
</p>
 | 
			
		||||
<p>
 | 
			
		||||
The main new feature of Mesa 7.5.x is the
 | 
			
		||||
<a href="http://wiki.freedesktop.org/wiki/Software/gallium"
 | 
			
		||||
target="_parent">Gallium3D</a> infrastructure.
 | 
			
		||||
</p>
 | 
			
		||||
<p>
 | 
			
		||||
Mesa 7.5.2 implements the OpenGL 2.1 API, but the version reported by
 | 
			
		||||
glGetString(GL_VERSION) depends on the particular driver being used.
 | 
			
		||||
Some drivers don't support all the features required in OpenGL 2.1.
 | 
			
		||||
</p>
 | 
			
		||||
<p>
 | 
			
		||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
 | 
			
		||||
for DRI hardware acceleration.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<h2>MD5 checksums</h2>
 | 
			
		||||
<pre>
 | 
			
		||||
43a90191dd9f76cd65dcc1ac91f3be70  MesaLib-7.5.2.tar.gz
 | 
			
		||||
94e47a499f1226803869c2e37a6a8e3a  MesaLib-7.5.2.tar.bz2
 | 
			
		||||
1ecb822b567ad67a0617361d45206b67  MesaLib-7.5.2.zip
 | 
			
		||||
2718fdce7e075911d6147beb8f27104b  MesaDemos-7.5.2.tar.gz
 | 
			
		||||
4e0f5ccd58afe21eddcd94327d926e86  MesaDemos-7.5.2.tar.bz2
 | 
			
		||||
f621f8c223b278d7c8e49a012d56ca25  MesaDemos-7.5.2.zip
 | 
			
		||||
83c16c1d6bcfcc3f97aab5d2fe430b4c  MesaGLUT-7.5.2.tar.gz
 | 
			
		||||
e5d03bedae369ea3705783573bb33813  MesaGLUT-7.5.2.tar.bz2
 | 
			
		||||
e82ba28e00d653e6f437d32be8ca8481  MesaGLUT-7.5.2.zip
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<h2>New features</h2>
 | 
			
		||||
<ul>
 | 
			
		||||
<li>Detect B43 chipset in Intel driver
 | 
			
		||||
</ul>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<h2>Bug fixes</h2>
 | 
			
		||||
<ul>
 | 
			
		||||
<li>Assorted bug fixes for i965/i945 drivers
 | 
			
		||||
<li>Fixed Gallium glDrawPixels(GL_STENCIL_INDEX) failure.
 | 
			
		||||
<li>Fixed GLSL linker/preprocessor version directive issue seen in Wine
 | 
			
		||||
    (such as bug 23946)
 | 
			
		||||
<li>glUseProgram() is now compiled into display lists (bug 23746).
 | 
			
		||||
<li>glUniform functions are now compiled into display lists
 | 
			
		||||
<li>Auto mipmap generation didn't work reliably with Gallium.
 | 
			
		||||
<li>Fixed random number usage in GLX code.
 | 
			
		||||
<li>Fixed invalid GL_OUT_OF_MEMORY error sometimes raised by glTexSubImage2D
 | 
			
		||||
    when using Gallium.
 | 
			
		||||
</ul>
 | 
			
		||||
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
@@ -40,7 +40,15 @@ If you're especially concerned with stability you should probably look for
 | 
			
		||||
 | 
			
		||||
<h2>MD5 checksums</h2>
 | 
			
		||||
<pre>
 | 
			
		||||
tbd
 | 
			
		||||
553fd956e544727f30fbe249619b6286  MesaLib-7.5.tar.gz
 | 
			
		||||
459f332551f6ebb86f384d21dd15e1f0  MesaLib-7.5.tar.bz2
 | 
			
		||||
8c02c0e17a9025250d20424ae32f5163  MesaLib-7.5.zip
 | 
			
		||||
a188da2886fa5496ea0c2cda602b2eeb  MesaDemos-7.5.tar.gz
 | 
			
		||||
398ee8801814a00e47f6c2314e3dfddc  MesaDemos-7.5.tar.bz2
 | 
			
		||||
15a0c8ae013c54335a26335e1a98d609  MesaDemos-7.5.zip
 | 
			
		||||
81010147def5a644ba14f9bbb7a49a2a  MesaGLUT-7.5.tar.gz
 | 
			
		||||
baa7a1e850b6e39bae58868fd0684004  MesaGLUT-7.5.tar.bz2
 | 
			
		||||
265228418e4423fa328f2f5b7970cf08  MesaGLUT-7.5.zip
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -13,6 +13,8 @@ The release notes summarize what's new or changed in each Mesa release.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<UL>
 | 
			
		||||
<LI><A HREF="relnotes-7.5.2.html">7.5.2 release notes</A>
 | 
			
		||||
<LI><A HREF="relnotes-7.5.1.html">7.5.1 release notes</A>
 | 
			
		||||
<LI><A HREF="relnotes-7.5.html">7.5 release notes</A>
 | 
			
		||||
<LI><A HREF="relnotes-7.4.4.html">7.4.4 release notes</A>
 | 
			
		||||
<LI><A HREF="relnotes-7.4.3.html">7.4.3 release notes</A>
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,8 @@ typedef HWND	NativeWindowType;
 | 
			
		||||
typedef HBITMAP NativePixmapType;
 | 
			
		||||
/** END Added for Windows **/
 | 
			
		||||
 | 
			
		||||
#elif defined(__gnu_linux__) || defined(__FreeBSD__) || defined(__sun)
 | 
			
		||||
#elif defined(__gnu_linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__APPLE__)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** BEGIN Added for X (Mesa) **/
 | 
			
		||||
#ifndef EGLAPI
 | 
			
		||||
 
 | 
			
		||||
@@ -498,7 +498,7 @@ SetupFunctionPointers(void)
 | 
			
		||||
 * Make FBO to render into given texture.
 | 
			
		||||
 */
 | 
			
		||||
static GLuint
 | 
			
		||||
MakeFBO_RenderTexture(GLuint TexObj)
 | 
			
		||||
MakeFBO_RenderTexture(GLuint texObj)
 | 
			
		||||
{
 | 
			
		||||
   GLuint fb;
 | 
			
		||||
   GLint sizeFudge = 0;
 | 
			
		||||
@@ -507,7 +507,7 @@ MakeFBO_RenderTexture(GLuint TexObj)
 | 
			
		||||
   glBindFramebuffer_func(GL_FRAMEBUFFER_EXT, fb);
 | 
			
		||||
   /* Render color to texture */
 | 
			
		||||
   glFramebufferTexture2D_func(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
 | 
			
		||||
                             TexTarget, TexObj, TextureLevel);
 | 
			
		||||
                             TexTarget, texObj, TextureLevel);
 | 
			
		||||
 | 
			
		||||
   if (Use_ARB_fbo) {
 | 
			
		||||
      /* use a smaller depth buffer to see what happens */
 | 
			
		||||
@@ -541,7 +541,7 @@ MakeFBO_RenderTexture(GLuint TexObj)
 | 
			
		||||
 | 
			
		||||
   /* queries */
 | 
			
		||||
   {
 | 
			
		||||
      GLint bits, w, h;
 | 
			
		||||
      GLint bits, w, h, name;
 | 
			
		||||
 | 
			
		||||
      glBindRenderbuffer_func(GL_RENDERBUFFER_EXT, DepthRB);
 | 
			
		||||
      glGetRenderbufferParameteriv_func(GL_RENDERBUFFER_EXT,
 | 
			
		||||
@@ -559,8 +559,28 @@ MakeFBO_RenderTexture(GLuint TexObj)
 | 
			
		||||
      glGetRenderbufferParameteriv_func(GL_RENDERBUFFER_EXT,
 | 
			
		||||
                                      GL_RENDERBUFFER_STENCIL_SIZE_EXT, &bits);
 | 
			
		||||
      printf("Stencil renderbuffer size = %d bits\n", bits);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
      glGetFramebufferAttachmentParameteriv_func(GL_FRAMEBUFFER_EXT,
 | 
			
		||||
                                      GL_COLOR_ATTACHMENT0,
 | 
			
		||||
                                      GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT,
 | 
			
		||||
                                      &name);
 | 
			
		||||
      printf("Render to texture name: %d\n", texObj);
 | 
			
		||||
      printf("Color attachment[0] name: %d\n", name);
 | 
			
		||||
      assert(texObj == name);
 | 
			
		||||
 | 
			
		||||
      glGetFramebufferAttachmentParameteriv_func(GL_FRAMEBUFFER_EXT,
 | 
			
		||||
                                      GL_STENCIL_ATTACHMENT,
 | 
			
		||||
                                      GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT,
 | 
			
		||||
                                      &name);
 | 
			
		||||
      printf("Stencil attachment name: %d\n", name);
 | 
			
		||||
 | 
			
		||||
      glGetFramebufferAttachmentParameteriv_func(GL_FRAMEBUFFER_EXT,
 | 
			
		||||
                                      GL_DEPTH_ATTACHMENT,
 | 
			
		||||
                                      GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT,
 | 
			
		||||
                                      &name);
 | 
			
		||||
      printf("Depth attachment name: %d\n", name);
 | 
			
		||||
 | 
			
		||||
   }
 | 
			
		||||
   /* bind the regular framebuffer */
 | 
			
		||||
   glBindFramebuffer_func(GL_FRAMEBUFFER_EXT, 0);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -32,6 +32,7 @@ DEMO_SOURCES = \
 | 
			
		||||
	pointcoord.c \
 | 
			
		||||
	points.c \
 | 
			
		||||
	samplers.c \
 | 
			
		||||
	samplers_array.c \
 | 
			
		||||
	shadow_sampler.c \
 | 
			
		||||
	skinning.c \
 | 
			
		||||
	texaaline.c \
 | 
			
		||||
@@ -188,7 +189,8 @@ samplers.o: $(UTIL_HEADERS)
 | 
			
		||||
samplers: samplers.o $(UTIL_OBJS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
samplers_array.o: $(UTIL_HEADERS)
 | 
			
		||||
samplers_array.o: samplers.c $(UTIL_HEADERS)
 | 
			
		||||
	$(APP_CC) -I$(INCDIR) $(CFLAGS) -DSAMPLERS_ARRAY $< -c -o $@
 | 
			
		||||
 | 
			
		||||
samplers_array: samplers_array.o $(UTIL_OBJS)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -211,10 +211,18 @@ InitTextures(void)
 | 
			
		||||
      for (y = 0; y < stripeSize; y++) {
 | 
			
		||||
         for (x = 0; x < size; x++) {
 | 
			
		||||
            GLint k = 4 * ((ypos + y) * size + x);
 | 
			
		||||
            texImage[k + 0] = intensity;
 | 
			
		||||
            texImage[k + 1] = intensity;
 | 
			
		||||
            texImage[k + 2] = 0;
 | 
			
		||||
            texImage[k + 3] = 255;
 | 
			
		||||
            if (x < size / 2) {
 | 
			
		||||
               texImage[k + 0] = intensity;
 | 
			
		||||
               texImage[k + 1] = intensity;
 | 
			
		||||
               texImage[k + 2] = 0;
 | 
			
		||||
               texImage[k + 3] = 255;
 | 
			
		||||
            }
 | 
			
		||||
            else {
 | 
			
		||||
               texImage[k + 0] = 255 - intensity;
 | 
			
		||||
               texImage[k + 1] = 0;
 | 
			
		||||
               texImage[k + 2] = 0;
 | 
			
		||||
               texImage[k + 3] = 255;
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -127,7 +127,7 @@ Init( void )
 | 
			
		||||
 | 
			
		||||
   if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
 | 
			
		||||
      printf("GL_EXT_framebuffer_object not found!\n");
 | 
			
		||||
      /*exit(0);*/
 | 
			
		||||
      exit(0);
 | 
			
		||||
   }
 | 
			
		||||
   printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -258,8 +258,26 @@ static void Init( void )
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   glBindTexture(GL_TEXTURE_2D, BORDER_TEXTURE);
 | 
			
		||||
#ifdef TEST_PBO_DLIST
 | 
			
		||||
   /* test fetching teximage from PBO in display list */
 | 
			
		||||
   {
 | 
			
		||||
      GLuint b = 42, l = 10;
 | 
			
		||||
 | 
			
		||||
      glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, b);
 | 
			
		||||
      glBufferDataARB(GL_PIXEL_UNPACK_BUFFER, sizeof(BorderImage),
 | 
			
		||||
                      BorderImage, GL_STREAM_DRAW);
 | 
			
		||||
 | 
			
		||||
      glNewList(l, GL_COMPILE);
 | 
			
		||||
      glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE+2, SIZE+2, 1,
 | 
			
		||||
                GL_RGBA, GL_UNSIGNED_BYTE, (void *) 0/* BorderImage*/);
 | 
			
		||||
      glEndList();
 | 
			
		||||
      glCallList(l);
 | 
			
		||||
      glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, 0);
 | 
			
		||||
   }
 | 
			
		||||
#else
 | 
			
		||||
   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE+2, SIZE+2, 1,
 | 
			
		||||
                GL_RGBA, GL_UNSIGNED_BYTE, (void *) BorderImage);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < SIZE; i++) {
 | 
			
		||||
      for (j = 0; j < SIZE; j++) {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								progs/trivial/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								progs/trivial/.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -5,10 +5,17 @@ clear-random
 | 
			
		||||
clear-repeat
 | 
			
		||||
clear-scissor
 | 
			
		||||
clear-undefined
 | 
			
		||||
createwin
 | 
			
		||||
dlist-begin-call-end
 | 
			
		||||
dlist-dangling
 | 
			
		||||
dlist-degenerate
 | 
			
		||||
dlist-edgeflag
 | 
			
		||||
dlist-edgeflag-dangling
 | 
			
		||||
dlist-flat-tri
 | 
			
		||||
dlist-mat-tri
 | 
			
		||||
dlist-recursive-call
 | 
			
		||||
dlist-tri-flat-tri
 | 
			
		||||
dlist-tri-mat-tri
 | 
			
		||||
draw2arrays
 | 
			
		||||
drawarrays
 | 
			
		||||
drawelements
 | 
			
		||||
@@ -30,6 +37,7 @@ lineloop
 | 
			
		||||
lineloop-clip
 | 
			
		||||
lineloop-elts
 | 
			
		||||
linestrip
 | 
			
		||||
linestrip-clip
 | 
			
		||||
linestrip-flat-stipple
 | 
			
		||||
linestrip-stipple
 | 
			
		||||
linestrip-stipple-wide
 | 
			
		||||
@@ -70,8 +78,10 @@ quadstrip-cont
 | 
			
		||||
quadstrip-flat
 | 
			
		||||
readtex.c
 | 
			
		||||
readtex.h
 | 
			
		||||
readpixels
 | 
			
		||||
tri
 | 
			
		||||
tri-alpha
 | 
			
		||||
tri-alpha-tex
 | 
			
		||||
tri-array-interleaved
 | 
			
		||||
tri-blend
 | 
			
		||||
tri-blend-color
 | 
			
		||||
@@ -79,6 +89,7 @@ tri-blend-max
 | 
			
		||||
tri-blend-min
 | 
			
		||||
tri-blend-revsub
 | 
			
		||||
tri-blend-sub
 | 
			
		||||
tri-clear
 | 
			
		||||
tri-clip
 | 
			
		||||
tri-cull
 | 
			
		||||
tri-cull-both
 | 
			
		||||
@@ -93,6 +104,7 @@ tri-fog
 | 
			
		||||
tri-fp
 | 
			
		||||
tri-fp-const-imm
 | 
			
		||||
tri-lit
 | 
			
		||||
tri-lit-material
 | 
			
		||||
tri-logicop-none
 | 
			
		||||
tri-logicop-xor
 | 
			
		||||
tri-mask-tri
 | 
			
		||||
@@ -101,6 +113,7 @@ tri-orig
 | 
			
		||||
tri-query
 | 
			
		||||
tri-repeat
 | 
			
		||||
tri-scissor-tri
 | 
			
		||||
tri-square
 | 
			
		||||
tri-stencil
 | 
			
		||||
tri-stipple
 | 
			
		||||
tri-tex
 | 
			
		||||
@@ -110,6 +123,7 @@ tri-unfilled
 | 
			
		||||
tri-unfilled-clip
 | 
			
		||||
tri-unfilled-edgeflag
 | 
			
		||||
tri-unfilled-fog
 | 
			
		||||
tri-unfilled-point
 | 
			
		||||
tri-unfilled-smooth
 | 
			
		||||
tri-unfilled-tri
 | 
			
		||||
tri-unfilled-tri-lit
 | 
			
		||||
@@ -118,6 +132,7 @@ tri-unfilled-userclip-stip
 | 
			
		||||
tri-userclip
 | 
			
		||||
tri-viewport
 | 
			
		||||
tri-z
 | 
			
		||||
tri-z-9
 | 
			
		||||
tri-z-eq
 | 
			
		||||
trifan
 | 
			
		||||
trifan-flat
 | 
			
		||||
 
 | 
			
		||||
@@ -18,6 +18,7 @@ SOURCES = \
 | 
			
		||||
	clear-repeat.c \
 | 
			
		||||
	clear-random.c \
 | 
			
		||||
	clear.c \
 | 
			
		||||
	createwin.c \
 | 
			
		||||
	dlist-dangling.c \
 | 
			
		||||
	dlist-flat-tri.c \
 | 
			
		||||
	dlist-mat-tri.c \
 | 
			
		||||
@@ -48,6 +49,7 @@ SOURCES = \
 | 
			
		||||
	lineloop-clip.c \
 | 
			
		||||
	lineloop-elts.c \
 | 
			
		||||
	lineloop.c \
 | 
			
		||||
	linestrip-clip.c \
 | 
			
		||||
	linestrip-flat-stipple.c \
 | 
			
		||||
	linestrip-stipple-wide.c \
 | 
			
		||||
	linestrip-stipple.c \
 | 
			
		||||
@@ -87,7 +89,9 @@ SOURCES = \
 | 
			
		||||
	quadstrip-cont.c \
 | 
			
		||||
	quadstrip-flat.c \
 | 
			
		||||
	quadstrip.c \
 | 
			
		||||
	readpixels.c \
 | 
			
		||||
	tri-alpha.c \
 | 
			
		||||
	tri-alpha-tex.c \
 | 
			
		||||
	tri-array-interleaved.c \
 | 
			
		||||
	tri-blend-color.c \
 | 
			
		||||
	tri-blend-max.c \
 | 
			
		||||
@@ -95,6 +99,7 @@ SOURCES = \
 | 
			
		||||
	tri-blend-revsub.c \
 | 
			
		||||
	tri-blend-sub.c \
 | 
			
		||||
	tri-blend.c \
 | 
			
		||||
	tri-clear.c \
 | 
			
		||||
	tri-clip.c \
 | 
			
		||||
	tri-cull-both.c \
 | 
			
		||||
	tri-cull.c \
 | 
			
		||||
@@ -117,6 +122,7 @@ SOURCES = \
 | 
			
		||||
	tri-query.c \
 | 
			
		||||
	tri-repeat.c \
 | 
			
		||||
	tri-scissor-tri.c \
 | 
			
		||||
	tri-square.c \
 | 
			
		||||
	tri-stencil.c \
 | 
			
		||||
	tri-stipple.c \
 | 
			
		||||
	tri-multitex-vbo.c \
 | 
			
		||||
@@ -126,6 +132,7 @@ SOURCES = \
 | 
			
		||||
	tri-unfilled-fog.c \
 | 
			
		||||
	tri-unfilled-edgeflag.c \
 | 
			
		||||
	tri-unfilled-clip.c \
 | 
			
		||||
	tri-unfilled-point.c \
 | 
			
		||||
	tri-unfilled-smooth.c \
 | 
			
		||||
	tri-unfilled-tri.c \
 | 
			
		||||
	tri-unfilled-tri-lit.c \
 | 
			
		||||
@@ -134,6 +141,7 @@ SOURCES = \
 | 
			
		||||
	tri-unfilled.c \
 | 
			
		||||
	tri-userclip.c \
 | 
			
		||||
	tri-viewport.c \
 | 
			
		||||
	tri-z-9.c \
 | 
			
		||||
	tri-z-eq.c \
 | 
			
		||||
	tri-z.c \
 | 
			
		||||
	tri.c \
 | 
			
		||||
 
 | 
			
		||||
@@ -119,6 +119,12 @@ static void Init( void )
 | 
			
		||||
      glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
 | 
			
		||||
      glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
 | 
			
		||||
		        sz, (const GLubyte *) buf);
 | 
			
		||||
      if (glGetError()) {
 | 
			
		||||
         printf("Program failed to compile:\n%s\n", buf);
 | 
			
		||||
         printf("Error: %s\n",
 | 
			
		||||
                (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
 | 
			
		||||
         exit(1);
 | 
			
		||||
      }
 | 
			
		||||
      assert(glIsProgramARB(prognum));
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -378,6 +378,9 @@ make_window( Display *dpy, const char *name,
 | 
			
		||||
   scrnum = DefaultScreen( dpy );
 | 
			
		||||
   root = RootWindow( dpy, scrnum );
 | 
			
		||||
 | 
			
		||||
   if (visinfo)
 | 
			
		||||
	   XFree(visinfo);
 | 
			
		||||
 | 
			
		||||
   visinfo = glXChooseVisual( dpy, scrnum, attribs );
 | 
			
		||||
   if (!visinfo) {
 | 
			
		||||
      printf("Error: couldn't get an RGB, Double-buffered visual\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -587,6 +587,9 @@ event_loop(Display *dpy, Window win)
 | 
			
		||||
      angle += 2.0;
 | 
			
		||||
 | 
			
		||||
      draw();
 | 
			
		||||
 | 
			
		||||
      glXSwapBuffers(dpy, win);
 | 
			
		||||
 | 
			
		||||
      if ( get_frame_usage != NULL ) {
 | 
			
		||||
	 GLfloat   temp;
 | 
			
		||||
	 
 | 
			
		||||
@@ -594,8 +597,6 @@ event_loop(Display *dpy, Window win)
 | 
			
		||||
	 frame_usage += temp;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      glXSwapBuffers(dpy, win);
 | 
			
		||||
 | 
			
		||||
      /* calc framerate */
 | 
			
		||||
      {
 | 
			
		||||
         static int t0 = -1;
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@ TOP = ../../../..
 | 
			
		||||
include $(TOP)/configs/current
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/egl/main
 | 
			
		||||
INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/egl/main $(X11_INCLUDES)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
SOURCES = demo.c
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@ TOP = ../../..
 | 
			
		||||
include $(TOP)/configs/current
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/mesa/glapi
 | 
			
		||||
INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/mesa/glapi $(X11_INCLUDES)
 | 
			
		||||
 | 
			
		||||
HEADERS = \
 | 
			
		||||
	eglconfig.h \
 | 
			
		||||
 
 | 
			
		||||
@@ -158,6 +158,60 @@ static void do_triangle( struct draw_context *draw,
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define QUAD(i0,i1,i2,i3)                       \
 | 
			
		||||
   do_triangle( draw,                           \
 | 
			
		||||
                ( DRAW_PIPE_RESET_STIPPLE |     \
 | 
			
		||||
                  DRAW_PIPE_EDGE_FLAG_0 |       \
 | 
			
		||||
                  DRAW_PIPE_EDGE_FLAG_2 ),      \
 | 
			
		||||
                verts + stride * elts[i0],      \
 | 
			
		||||
                verts + stride * elts[i1],      \
 | 
			
		||||
                verts + stride * elts[i3]);     \
 | 
			
		||||
   do_triangle( draw,                           \
 | 
			
		||||
                ( DRAW_PIPE_EDGE_FLAG_0 |       \
 | 
			
		||||
                  DRAW_PIPE_EDGE_FLAG_1 ),      \
 | 
			
		||||
                verts + stride * elts[i1],      \
 | 
			
		||||
                verts + stride * elts[i2],      \
 | 
			
		||||
                verts + stride * elts[i3])
 | 
			
		||||
 | 
			
		||||
#define TRIANGLE(flags,i0,i1,i2)                                        \
 | 
			
		||||
   do_triangle( draw,                                                   \
 | 
			
		||||
                elts[i0],  /* flags */                          \
 | 
			
		||||
                verts + stride * (elts[i0] & ~DRAW_PIPE_FLAG_MASK),     \
 | 
			
		||||
                verts + stride * elts[i1],                              \
 | 
			
		||||
                verts + stride * elts[i2])
 | 
			
		||||
 | 
			
		||||
#define LINE(flags,i0,i1)                                       \
 | 
			
		||||
   do_line( draw,                                               \
 | 
			
		||||
            elts[i0],                                   \
 | 
			
		||||
            verts + stride * (elts[i0] & ~DRAW_PIPE_FLAG_MASK), \
 | 
			
		||||
            verts + stride * elts[i1])
 | 
			
		||||
 | 
			
		||||
#define POINT(i0)                               \
 | 
			
		||||
   do_point( draw,                              \
 | 
			
		||||
             verts + stride * elts[i0] )
 | 
			
		||||
 | 
			
		||||
#define FUNC pipe_run
 | 
			
		||||
#define ARGS                                    \
 | 
			
		||||
    struct draw_context *draw,                  \
 | 
			
		||||
    unsigned prim,                              \
 | 
			
		||||
    struct vertex_header *vertices,             \
 | 
			
		||||
    unsigned stride,                            \
 | 
			
		||||
    const ushort *elts
 | 
			
		||||
 | 
			
		||||
#define LOCAL_VARS                                           \
 | 
			
		||||
   char *verts = (char *)vertices;                           \
 | 
			
		||||
   boolean flatfirst = (draw->rasterizer->flatshade &&       \
 | 
			
		||||
                        draw->rasterizer->flatshade_first);  \
 | 
			
		||||
   unsigned i;                                               \
 | 
			
		||||
   ushort flags
 | 
			
		||||
 | 
			
		||||
#define FLUSH
 | 
			
		||||
 | 
			
		||||
#include "draw_pt_decompose.h"
 | 
			
		||||
#undef ARGS
 | 
			
		||||
#undef LOCAL_VARS
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Code to run the pipeline on a fairly arbitary collection of vertices.
 | 
			
		||||
 *
 | 
			
		||||
@@ -178,34 +232,12 @@ void draw_pipeline_run( struct draw_context *draw,
 | 
			
		||||
                        unsigned count )
 | 
			
		||||
{
 | 
			
		||||
   char *verts = (char *)vertices;
 | 
			
		||||
   unsigned i;
 | 
			
		||||
 | 
			
		||||
   draw->pipeline.verts = verts;
 | 
			
		||||
   draw->pipeline.vertex_stride = stride;
 | 
			
		||||
   draw->pipeline.vertex_count = vertex_count;
 | 
			
		||||
   
 | 
			
		||||
   switch (prim) {
 | 
			
		||||
   case PIPE_PRIM_POINTS:
 | 
			
		||||
      for (i = 0; i < count; i++) 
 | 
			
		||||
         do_point( draw, 
 | 
			
		||||
                   verts + stride * elts[i] );
 | 
			
		||||
      break;
 | 
			
		||||
   case PIPE_PRIM_LINES:
 | 
			
		||||
      for (i = 0; i+1 < count; i += 2) 
 | 
			
		||||
         do_line( draw, 
 | 
			
		||||
                  elts[i+0],  /* flags */
 | 
			
		||||
                  verts + stride * (elts[i+0] & ~DRAW_PIPE_FLAG_MASK),
 | 
			
		||||
                  verts + stride * elts[i+1]);
 | 
			
		||||
      break;
 | 
			
		||||
   case PIPE_PRIM_TRIANGLES:
 | 
			
		||||
      for (i = 0; i+2 < count; i += 3)
 | 
			
		||||
         do_triangle( draw, 
 | 
			
		||||
                      elts[i+0],  /* flags */
 | 
			
		||||
                      verts + stride * (elts[i+0] & ~DRAW_PIPE_FLAG_MASK),
 | 
			
		||||
                      verts + stride * elts[i+1],
 | 
			
		||||
                      verts + stride * elts[i+2]);
 | 
			
		||||
      break;
 | 
			
		||||
   }
 | 
			
		||||
   pipe_run(draw, prim, vertices, stride, elts, count);
 | 
			
		||||
   
 | 
			
		||||
   draw->pipeline.verts = NULL;
 | 
			
		||||
   draw->pipeline.vertex_count = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -477,6 +477,8 @@ tgsi_default_full_instruction( void )
 | 
			
		||||
      full_instruction.FullSrcRegisters[i] = tgsi_default_full_src_register();
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   full_instruction.Flags = 0x0;
 | 
			
		||||
 | 
			
		||||
   return full_instruction;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -62,6 +62,9 @@
 | 
			
		||||
 | 
			
		||||
#define FAST_MATH 1
 | 
			
		||||
 | 
			
		||||
/** for tgsi_full_instruction::Flags */
 | 
			
		||||
#define SOA_DEPENDENCY_FLAG 0x1
 | 
			
		||||
 | 
			
		||||
#define TILE_TOP_LEFT     0
 | 
			
		||||
#define TILE_TOP_RIGHT    1
 | 
			
		||||
#define TILE_BOTTOM_LEFT  2
 | 
			
		||||
@@ -182,7 +185,7 @@ print_temp(const struct tgsi_exec_machine *mach, uint index)
 | 
			
		||||
 *   MOV t3, t2;
 | 
			
		||||
 * The second instruction will have the wrong value for t0 if executed as-is.
 | 
			
		||||
 */
 | 
			
		||||
static boolean
 | 
			
		||||
boolean
 | 
			
		||||
tgsi_check_soa_dependencies(const struct tgsi_full_instruction *inst)
 | 
			
		||||
{
 | 
			
		||||
   uint i, chan;
 | 
			
		||||
@@ -328,20 +331,25 @@ tgsi_exec_machine_bind_shader(
 | 
			
		||||
                                   * sizeof(struct tgsi_full_instruction));
 | 
			
		||||
            maxInstructions += 10;
 | 
			
		||||
         }
 | 
			
		||||
 | 
			
		||||
         if (tgsi_check_soa_dependencies(&parse.FullToken.FullInstruction)) {
 | 
			
		||||
            uint opcode = parse.FullToken.FullInstruction.Instruction.Opcode;
 | 
			
		||||
            parse.FullToken.FullInstruction.Flags = SOA_DEPENDENCY_FLAG;
 | 
			
		||||
            /* XXX we only handle SOA dependencies properly for MOV/SWZ
 | 
			
		||||
             * at this time!
 | 
			
		||||
             */
 | 
			
		||||
            if (opcode != TGSI_OPCODE_MOV && opcode != TGSI_OPCODE_SWZ) {
 | 
			
		||||
               debug_printf("Warning: SOA dependency in instruction"
 | 
			
		||||
                            " is not handled:\n");
 | 
			
		||||
               tgsi_dump_instruction(&parse.FullToken.FullInstruction,
 | 
			
		||||
                                     numInstructions);
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
 | 
			
		||||
         memcpy(instructions + numInstructions,
 | 
			
		||||
                &parse.FullToken.FullInstruction,
 | 
			
		||||
                sizeof(instructions[0]));
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
         if (tgsi_check_soa_dependencies(&parse.FullToken.FullInstruction)) {
 | 
			
		||||
            debug_printf("SOA dependency in instruction:\n");
 | 
			
		||||
            tgsi_dump_instruction(&parse.FullToken.FullInstruction,
 | 
			
		||||
                                  numInstructions);
 | 
			
		||||
         }
 | 
			
		||||
#else
 | 
			
		||||
         (void) tgsi_check_soa_dependencies;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
         numInstructions++;
 | 
			
		||||
         break;
 | 
			
		||||
 | 
			
		||||
@@ -2018,9 +2026,23 @@ exec_instruction(
 | 
			
		||||
 | 
			
		||||
   case TGSI_OPCODE_MOV:
 | 
			
		||||
   case TGSI_OPCODE_SWZ:
 | 
			
		||||
      FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
 | 
			
		||||
         FETCH( &r[0], 0, chan_index );
 | 
			
		||||
         STORE( &r[0], 0, chan_index );
 | 
			
		||||
      if (inst->Flags & SOA_DEPENDENCY_FLAG) {
 | 
			
		||||
         /* Do all fetches into temp regs, then do all stores to avoid
 | 
			
		||||
          * intermediate/accidental clobbering.  This could be done all the
 | 
			
		||||
          * time for MOV but for other instructions we'll need more temps...
 | 
			
		||||
          */
 | 
			
		||||
         FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
 | 
			
		||||
            FETCH( &r[chan_index], 0, chan_index );
 | 
			
		||||
         }
 | 
			
		||||
         FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
 | 
			
		||||
            STORE( &r[chan_index], 0, chan_index );
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
 | 
			
		||||
            FETCH( &r[0], 0, chan_index );
 | 
			
		||||
            STORE( &r[0], 0, chan_index );
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -272,6 +272,10 @@ void
 | 
			
		||||
tgsi_exec_machine_free_data(struct tgsi_exec_machine *mach);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
boolean
 | 
			
		||||
tgsi_check_soa_dependencies(const struct tgsi_full_instruction *inst);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static INLINE void
 | 
			
		||||
tgsi_set_kill_mask(struct tgsi_exec_machine *mach, unsigned mask)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -91,6 +91,7 @@ struct tgsi_full_instruction
 | 
			
		||||
   struct tgsi_instruction_ext_texture InstructionExtTexture;
 | 
			
		||||
   struct tgsi_full_dst_register       FullDstRegisters[TGSI_FULL_MAX_DST_REGISTERS];
 | 
			
		||||
   struct tgsi_full_src_register       FullSrcRegisters[TGSI_FULL_MAX_SRC_REGISTERS];
 | 
			
		||||
   uint Flags;  /**< user-defined usage */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
union tgsi_full_token
 | 
			
		||||
 
 | 
			
		||||
@@ -1107,6 +1107,15 @@ static int
 | 
			
		||||
emit_instruction(struct gen_context *gen,
 | 
			
		||||
                 struct tgsi_full_instruction *inst)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
   /* we don't handle saturation/clamping yet */
 | 
			
		||||
   if (inst->Instruction.Saturate != TGSI_SAT_NONE)
 | 
			
		||||
      return 0;
 | 
			
		||||
 | 
			
		||||
   /* need to use extra temps to fix SOA dependencies : */
 | 
			
		||||
   if (tgsi_check_soa_dependencies(inst))
 | 
			
		||||
      return FALSE;
 | 
			
		||||
 | 
			
		||||
   switch (inst->Instruction.Opcode) {
 | 
			
		||||
   case TGSI_OPCODE_MOV:
 | 
			
		||||
   case TGSI_OPCODE_SWZ:
 | 
			
		||||
 
 | 
			
		||||
@@ -1502,6 +1502,14 @@ emit_instruction(
 | 
			
		||||
   if (indirect_temp_reference(inst))
 | 
			
		||||
      return FALSE;
 | 
			
		||||
 | 
			
		||||
   /* we don't handle saturation/clamping yet */
 | 
			
		||||
   if (inst->Instruction.Saturate != TGSI_SAT_NONE)
 | 
			
		||||
      return FALSE;
 | 
			
		||||
 | 
			
		||||
   /* need to use extra temps to fix SOA dependencies : */
 | 
			
		||||
   if (tgsi_check_soa_dependencies(inst))
 | 
			
		||||
      return FALSE;
 | 
			
		||||
 | 
			
		||||
   switch (inst->Instruction.Opcode) {
 | 
			
		||||
   case TGSI_OPCODE_ARL:
 | 
			
		||||
      FOR_EACH_DST0_ENABLED_CHANNEL( *inst, chan_index ) {
 | 
			
		||||
 
 | 
			
		||||
@@ -45,6 +45,7 @@
 | 
			
		||||
#include "util/u_math.h"
 | 
			
		||||
#include "util/u_memory.h"
 | 
			
		||||
#include "util/u_simple_shaders.h"
 | 
			
		||||
#include "util/u_surface.h"
 | 
			
		||||
 | 
			
		||||
#include "cso_cache/cso_context.h"
 | 
			
		||||
 | 
			
		||||
@@ -61,7 +62,7 @@ struct blit_state
 | 
			
		||||
   struct pipe_viewport_state viewport;
 | 
			
		||||
 | 
			
		||||
   void *vs;
 | 
			
		||||
   void *fs;
 | 
			
		||||
   void *fs[TGSI_WRITEMASK_XYZW + 1];
 | 
			
		||||
 | 
			
		||||
   struct pipe_buffer *vbuf;  /**< quad vertices */
 | 
			
		||||
   unsigned vbuf_slot;
 | 
			
		||||
@@ -124,7 +125,7 @@ util_create_blit(struct pipe_context *pipe, struct cso_context *cso)
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   /* fragment shader */
 | 
			
		||||
   ctx->fs = util_make_fragment_tex_shader(pipe);
 | 
			
		||||
   ctx->fs[TGSI_WRITEMASK_XYZW] = util_make_fragment_tex_shader(pipe);
 | 
			
		||||
   ctx->vbuf = NULL;
 | 
			
		||||
 | 
			
		||||
   /* init vertex data that doesn't change */
 | 
			
		||||
@@ -145,9 +146,13 @@ void
 | 
			
		||||
util_destroy_blit(struct blit_state *ctx)
 | 
			
		||||
{
 | 
			
		||||
   struct pipe_context *pipe = ctx->pipe;
 | 
			
		||||
   unsigned i;
 | 
			
		||||
 | 
			
		||||
   pipe->delete_vs_state(pipe, ctx->vs);
 | 
			
		||||
   pipe->delete_fs_state(pipe, ctx->fs);
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < Elements(ctx->fs); i++)
 | 
			
		||||
      if (ctx->fs[i])
 | 
			
		||||
         pipe->delete_fs_state(pipe, ctx->fs[i]);
 | 
			
		||||
 | 
			
		||||
   pipe_buffer_reference(&ctx->vbuf, NULL);
 | 
			
		||||
 | 
			
		||||
@@ -155,7 +160,11 @@ util_destroy_blit(struct blit_state *ctx)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static unsigned get_next_slot( struct blit_state *ctx )
 | 
			
		||||
/**
 | 
			
		||||
 * Get offset of next free slot in vertex buffer for quad vertices.
 | 
			
		||||
 */
 | 
			
		||||
static unsigned
 | 
			
		||||
get_next_slot( struct blit_state *ctx )
 | 
			
		||||
{
 | 
			
		||||
   const unsigned max_slots = 4096 / sizeof ctx->vertices;
 | 
			
		||||
 | 
			
		||||
@@ -173,7 +182,6 @@ static unsigned get_next_slot( struct blit_state *ctx )
 | 
			
		||||
}
 | 
			
		||||
                               
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Setup vertex data for the textured quad we'll draw.
 | 
			
		||||
 * Note: y=0=top
 | 
			
		||||
@@ -260,20 +268,50 @@ setup_vertex_data_tex(struct blit_state *ctx,
 | 
			
		||||
 | 
			
		||||
   return offset;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * \return TRUE if two regions overlap, FALSE otherwise
 | 
			
		||||
 */
 | 
			
		||||
static boolean
 | 
			
		||||
regions_overlap(int srcX0, int srcY0,
 | 
			
		||||
                int srcX1, int srcY1,
 | 
			
		||||
                int dstX0, int dstY0,
 | 
			
		||||
                int dstX1, int dstY1)
 | 
			
		||||
{
 | 
			
		||||
   if (MAX2(srcX0, srcX1) < MIN2(dstX0, dstX1))
 | 
			
		||||
      return FALSE; /* src completely left of dst */
 | 
			
		||||
 | 
			
		||||
   if (MAX2(dstX0, dstX1) < MIN2(srcX0, srcX1))
 | 
			
		||||
      return FALSE; /* dst completely left of src */
 | 
			
		||||
 | 
			
		||||
   if (MAX2(srcY0, srcY1) < MIN2(dstY0, dstY1))
 | 
			
		||||
      return FALSE; /* src completely above dst */
 | 
			
		||||
 | 
			
		||||
   if (MAX2(dstY0, dstY1) < MIN2(srcY0, srcY1))
 | 
			
		||||
      return FALSE; /* dst completely above src */
 | 
			
		||||
 | 
			
		||||
   return TRUE; /* some overlap */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Copy pixel block from src surface to dst surface.
 | 
			
		||||
 * Overlapping regions are acceptable.
 | 
			
		||||
 * Flipping and stretching are supported.
 | 
			
		||||
 * XXX what about clipping???
 | 
			
		||||
 * XXX need some control over blitting Z and/or stencil.
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
util_blit_pixels(struct blit_state *ctx,
 | 
			
		||||
                 struct pipe_surface *src,
 | 
			
		||||
                 int srcX0, int srcY0,
 | 
			
		||||
                 int srcX1, int srcY1,
 | 
			
		||||
                 struct pipe_surface *dst,
 | 
			
		||||
                 int dstX0, int dstY0,
 | 
			
		||||
                 int dstX1, int dstY1,
 | 
			
		||||
                 float z, uint filter)
 | 
			
		||||
util_blit_pixels_writemask(struct blit_state *ctx,
 | 
			
		||||
                           struct pipe_surface *src,
 | 
			
		||||
                           int srcX0, int srcY0,
 | 
			
		||||
                           int srcX1, int srcY1,
 | 
			
		||||
                           struct pipe_surface *dst,
 | 
			
		||||
                           int dstX0, int dstY0,
 | 
			
		||||
                           int dstX1, int dstY1,
 | 
			
		||||
                           float z, uint filter,
 | 
			
		||||
                           uint writemask)
 | 
			
		||||
{
 | 
			
		||||
   struct pipe_context *pipe = ctx->pipe;
 | 
			
		||||
   struct pipe_screen *screen = pipe->screen;
 | 
			
		||||
@@ -285,10 +323,41 @@ util_blit_pixels(struct blit_state *ctx,
 | 
			
		||||
   const int srcLeft = MIN2(srcX0, srcX1);
 | 
			
		||||
   const int srcTop = MIN2(srcY0, srcY1);
 | 
			
		||||
   unsigned offset;
 | 
			
		||||
   boolean overlap;
 | 
			
		||||
 | 
			
		||||
   assert(filter == PIPE_TEX_MIPFILTER_NEAREST ||
 | 
			
		||||
          filter == PIPE_TEX_MIPFILTER_LINEAR);
 | 
			
		||||
 | 
			
		||||
   assert(screen->is_format_supported(screen, src->format, PIPE_TEXTURE_2D,
 | 
			
		||||
                                      PIPE_TEXTURE_USAGE_SAMPLER, 0));
 | 
			
		||||
   assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
 | 
			
		||||
                                      PIPE_TEXTURE_USAGE_RENDER_TARGET, 0));
 | 
			
		||||
 | 
			
		||||
   /* do the regions overlap? */
 | 
			
		||||
   overlap = util_same_surface(src, dst) &&
 | 
			
		||||
      regions_overlap(srcX0, srcY0, srcX1, srcY1,
 | 
			
		||||
                      dstX0, dstY0, dstX1, dstY1);
 | 
			
		||||
 | 
			
		||||
   /*
 | 
			
		||||
    * Check for simple case:  no format conversion, no flipping, no stretching,
 | 
			
		||||
    * no overlapping.
 | 
			
		||||
    * Filter mode should not matter since there's no stretching.
 | 
			
		||||
    */
 | 
			
		||||
   if (dst->format == src->format &&
 | 
			
		||||
       srcX0 < srcX1 &&
 | 
			
		||||
       dstX0 < dstX1 &&
 | 
			
		||||
       srcY0 < srcY1 &&
 | 
			
		||||
       dstY0 < dstY1 &&
 | 
			
		||||
       (dstX1 - dstX0) == (srcX1 - srcX0) &&
 | 
			
		||||
       (dstY1 - dstY0) == (srcY1 - srcY0) &&
 | 
			
		||||
       !overlap) {
 | 
			
		||||
      pipe->surface_copy(pipe,
 | 
			
		||||
			 dst, dstX0, dstY0, /* dest */
 | 
			
		||||
			 src, srcX0, srcY0, /* src */
 | 
			
		||||
			 srcW, srcH);       /* size */
 | 
			
		||||
      return;
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
   if (srcLeft != srcX0) {
 | 
			
		||||
      /* left-right flip */
 | 
			
		||||
      int tmp = dstX0;
 | 
			
		||||
@@ -303,20 +372,6 @@ util_blit_pixels(struct blit_state *ctx,
 | 
			
		||||
      dstY1 = tmp;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   assert(screen->is_format_supported(screen, src->format, PIPE_TEXTURE_2D,
 | 
			
		||||
                                      PIPE_TEXTURE_USAGE_SAMPLER, 0));
 | 
			
		||||
   assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
 | 
			
		||||
                                      PIPE_TEXTURE_USAGE_SAMPLER, 0));
 | 
			
		||||
 | 
			
		||||
   if(dst->format == src->format && (dstX1 - dstX0) == srcW && (dstY1 - dstY0) == srcH) {
 | 
			
		||||
      /* FIXME: this will most surely fail for overlapping rectangles */
 | 
			
		||||
      pipe->surface_copy(pipe,
 | 
			
		||||
			 dst, dstX0, dstY0,   /* dest */
 | 
			
		||||
			 src, srcX0, srcY0, /* src */
 | 
			
		||||
			 srcW, srcH);     /* size */
 | 
			
		||||
      return;
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
   assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
 | 
			
		||||
                                      PIPE_TEXTURE_USAGE_RENDER_TARGET, 0));
 | 
			
		||||
 | 
			
		||||
@@ -376,8 +431,11 @@ util_blit_pixels(struct blit_state *ctx,
 | 
			
		||||
   /* texture */
 | 
			
		||||
   cso_set_sampler_textures(ctx->cso, 1, &tex);
 | 
			
		||||
 | 
			
		||||
   if (ctx->fs[writemask] == NULL)
 | 
			
		||||
      ctx->fs[writemask] = util_make_fragment_tex_shader_writemask(pipe, writemask);
 | 
			
		||||
 | 
			
		||||
   /* shaders */
 | 
			
		||||
   cso_set_fragment_shader_handle(ctx->cso, ctx->fs);
 | 
			
		||||
   cso_set_fragment_shader_handle(ctx->cso, ctx->fs[writemask]);
 | 
			
		||||
   cso_set_vertex_shader_handle(ctx->cso, ctx->vs);
 | 
			
		||||
 | 
			
		||||
   /* drawing dest */
 | 
			
		||||
@@ -412,6 +470,27 @@ util_blit_pixels(struct blit_state *ctx,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
util_blit_pixels(struct blit_state *ctx,
 | 
			
		||||
                 struct pipe_surface *src,
 | 
			
		||||
                 int srcX0, int srcY0,
 | 
			
		||||
                 int srcX1, int srcY1,
 | 
			
		||||
                 struct pipe_surface *dst,
 | 
			
		||||
                 int dstX0, int dstY0,
 | 
			
		||||
                 int dstX1, int dstY1,
 | 
			
		||||
                 float z, uint filter )
 | 
			
		||||
{
 | 
			
		||||
   util_blit_pixels_writemask( ctx, src, 
 | 
			
		||||
                               srcX0, srcY0,
 | 
			
		||||
                               srcX1, srcY1,
 | 
			
		||||
                               dst,
 | 
			
		||||
                               dstX0, dstY0,
 | 
			
		||||
                               dstX1, dstY1,
 | 
			
		||||
                               z, filter,
 | 
			
		||||
                               TGSI_WRITEMASK_XYZW );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Release vertex buffer at end of frame to avoid synchronous
 | 
			
		||||
 * rendering.
 | 
			
		||||
 */
 | 
			
		||||
@@ -485,7 +564,7 @@ util_blit_pixels_tex(struct blit_state *ctx,
 | 
			
		||||
   cso_set_sampler_textures(ctx->cso, 1, &tex);
 | 
			
		||||
 | 
			
		||||
   /* shaders */
 | 
			
		||||
   cso_set_fragment_shader_handle(ctx->cso, ctx->fs);
 | 
			
		||||
   cso_set_fragment_shader_handle(ctx->cso, ctx->fs[TGSI_WRITEMASK_XYZW]);
 | 
			
		||||
   cso_set_vertex_shader_handle(ctx->cso, ctx->vs);
 | 
			
		||||
 | 
			
		||||
   /* drawing dest */
 | 
			
		||||
 
 | 
			
		||||
@@ -60,6 +60,17 @@ util_blit_pixels(struct blit_state *ctx,
 | 
			
		||||
                 int dstX1, int dstY1,
 | 
			
		||||
                 float z, uint filter);
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
util_blit_pixels_writemask(struct blit_state *ctx,
 | 
			
		||||
                           struct pipe_surface *src,
 | 
			
		||||
                           int srcX0, int srcY0,
 | 
			
		||||
                           int srcX1, int srcY1,
 | 
			
		||||
                           struct pipe_surface *dst,
 | 
			
		||||
                           int dstX0, int dstY0,
 | 
			
		||||
                           int dstX1, int dstY1,
 | 
			
		||||
                           float z, uint filter,
 | 
			
		||||
                           uint writemask);
 | 
			
		||||
 | 
			
		||||
extern void
 | 
			
		||||
util_blit_pixels_tex(struct blit_state *ctx,
 | 
			
		||||
                     struct pipe_texture *tex,
 | 
			
		||||
 
 | 
			
		||||
@@ -143,11 +143,9 @@ void _debug_vprintf(const char *format, va_list ap)
 | 
			
		||||
#elif defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
 | 
			
		||||
   /* TODO */
 | 
			
		||||
#else /* !PIPE_SUBSYSTEM_WINDOWS */
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
   fflush(stdout);
 | 
			
		||||
   vfprintf(stderr, format, ap);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -921,11 +921,19 @@ static void
 | 
			
		||||
format_to_type_comps(enum pipe_format pformat,
 | 
			
		||||
                     enum dtype *datatype, uint *comps)
 | 
			
		||||
{
 | 
			
		||||
   /* XXX I think this could be implemented in terms of the pf_*() functions */
 | 
			
		||||
   switch (pformat) {
 | 
			
		||||
   case PIPE_FORMAT_A8R8G8B8_UNORM:
 | 
			
		||||
   case PIPE_FORMAT_X8R8G8B8_UNORM:
 | 
			
		||||
   case PIPE_FORMAT_B8G8R8A8_UNORM:
 | 
			
		||||
   case PIPE_FORMAT_B8G8R8X8_UNORM:
 | 
			
		||||
   case PIPE_FORMAT_R8G8B8A8_SRGB:
 | 
			
		||||
   case PIPE_FORMAT_R8G8B8X8_SRGB:
 | 
			
		||||
   case PIPE_FORMAT_A8R8G8B8_SRGB:
 | 
			
		||||
   case PIPE_FORMAT_X8R8G8B8_SRGB:
 | 
			
		||||
   case PIPE_FORMAT_B8G8R8A8_SRGB:
 | 
			
		||||
   case PIPE_FORMAT_B8G8R8X8_SRGB:
 | 
			
		||||
   case PIPE_FORMAT_R8G8B8_SRGB:
 | 
			
		||||
      *datatype = DTYPE_UBYTE;
 | 
			
		||||
      *comps = 4;
 | 
			
		||||
      return;
 | 
			
		||||
@@ -942,12 +950,14 @@ format_to_type_comps(enum pipe_format pformat,
 | 
			
		||||
      *comps = 3;
 | 
			
		||||
      return;
 | 
			
		||||
   case PIPE_FORMAT_L8_UNORM:
 | 
			
		||||
   case PIPE_FORMAT_L8_SRGB:
 | 
			
		||||
   case PIPE_FORMAT_A8_UNORM:
 | 
			
		||||
   case PIPE_FORMAT_I8_UNORM:
 | 
			
		||||
      *datatype = DTYPE_UBYTE;
 | 
			
		||||
      *comps = 1;
 | 
			
		||||
      return;
 | 
			
		||||
   case PIPE_FORMAT_A8L8_UNORM:
 | 
			
		||||
   case PIPE_FORMAT_A8L8_SRGB:
 | 
			
		||||
      *datatype = DTYPE_UBYTE;
 | 
			
		||||
      *comps = 2;
 | 
			
		||||
      return;
 | 
			
		||||
@@ -1509,6 +1519,17 @@ util_gen_mipmap(struct gen_mipmap_state *ctx,
 | 
			
		||||
   uint zslice = 0;
 | 
			
		||||
   uint offset;
 | 
			
		||||
 | 
			
		||||
   /* The texture object should have room for the levels which we're
 | 
			
		||||
    * about to generate.
 | 
			
		||||
    */
 | 
			
		||||
   assert(lastLevel <= pt->last_level);
 | 
			
		||||
 | 
			
		||||
   /* If this fails, why are we here? */
 | 
			
		||||
   assert(lastLevel > baseLevel);
 | 
			
		||||
 | 
			
		||||
   assert(filter == PIPE_TEX_FILTER_LINEAR ||
 | 
			
		||||
          filter == PIPE_TEX_FILTER_NEAREST);
 | 
			
		||||
 | 
			
		||||
   /* check if we can render in the texture's format */
 | 
			
		||||
   if (!screen->is_format_supported(screen, pt->format, PIPE_TEXTURE_2D,
 | 
			
		||||
                                    PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -152,11 +152,14 @@ util_make_vertex_passthrough_shader(struct pipe_context *pipe,
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Make simple fragment texture shader:
 | 
			
		||||
 *  TEX OUT[0], IN[0], SAMP[0], 2D;
 | 
			
		||||
 *  IMM {0,0,0,1}                         // (if writemask != 0xf)
 | 
			
		||||
 *  MOV OUT[0], IMM[0]                    // (if writemask != 0xf)
 | 
			
		||||
 *  TEX OUT[0].writemask, IN[0], SAMP[0], 2D;
 | 
			
		||||
 *  END;
 | 
			
		||||
 */
 | 
			
		||||
void *
 | 
			
		||||
util_make_fragment_tex_shader(struct pipe_context *pipe)
 | 
			
		||||
util_make_fragment_tex_shader_writemask(struct pipe_context *pipe,
 | 
			
		||||
                                        unsigned writemask )
 | 
			
		||||
{
 | 
			
		||||
   struct pipe_shader_state shader;
 | 
			
		||||
   struct tgsi_token tokens[100];
 | 
			
		||||
@@ -217,12 +220,43 @@ util_make_fragment_tex_shader(struct pipe_context *pipe)
 | 
			
		||||
                                     header,
 | 
			
		||||
                                     Elements(tokens) - ti);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   if (writemask != TGSI_WRITEMASK_XYZW) {
 | 
			
		||||
      struct tgsi_full_immediate imm;
 | 
			
		||||
      static const float value[4] = { 0, 0, 0, 1 };
 | 
			
		||||
 | 
			
		||||
      imm = tgsi_default_full_immediate();
 | 
			
		||||
      imm.Immediate.NrTokens += 4;
 | 
			
		||||
      imm.Immediate.DataType = TGSI_IMM_FLOAT32;
 | 
			
		||||
      imm.u.Pointer = value;
 | 
			
		||||
 | 
			
		||||
      ti += tgsi_build_full_immediate(&imm,
 | 
			
		||||
                                      &tokens[ti],
 | 
			
		||||
                                      header,
 | 
			
		||||
                                      Elements(tokens) - ti );
 | 
			
		||||
 | 
			
		||||
      /* MOV instruction */
 | 
			
		||||
      inst = tgsi_default_full_instruction();
 | 
			
		||||
      inst.Instruction.Opcode = TGSI_OPCODE_MOV;
 | 
			
		||||
      inst.Instruction.NumDstRegs = 1;
 | 
			
		||||
      inst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_OUTPUT;
 | 
			
		||||
      inst.FullDstRegisters[0].DstRegister.Index = 0;
 | 
			
		||||
      inst.Instruction.NumSrcRegs = 1;
 | 
			
		||||
      inst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_IMMEDIATE;
 | 
			
		||||
      inst.FullSrcRegisters[0].SrcRegister.Index = 0;
 | 
			
		||||
      ti += tgsi_build_full_instruction(&inst,
 | 
			
		||||
                                        &tokens[ti],
 | 
			
		||||
                                        header,
 | 
			
		||||
                                        Elements(tokens) - ti );
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   /* TEX instruction */
 | 
			
		||||
   inst = tgsi_default_full_instruction();
 | 
			
		||||
   inst.Instruction.Opcode = TGSI_OPCODE_TEX;
 | 
			
		||||
   inst.Instruction.NumDstRegs = 1;
 | 
			
		||||
   inst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_OUTPUT;
 | 
			
		||||
   inst.FullDstRegisters[0].DstRegister.Index = 0;
 | 
			
		||||
   inst.FullDstRegisters[0].DstRegister.WriteMask = writemask;
 | 
			
		||||
   inst.Instruction.NumSrcRegs = 2;
 | 
			
		||||
   inst.InstructionExtTexture.Texture = TGSI_TEXTURE_2D;
 | 
			
		||||
   inst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_INPUT;
 | 
			
		||||
@@ -253,6 +287,13 @@ util_make_fragment_tex_shader(struct pipe_context *pipe)
 | 
			
		||||
   return pipe->create_fs_state(pipe, &shader);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void *
 | 
			
		||||
util_make_fragment_tex_shader(struct pipe_context *pipe )
 | 
			
		||||
{
 | 
			
		||||
   return util_make_fragment_tex_shader_writemask( pipe,
 | 
			
		||||
                                                   TGSI_WRITEMASK_XYZW );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -49,6 +49,10 @@ util_make_vertex_passthrough_shader(struct pipe_context *pipe,
 | 
			
		||||
                                    const uint *semantic_indexes);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
extern void *
 | 
			
		||||
util_make_fragment_tex_shader_writemask(struct pipe_context *pipe, 
 | 
			
		||||
                                        unsigned writemask );
 | 
			
		||||
 | 
			
		||||
extern void *
 | 
			
		||||
util_make_fragment_tex_shader(struct pipe_context *pipe);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -37,6 +37,23 @@ struct pipe_texture;
 | 
			
		||||
struct pipe_surface;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Are s1 and s2 the same surface?
 | 
			
		||||
 * Surfaces are basically views into textures so check if the two surfaces
 | 
			
		||||
 * name the same part of the same texture.
 | 
			
		||||
 */
 | 
			
		||||
static INLINE boolean
 | 
			
		||||
util_same_surface(const struct pipe_surface *s1, const struct pipe_surface *s2)
 | 
			
		||||
{
 | 
			
		||||
   return (s1->texture == s2->texture &&
 | 
			
		||||
           s1->face == s2->face &&
 | 
			
		||||
           s1->level == s2->level &&
 | 
			
		||||
           s1->zslice == s2->zslice);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
extern boolean
 | 
			
		||||
util_create_rgba_surface(struct pipe_screen *screen,
 | 
			
		||||
                         uint width, uint height,
 | 
			
		||||
 
 | 
			
		||||
@@ -153,7 +153,7 @@ a8r8g8b8_put_tile_rgba(unsigned *dst,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*** PIPE_FORMAT_A8R8G8B8_UNORM ***/
 | 
			
		||||
/*** PIPE_FORMAT_X8R8G8B8_UNORM ***/
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
x8r8g8b8_get_tile_rgba(const unsigned *src,
 | 
			
		||||
@@ -596,6 +596,184 @@ r16g16b16a16_put_tile_rgba(short *dst,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*** PIPE_FORMAT_R8G8B8A8_SRGB ***/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Convert an 8-bit sRGB value from non-linear space to a
 | 
			
		||||
 * linear RGB value in [0, 1].
 | 
			
		||||
 * Implemented with a 256-entry lookup table.
 | 
			
		||||
 */
 | 
			
		||||
static INLINE float
 | 
			
		||||
srgb_to_linear(ubyte cs8)
 | 
			
		||||
{
 | 
			
		||||
   static float table[256];
 | 
			
		||||
   static boolean tableReady = FALSE;
 | 
			
		||||
   if (!tableReady) {
 | 
			
		||||
      /* compute lookup table now */
 | 
			
		||||
      uint i;
 | 
			
		||||
      for (i = 0; i < 256; i++) {
 | 
			
		||||
         const float cs = ubyte_to_float(i);
 | 
			
		||||
         if (cs <= 0.04045) {
 | 
			
		||||
            table[i] = cs / 12.92f;
 | 
			
		||||
         }
 | 
			
		||||
         else {
 | 
			
		||||
            table[i] = (float) powf((cs + 0.055) / 1.055, 2.4);
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
      tableReady = TRUE;
 | 
			
		||||
   }
 | 
			
		||||
   return table[cs8];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Convert linear float in [0,1] to an srgb ubyte value in [0,255].
 | 
			
		||||
 * XXX this hasn't been tested (render to srgb surface).
 | 
			
		||||
 * XXX this needs optimization.
 | 
			
		||||
 */
 | 
			
		||||
static INLINE ubyte
 | 
			
		||||
linear_to_srgb(float cl)
 | 
			
		||||
{
 | 
			
		||||
   if (cl >= 1.0F)
 | 
			
		||||
      return 255;
 | 
			
		||||
   else if (cl >= 0.0031308F)
 | 
			
		||||
      return float_to_ubyte(1.055F * powf(cl, 0.41666F) - 0.055F);
 | 
			
		||||
   else if (cl > 0.0F)
 | 
			
		||||
      return float_to_ubyte(12.92F * cl);
 | 
			
		||||
   else
 | 
			
		||||
      return 0.0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
a8r8g8b8_srgb_get_tile_rgba(const unsigned *src,
 | 
			
		||||
                            unsigned w, unsigned h,
 | 
			
		||||
                            float *p,
 | 
			
		||||
                            unsigned dst_stride)
 | 
			
		||||
{
 | 
			
		||||
   unsigned i, j;
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < h; i++) {
 | 
			
		||||
      float *pRow = p;
 | 
			
		||||
      for (j = 0; j < w; j++, pRow += 4) {
 | 
			
		||||
         const unsigned pixel = *src++;
 | 
			
		||||
         pRow[0] = srgb_to_linear((pixel >> 16) & 0xff);
 | 
			
		||||
         pRow[1] = srgb_to_linear((pixel >>  8) & 0xff);
 | 
			
		||||
         pRow[2] = srgb_to_linear((pixel >>  0) & 0xff);
 | 
			
		||||
         pRow[3] = ubyte_to_float((pixel >> 24) & 0xff);
 | 
			
		||||
      }
 | 
			
		||||
      p += dst_stride;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
a8r8g8b8_srgb_put_tile_rgba(unsigned *dst,
 | 
			
		||||
                            unsigned w, unsigned h,
 | 
			
		||||
                            const float *p,
 | 
			
		||||
                            unsigned src_stride)
 | 
			
		||||
{
 | 
			
		||||
   unsigned i, j;
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < h; i++) {
 | 
			
		||||
      const float *pRow = p;
 | 
			
		||||
      for (j = 0; j < w; j++, pRow += 4) {
 | 
			
		||||
         unsigned r, g, b, a;
 | 
			
		||||
         r = linear_to_srgb(pRow[0]);
 | 
			
		||||
         g = linear_to_srgb(pRow[1]);
 | 
			
		||||
         b = linear_to_srgb(pRow[2]);
 | 
			
		||||
         a = float_to_ubyte(pRow[3]);
 | 
			
		||||
         *dst++ = (a << 24) | (r << 16) | (g << 8) | b;
 | 
			
		||||
      }
 | 
			
		||||
      p += src_stride;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*** PIPE_FORMAT_A8L8_SRGB ***/
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
a8l8_srgb_get_tile_rgba(const ushort *src,
 | 
			
		||||
                        unsigned w, unsigned h,
 | 
			
		||||
                        float *p,
 | 
			
		||||
                        unsigned dst_stride)
 | 
			
		||||
{
 | 
			
		||||
   unsigned i, j;
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < h; i++) {
 | 
			
		||||
      float *pRow = p;
 | 
			
		||||
      for (j = 0; j < w; j++, pRow += 4) {
 | 
			
		||||
         ushort p = *src++;
 | 
			
		||||
         pRow[0] =
 | 
			
		||||
         pRow[1] =
 | 
			
		||||
         pRow[2] = srgb_to_linear(p & 0xff);
 | 
			
		||||
         pRow[3] = ubyte_to_float(p >> 8);
 | 
			
		||||
      }
 | 
			
		||||
      p += dst_stride;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
a8l8_srgb_put_tile_rgba(ushort *dst,
 | 
			
		||||
                        unsigned w, unsigned h,
 | 
			
		||||
                        const float *p,
 | 
			
		||||
                        unsigned src_stride)
 | 
			
		||||
{
 | 
			
		||||
   unsigned i, j;
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < h; i++) {
 | 
			
		||||
      const float *pRow = p;
 | 
			
		||||
      for (j = 0; j < w; j++, pRow += 4) {
 | 
			
		||||
         unsigned r, a;
 | 
			
		||||
         r = linear_to_srgb(pRow[0]);
 | 
			
		||||
         a = float_to_ubyte(pRow[3]);
 | 
			
		||||
         *dst++ = (a << 8) | r;
 | 
			
		||||
      }
 | 
			
		||||
      p += src_stride;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*** PIPE_FORMAT_L8_SRGB ***/
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
l8_srgb_get_tile_rgba(const ubyte *src,
 | 
			
		||||
                      unsigned w, unsigned h,
 | 
			
		||||
                      float *p,
 | 
			
		||||
                      unsigned dst_stride)
 | 
			
		||||
{
 | 
			
		||||
   unsigned i, j;
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < h; i++) {
 | 
			
		||||
      float *pRow = p;
 | 
			
		||||
      for (j = 0; j < w; j++, src++, pRow += 4) {
 | 
			
		||||
         pRow[0] =
 | 
			
		||||
         pRow[1] =
 | 
			
		||||
         pRow[2] = srgb_to_linear(*src);
 | 
			
		||||
         pRow[3] = 1.0;
 | 
			
		||||
      }
 | 
			
		||||
      p += dst_stride;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
l8_srgb_put_tile_rgba(ubyte *dst,
 | 
			
		||||
                      unsigned w, unsigned h,
 | 
			
		||||
                      const float *p,
 | 
			
		||||
                      unsigned src_stride)
 | 
			
		||||
{
 | 
			
		||||
   unsigned i, j;
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < h; i++) {
 | 
			
		||||
      const float *pRow = p;
 | 
			
		||||
      for (j = 0; j < w; j++, pRow += 4) {
 | 
			
		||||
         unsigned r;
 | 
			
		||||
         r = linear_to_srgb(pRow[0]);
 | 
			
		||||
         *dst++ = (ubyte) r;
 | 
			
		||||
      }
 | 
			
		||||
      p += src_stride;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*** PIPE_FORMAT_I8_UNORM ***/
 | 
			
		||||
 | 
			
		||||
@@ -946,6 +1124,15 @@ pipe_tile_raw_to_rgba(enum pipe_format format,
 | 
			
		||||
   case PIPE_FORMAT_R16G16B16A16_SNORM:
 | 
			
		||||
      r16g16b16a16_get_tile_rgba((short *) src, w, h, dst, dst_stride);
 | 
			
		||||
      break;
 | 
			
		||||
   case PIPE_FORMAT_A8R8G8B8_SRGB:
 | 
			
		||||
      a8r8g8b8_srgb_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride);
 | 
			
		||||
      break;
 | 
			
		||||
   case PIPE_FORMAT_A8L8_SRGB:
 | 
			
		||||
      a8l8_srgb_get_tile_rgba((ushort *) src, w, h, dst, dst_stride);
 | 
			
		||||
      break;
 | 
			
		||||
   case PIPE_FORMAT_L8_SRGB:
 | 
			
		||||
      l8_srgb_get_tile_rgba((ubyte *) src, w, h, dst, dst_stride);
 | 
			
		||||
      break;
 | 
			
		||||
   case PIPE_FORMAT_Z16_UNORM:
 | 
			
		||||
      z16_get_tile_rgba((ushort *) src, w, h, dst, dst_stride);
 | 
			
		||||
      break;
 | 
			
		||||
@@ -1059,6 +1246,15 @@ pipe_put_tile_rgba(struct pipe_transfer *pt,
 | 
			
		||||
   case PIPE_FORMAT_R16G16B16A16_SNORM:
 | 
			
		||||
      r16g16b16a16_put_tile_rgba((short *) packed, w, h, p, src_stride);
 | 
			
		||||
      break;
 | 
			
		||||
   case PIPE_FORMAT_A8R8G8B8_SRGB:
 | 
			
		||||
      a8r8g8b8_srgb_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);
 | 
			
		||||
      break;
 | 
			
		||||
   case PIPE_FORMAT_A8L8_SRGB:
 | 
			
		||||
      a8l8_srgb_put_tile_rgba((ushort *) packed, w, h, p, src_stride);
 | 
			
		||||
      break;
 | 
			
		||||
   case PIPE_FORMAT_L8_SRGB:
 | 
			
		||||
      l8_srgb_put_tile_rgba((ubyte *) packed, w, h, p, src_stride);
 | 
			
		||||
      break;
 | 
			
		||||
   case PIPE_FORMAT_Z16_UNORM:
 | 
			
		||||
      /*z16_put_tile_rgba((ushort *) packed, w, h, p, src_stride);*/
 | 
			
		||||
      break;
 | 
			
		||||
 
 | 
			
		||||
@@ -123,21 +123,25 @@ static enum pipe_error
 | 
			
		||||
u_upload_alloc_buffer( struct u_upload_mgr *upload,
 | 
			
		||||
                       unsigned min_size )
 | 
			
		||||
{
 | 
			
		||||
   unsigned size;
 | 
			
		||||
 | 
			
		||||
   /* Release old buffer, if present:
 | 
			
		||||
    */
 | 
			
		||||
   u_upload_flush( upload );
 | 
			
		||||
 | 
			
		||||
   /* Allocate a new one: 
 | 
			
		||||
    */
 | 
			
		||||
   upload->size = align(MAX2(upload->default_size, min_size), 4096);
 | 
			
		||||
   size = align(MAX2(upload->default_size, min_size), 4096);
 | 
			
		||||
 | 
			
		||||
   upload->buffer = pipe_buffer_create( upload->screen,
 | 
			
		||||
                                        upload->alignment,
 | 
			
		||||
                                        upload->usage | PIPE_BUFFER_USAGE_CPU_WRITE,
 | 
			
		||||
                                        upload->size );
 | 
			
		||||
                                        size );
 | 
			
		||||
   if (upload->buffer == NULL) 
 | 
			
		||||
      goto fail;
 | 
			
		||||
   
 | 
			
		||||
   upload->size = size;
 | 
			
		||||
 | 
			
		||||
   upload->offset = 0;
 | 
			
		||||
   return 0;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -85,5 +85,7 @@ softpipe_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba,
 | 
			
		||||
      /* non-cached surface */
 | 
			
		||||
      pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, cv);
 | 
			
		||||
#endif
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   softpipe->dirty_render_cache = TRUE;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -84,7 +84,7 @@ softpipe_get_param(struct pipe_screen *screen, int param)
 | 
			
		||||
   case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
 | 
			
		||||
      return 12; /* max 2Kx2K */
 | 
			
		||||
   case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
 | 
			
		||||
      return 8;  /* max 128x128x128 */
 | 
			
		||||
      return 9;  /* max 256x256x256 */
 | 
			
		||||
   case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
 | 
			
		||||
      return 12; /* max 2Kx2K */
 | 
			
		||||
   case PIPE_CAP_TGSI_CONT_SUPPORTED:
 | 
			
		||||
 
 | 
			
		||||
@@ -464,7 +464,7 @@ choose_cube_face(float rx, float ry, float rz, float *newS, float *newT)
 | 
			
		||||
   unsigned face;
 | 
			
		||||
   float sc, tc, ma;
 | 
			
		||||
 | 
			
		||||
   if (arx > ary && arx > arz) {
 | 
			
		||||
   if (arx >= ary && arx >= arz) {
 | 
			
		||||
      if (rx >= 0.0F) {
 | 
			
		||||
         face = PIPE_TEX_FACE_POS_X;
 | 
			
		||||
         sc = -rz;
 | 
			
		||||
@@ -478,7 +478,7 @@ choose_cube_face(float rx, float ry, float rz, float *newS, float *newT)
 | 
			
		||||
         ma = arx;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   else if (ary > arx && ary > arz) {
 | 
			
		||||
   else if (ary >= arx && ary >= arz) {
 | 
			
		||||
      if (ry >= 0.0F) {
 | 
			
		||||
         face = PIPE_TEX_FACE_POS_Y;
 | 
			
		||||
         sc = rx;
 | 
			
		||||
 
 | 
			
		||||
@@ -42,6 +42,7 @@
 | 
			
		||||
#include "sp_texture.h"
 | 
			
		||||
#include "sp_tile_cache.h"
 | 
			
		||||
#include "sp_screen.h"
 | 
			
		||||
#include "sp_winsys.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Simple, maximally packed layout.
 | 
			
		||||
 
 | 
			
		||||
@@ -351,7 +351,7 @@ void trace_dump_call_begin_locked(const char *klass, const char *method)
 | 
			
		||||
   trace_dump_indent(1);
 | 
			
		||||
   trace_dump_writes("<call no=\'");
 | 
			
		||||
   trace_dump_writef("%lu", call_no);
 | 
			
		||||
   trace_dump_writes("\' class =\'");
 | 
			
		||||
   trace_dump_writes("\' class=\'");
 | 
			
		||||
   trace_dump_escape(klass);
 | 
			
		||||
   trace_dump_writes("\' method=\'");
 | 
			
		||||
   trace_dump_escape(method);
 | 
			
		||||
 
 | 
			
		||||
@@ -63,6 +63,13 @@ pipe_buffer_map(struct pipe_screen *screen,
 | 
			
		||||
   if(screen->buffer_map_range) {
 | 
			
		||||
      unsigned offset = 0;
 | 
			
		||||
      unsigned length = buf->size;
 | 
			
		||||
 | 
			
		||||
      /* XXX: Actually we should be using/detecting DISCARD
 | 
			
		||||
       * instead of assuming that WRITE implies discard */
 | 
			
		||||
      if((usage & PIPE_BUFFER_USAGE_CPU_WRITE) &&
 | 
			
		||||
         !(usage & PIPE_BUFFER_USAGE_DISCARD))
 | 
			
		||||
         usage |= PIPE_BUFFER_USAGE_CPU_READ;
 | 
			
		||||
 | 
			
		||||
      return screen->buffer_map_range(screen, buf, offset, length, usage);
 | 
			
		||||
   }
 | 
			
		||||
   else
 | 
			
		||||
 
 | 
			
		||||
@@ -743,7 +743,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
 | 
			
		||||
{
 | 
			
		||||
   static GLboolean firstTime = GL_TRUE;
 | 
			
		||||
   struct pipe_screen *screen;
 | 
			
		||||
   struct pipe_context *pipe;
 | 
			
		||||
   struct pipe_context *pipe = NULL;
 | 
			
		||||
   XMesaContext c;
 | 
			
		||||
   GLcontext *mesaCtx;
 | 
			
		||||
   uint pf;
 | 
			
		||||
 
 | 
			
		||||
@@ -371,7 +371,7 @@ class Main:
 | 
			
		||||
                    stream = GzipFile(arg, 'rt')
 | 
			
		||||
                elif arg.endswith('.bz2'):
 | 
			
		||||
                    from bz2 import BZ2File
 | 
			
		||||
                    stream = BZ2File(arg, 'rt')
 | 
			
		||||
                    stream = BZ2File(arg, 'rU')
 | 
			
		||||
                else:
 | 
			
		||||
                    stream = open(arg, 'rt')
 | 
			
		||||
                self.process_arg(stream, options)
 | 
			
		||||
 
 | 
			
		||||
@@ -364,7 +364,7 @@ void xlib_brw_buffer_subdata_typed( struct pipe_winsys *pws,
 | 
			
		||||
                                    unsigned data_type )
 | 
			
		||||
{
 | 
			
		||||
   unsigned aub_type = DW_GENERAL_STATE;
 | 
			
		||||
   unsigned aub_sub_type;
 | 
			
		||||
   unsigned aub_sub_type = 0;
 | 
			
		||||
 | 
			
		||||
   switch (data_type) {
 | 
			
		||||
   case BRW_CC_VP:
 | 
			
		||||
 
 | 
			
		||||
@@ -303,6 +303,7 @@ xm_flush_frontbuffer(struct pipe_winsys *pws,
 | 
			
		||||
    */
 | 
			
		||||
   XMesaContext xmctx = (XMesaContext) context_private;
 | 
			
		||||
   xlib_softpipe_display_surface(xmctx->xm_buffer, surf);
 | 
			
		||||
   xmesa_check_and_update_buffer_size(xmctx, xmctx->xm_buffer);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -481,6 +481,8 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen,
 | 
			
		||||
    psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
 | 
			
		||||
    psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
 | 
			
		||||
 | 
			
		||||
    psc->driver_configs = driver_configs;
 | 
			
		||||
 | 
			
		||||
    psp->destroyScreen = dri2DestroyScreen;
 | 
			
		||||
    psp->createContext = dri2CreateContext;
 | 
			
		||||
    psp->createDrawable = dri2CreateDrawable;
 | 
			
		||||
 
 | 
			
		||||
@@ -418,6 +418,8 @@ CallCreateNewScreen(Display *dpy, int scrn, __GLXscreenConfigs *psc,
 | 
			
		||||
    psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
 | 
			
		||||
    psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
 | 
			
		||||
 | 
			
		||||
    psc->driver_configs = driver_configs;
 | 
			
		||||
 | 
			
		||||
    /* Visuals with depth != screen depth are subject to automatic compositing
 | 
			
		||||
     * in the X server, so DRI1 can't render to them properly. Mark them as
 | 
			
		||||
     * non-conformant to prevent apps from picking them up accidentally.
 | 
			
		||||
 
 | 
			
		||||
@@ -401,7 +401,7 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen,
 | 
			
		||||
   psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
 | 
			
		||||
   psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
 | 
			
		||||
 | 
			
		||||
   free(driver_configs);
 | 
			
		||||
   psc->driver_configs = driver_configs;
 | 
			
		||||
 | 
			
		||||
   psp->destroyScreen = driDestroyScreen;
 | 
			
		||||
   psp->createContext = driCreateContext;
 | 
			
		||||
 
 | 
			
		||||
@@ -39,6 +39,30 @@
 | 
			
		||||
#include "glxextensions.h"
 | 
			
		||||
#include "glcontextmodes.h"
 | 
			
		||||
 | 
			
		||||
#define WARN_ONCE_GLX_1_3(a, b) {		\
 | 
			
		||||
		static int warned=1;		\
 | 
			
		||||
		if(warned) {			\
 | 
			
		||||
			warn_GLX_1_3((a), b );	\
 | 
			
		||||
			warned=0;		\
 | 
			
		||||
		}				\
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Emit a warning when clients use GLX 1.3 functions on pre-1.3 systems.
 | 
			
		||||
 */
 | 
			
		||||
static void
 | 
			
		||||
warn_GLX_1_3(Display *dpy, const char *function_name)
 | 
			
		||||
{
 | 
			
		||||
   __GLXdisplayPrivate *priv = __glXInitialize(dpy);
 | 
			
		||||
 | 
			
		||||
   if (priv->minorVersion < 3) {
 | 
			
		||||
      fprintf(stderr, 
 | 
			
		||||
	      "WARNING: Application calling GLX 1.3 function \"%s\" "
 | 
			
		||||
	      "when GLX 1.3 is not supported!  This is an application bug!\n",
 | 
			
		||||
	      function_name);
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Change a drawable's attribute.
 | 
			
		||||
@@ -559,6 +583,8 @@ glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int *attrib_list)
 | 
			
		||||
   width = 0;
 | 
			
		||||
   height = 0;
 | 
			
		||||
 | 
			
		||||
   WARN_ONCE_GLX_1_3(dpy, __func__);
 | 
			
		||||
 | 
			
		||||
   for (i = 0; attrib_list[i * 2]; i++) {
 | 
			
		||||
      switch (attrib_list[i * 2]) {
 | 
			
		||||
      case GLX_PBUFFER_WIDTH:
 | 
			
		||||
@@ -592,6 +618,7 @@ PUBLIC void
 | 
			
		||||
glXQueryDrawable(Display * dpy, GLXDrawable drawable,
 | 
			
		||||
                 int attribute, unsigned int *value)
 | 
			
		||||
{
 | 
			
		||||
   WARN_ONCE_GLX_1_3(dpy, __func__);
 | 
			
		||||
   GetDrawableAttribute(dpy, drawable, attribute, value);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -645,6 +672,8 @@ PUBLIC GLXPixmap
 | 
			
		||||
glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap,
 | 
			
		||||
                const int *attrib_list)
 | 
			
		||||
{
 | 
			
		||||
   WARN_ONCE_GLX_1_3(dpy, __func__);
 | 
			
		||||
 | 
			
		||||
   return CreateDrawable(dpy, (__GLcontextModes *) config,
 | 
			
		||||
                         (Drawable) pixmap, attrib_list, X_GLXCreatePixmap);
 | 
			
		||||
}
 | 
			
		||||
@@ -654,6 +683,8 @@ PUBLIC GLXWindow
 | 
			
		||||
glXCreateWindow(Display * dpy, GLXFBConfig config, Window win,
 | 
			
		||||
                const int *attrib_list)
 | 
			
		||||
{
 | 
			
		||||
   WARN_ONCE_GLX_1_3(dpy, __func__);
 | 
			
		||||
 | 
			
		||||
   return CreateDrawable(dpy, (__GLcontextModes *) config,
 | 
			
		||||
                         (Drawable) win, attrib_list, X_GLXCreateWindow);
 | 
			
		||||
}
 | 
			
		||||
@@ -662,6 +693,8 @@ glXCreateWindow(Display * dpy, GLXFBConfig config, Window win,
 | 
			
		||||
PUBLIC void
 | 
			
		||||
glXDestroyPixmap(Display * dpy, GLXPixmap pixmap)
 | 
			
		||||
{
 | 
			
		||||
   WARN_ONCE_GLX_1_3(dpy, __func__);
 | 
			
		||||
 | 
			
		||||
   DestroyDrawable(dpy, (GLXDrawable) pixmap, X_GLXDestroyPixmap);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -669,6 +702,8 @@ glXDestroyPixmap(Display * dpy, GLXPixmap pixmap)
 | 
			
		||||
PUBLIC void
 | 
			
		||||
glXDestroyWindow(Display * dpy, GLXWindow win)
 | 
			
		||||
{
 | 
			
		||||
   WARN_ONCE_GLX_1_3(dpy, __func__);
 | 
			
		||||
 | 
			
		||||
   DestroyDrawable(dpy, (GLXDrawable) win, X_GLXDestroyWindow);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -689,3 +724,4 @@ GLX_ALIAS_VOID(glXGetSelectedEventSGIX,
 | 
			
		||||
               (Display * dpy, GLXDrawable drawable,
 | 
			
		||||
                unsigned long *mask), (dpy, drawable, mask),
 | 
			
		||||
               glXGetSelectedEvent)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -501,6 +501,8 @@ struct __GLXscreenConfigsRec {
 | 
			
		||||
 | 
			
		||||
    __GLXDRIscreen *driScreen;
 | 
			
		||||
 | 
			
		||||
    const __DRIconfig** driver_configs;
 | 
			
		||||
 | 
			
		||||
#ifdef __DRI_COPY_SUB_BUFFER
 | 
			
		||||
    const __DRIcopySubBufferExtension *driCopySubBuffer;
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -845,6 +845,34 @@ PUBLIC GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis,
 | 
			
		||||
    req->glxpixmap = xid = XAllocID(dpy);
 | 
			
		||||
    UnlockDisplay(dpy);
 | 
			
		||||
    SyncHandle();
 | 
			
		||||
 | 
			
		||||
#ifdef GLX_DIRECT_RENDERING
 | 
			
		||||
    do {
 | 
			
		||||
	/* FIXME: Maybe delay __DRIdrawable creation until the drawable
 | 
			
		||||
	 * is actually bound to a context... */
 | 
			
		||||
 | 
			
		||||
	__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
 | 
			
		||||
	__GLXDRIdrawable *pdraw;
 | 
			
		||||
	__GLXscreenConfigs *psc;
 | 
			
		||||
	__GLcontextModes *modes;
 | 
			
		||||
 | 
			
		||||
	psc = &priv->screenConfigs[vis->screen];
 | 
			
		||||
	if (psc->driScreen == NULL)
 | 
			
		||||
	    break;
 | 
			
		||||
	modes = _gl_context_modes_find_visual(psc->visuals, vis->visualid);
 | 
			
		||||
	pdraw = psc->driScreen->createDrawable(psc, pixmap, req->glxpixmap, modes);
 | 
			
		||||
	if (pdraw == NULL) {
 | 
			
		||||
	    fprintf(stderr, "failed to create pixmap\n");
 | 
			
		||||
	    break;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (__glxHashInsert(psc->drawHash, req->glxpixmap, pdraw)) {
 | 
			
		||||
	    (*pdraw->destroyDrawable) (pdraw);
 | 
			
		||||
	    return None;           /* FIXME: Check what we're supposed to do here... */
 | 
			
		||||
	}
 | 
			
		||||
    } while (0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    return xid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -149,6 +149,12 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv)
 | 
			
		||||
      Xfree((char *) psc->serverGLXexts);
 | 
			
		||||
 | 
			
		||||
#ifdef GLX_DIRECT_RENDERING
 | 
			
		||||
      if (psc->driver_configs) {
 | 
			
		||||
         for(unsigned int i = 0; psc->driver_configs[i]; i++)
 | 
			
		||||
            free((__DRIconfig*)psc->driver_configs[i]);
 | 
			
		||||
         free(psc->driver_configs);
 | 
			
		||||
         psc->driver_configs = NULL;
 | 
			
		||||
      }
 | 
			
		||||
      if (psc->driScreen) {
 | 
			
		||||
         psc->driScreen->destroyScreen(psc);
 | 
			
		||||
         __glxHashDestroy(psc->drawHash);
 | 
			
		||||
 
 | 
			
		||||
@@ -77,6 +77,7 @@
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#define HASH_MAGIC 0xdeadbeef
 | 
			
		||||
#define HASH_DEBUG 0
 | 
			
		||||
@@ -87,10 +88,21 @@
 | 
			
		||||
 | 
			
		||||
#define HASH_ALLOC malloc
 | 
			
		||||
#define HASH_FREE  free
 | 
			
		||||
#define HASH_RANDOM_DECL
 | 
			
		||||
#define HASH_RANDOM_INIT(seed)  srandom(seed)
 | 
			
		||||
#define HASH_RANDOM             random()
 | 
			
		||||
#ifndef __GLIBC__
 | 
			
		||||
#define HASH_RANDOM_DECL	char *ps, rs[256]
 | 
			
		||||
#define HASH_RANDOM_INIT(seed)	ps = initstate(seed, rs, sizeof(rs))
 | 
			
		||||
#define HASH_RANDOM		random()
 | 
			
		||||
#define HASH_RANDOM_DESTROY	setstate(ps)
 | 
			
		||||
#else
 | 
			
		||||
#define HASH_RANDOM_DECL	struct random_data rd; int32_t rv; char rs[256]
 | 
			
		||||
#define HASH_RANDOM_INIT(seed)					\
 | 
			
		||||
   do {								\
 | 
			
		||||
      (void) memset(&rd, 0, sizeof(rd));			\
 | 
			
		||||
      (void) initstate_r(seed, rs, sizeof(rs), &rd);		\
 | 
			
		||||
   } while(0)
 | 
			
		||||
#define HASH_RANDOM             ((void) random_r(&rd, &rv), rv)
 | 
			
		||||
#define HASH_RANDOM_DESTROY
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
typedef struct __glxHashBucket
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -763,7 +763,7 @@ dri2CreateNewScreen(int scrn, int fd,
 | 
			
		||||
    if (driDriverAPI.InitScreen2 == NULL)
 | 
			
		||||
        return NULL;
 | 
			
		||||
 | 
			
		||||
    psp = _mesa_malloc(sizeof(*psp));
 | 
			
		||||
    psp = _mesa_calloc(sizeof(*psp));
 | 
			
		||||
    if (!psp)
 | 
			
		||||
	return NULL;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,306 +0,0 @@
 | 
			
		||||
/**************************************************************************
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
 | 
			
		||||
 * All Rights Reserved.
 | 
			
		||||
 * 
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a
 | 
			
		||||
 * copy of this software and associated documentation files (the
 | 
			
		||||
 * "Software"), to deal in the Software without restriction, including
 | 
			
		||||
 * without limitation the rights to use, copy, modify, merge, publish,
 | 
			
		||||
 * distribute, sub license, and/or sell copies of the Software, and to
 | 
			
		||||
 * permit persons to whom the Software is furnished to do so, subject to
 | 
			
		||||
 * the following conditions:
 | 
			
		||||
 * 
 | 
			
		||||
 * The above copyright notice and this permission notice (including the
 | 
			
		||||
 * next paragraph) shall be included in all copies or substantial portions
 | 
			
		||||
 * of the Software.
 | 
			
		||||
 * 
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 | 
			
		||||
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 | 
			
		||||
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
 | 
			
		||||
 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
 | 
			
		||||
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 | 
			
		||||
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 | 
			
		||||
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 | 
			
		||||
 * 
 | 
			
		||||
 **************************************************************************/
 | 
			
		||||
 | 
			
		||||
#include "main/glheader.h"
 | 
			
		||||
#include "main/enums.h"
 | 
			
		||||
#include "main/mtypes.h"
 | 
			
		||||
#include "main/macros.h"
 | 
			
		||||
#include "main/image.h"
 | 
			
		||||
#include "main/bufferobj.h"
 | 
			
		||||
#include "swrast/swrast.h"
 | 
			
		||||
 | 
			
		||||
#include "intel_screen.h"
 | 
			
		||||
#include "intel_context.h"
 | 
			
		||||
#include "intel_batchbuffer.h"
 | 
			
		||||
#include "intel_blit.h"
 | 
			
		||||
#include "intel_buffers.h"
 | 
			
		||||
#include "intel_regions.h"
 | 
			
		||||
#include "intel_pixel.h"
 | 
			
		||||
#include "intel_buffer_objects.h"
 | 
			
		||||
 | 
			
		||||
/* For many applications, the new ability to pull the source buffers
 | 
			
		||||
 * back out of the GTT and then do the packing/conversion operations
 | 
			
		||||
 * in software will be as much of an improvement as trying to get the
 | 
			
		||||
 * blitter and/or texture engine to do the work. 
 | 
			
		||||
 *
 | 
			
		||||
 * This step is gated on private backbuffers.
 | 
			
		||||
 * 
 | 
			
		||||
 * Obviously the frontbuffer can't be pulled back, so that is either
 | 
			
		||||
 * an argument for blit/texture readpixels, or for blitting to a
 | 
			
		||||
 * temporary and then pulling that back.
 | 
			
		||||
 *
 | 
			
		||||
 * When the destination is a pbo, however, it's not clear if it is
 | 
			
		||||
 * ever going to be pulled to main memory (though the access param
 | 
			
		||||
 * will be a good hint).  So it sounds like we do want to be able to
 | 
			
		||||
 * choose between blit/texture implementation on the gpu and pullback
 | 
			
		||||
 * and cpu-based copying.
 | 
			
		||||
 *
 | 
			
		||||
 * Unless you can magically turn client memory into a PBO for the
 | 
			
		||||
 * duration of this call, there will be a cpu-based copying step in
 | 
			
		||||
 * any case.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static GLboolean
 | 
			
		||||
do_texture_readpixels(GLcontext * ctx,
 | 
			
		||||
                      GLint x, GLint y, GLsizei width, GLsizei height,
 | 
			
		||||
                      GLenum format, GLenum type,
 | 
			
		||||
                      const struct gl_pixelstore_attrib *pack,
 | 
			
		||||
                      struct intel_region *dest_region)
 | 
			
		||||
{
 | 
			
		||||
#if 0
 | 
			
		||||
   struct intel_context *intel = intel_context(ctx);
 | 
			
		||||
   intelScreenPrivate *screen = intel->intelScreen;
 | 
			
		||||
   GLint pitch = pack->RowLength ? pack->RowLength : width;
 | 
			
		||||
   __DRIdrawablePrivate *dPriv = intel->driDrawable;
 | 
			
		||||
   int textureFormat;
 | 
			
		||||
   GLenum glTextureFormat;
 | 
			
		||||
   int destFormat, depthFormat, destPitch;
 | 
			
		||||
   drm_clip_rect_t tmp;
 | 
			
		||||
 | 
			
		||||
   if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
      fprintf(stderr, "%s\n", __FUNCTION__);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   if (ctx->_ImageTransferState ||
 | 
			
		||||
       pack->SwapBytes || pack->LsbFirst || !pack->Invert) {
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
         fprintf(stderr, "%s: check_color failed\n", __FUNCTION__);
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   intel->vtbl.meta_texrect_source(intel, intel_readbuf_region(intel));
 | 
			
		||||
 | 
			
		||||
   if (!intel->vtbl.meta_render_dest(intel, dest_region, type, format)) {
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
         fprintf(stderr, "%s: couldn't set dest %s/%s\n",
 | 
			
		||||
                 __FUNCTION__,
 | 
			
		||||
                 _mesa_lookup_enum_by_nr(type),
 | 
			
		||||
                 _mesa_lookup_enum_by_nr(format));
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   LOCK_HARDWARE(intel);
 | 
			
		||||
 | 
			
		||||
   if (intel->driDrawable->numClipRects) {
 | 
			
		||||
      intel->vtbl.install_meta_state(intel);
 | 
			
		||||
      intel->vtbl.meta_no_depth_write(intel);
 | 
			
		||||
      intel->vtbl.meta_no_stencil_write(intel);
 | 
			
		||||
 | 
			
		||||
      if (!driClipRectToFramebuffer(ctx->ReadBuffer, &x, &y, &width, &height)) {
 | 
			
		||||
         UNLOCK_HARDWARE(intel);
 | 
			
		||||
         SET_STATE(i830, state);
 | 
			
		||||
         if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
            fprintf(stderr, "%s: cliprect failed\n", __FUNCTION__);
 | 
			
		||||
         return GL_TRUE;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      y = dPriv->h - y - height;
 | 
			
		||||
      x += dPriv->x;
 | 
			
		||||
      y += dPriv->y;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      /* Set the frontbuffer up as a large rectangular texture.
 | 
			
		||||
       */
 | 
			
		||||
      intel->vtbl.meta_tex_rect_source(intel, src_region, textureFormat);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      intel->vtbl.meta_texture_blend_replace(i830, glTextureFormat);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      /* Set the 3d engine to draw into the destination region:
 | 
			
		||||
       */
 | 
			
		||||
 | 
			
		||||
      intel->vtbl.meta_draw_region(intel, dest_region);
 | 
			
		||||
      intel->vtbl.meta_draw_format(intel, destFormat, depthFormat);     /* ?? */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      /* Draw a single quad, no cliprects:
 | 
			
		||||
       */
 | 
			
		||||
      intel->vtbl.meta_disable_cliprects(intel);
 | 
			
		||||
 | 
			
		||||
      intel->vtbl.draw_quad(intel,
 | 
			
		||||
                            0, width, 0, height,
 | 
			
		||||
                            0x00ff00ff, x, x + width, y, y + height);
 | 
			
		||||
 | 
			
		||||
      intel->vtbl.leave_meta_state(intel);
 | 
			
		||||
   }
 | 
			
		||||
   UNLOCK_HARDWARE(intel);
 | 
			
		||||
 | 
			
		||||
   intel_region_wait_fence(ctx, dest_region);   /* required by GL */
 | 
			
		||||
   return GL_TRUE;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   return GL_FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static GLboolean
 | 
			
		||||
do_blit_readpixels(GLcontext * ctx,
 | 
			
		||||
                   GLint x, GLint y, GLsizei width, GLsizei height,
 | 
			
		||||
                   GLenum format, GLenum type,
 | 
			
		||||
                   const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
 | 
			
		||||
{
 | 
			
		||||
   struct intel_context *intel = intel_context(ctx);
 | 
			
		||||
   struct intel_region *src = intel_readbuf_region(intel);
 | 
			
		||||
   struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj);
 | 
			
		||||
   GLuint dst_offset;
 | 
			
		||||
   GLuint rowLength;
 | 
			
		||||
 | 
			
		||||
   if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
      _mesa_printf("%s\n", __FUNCTION__);
 | 
			
		||||
 | 
			
		||||
   if (!src)
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   if (dst) {
 | 
			
		||||
      /* XXX This validation should be done by core mesa:
 | 
			
		||||
       */
 | 
			
		||||
      if (!_mesa_validate_pbo_access(2, pack, width, height, 1,
 | 
			
		||||
                                     format, type, pixels)) {
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels");
 | 
			
		||||
         return GL_TRUE;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   else {
 | 
			
		||||
      /* PBO only for now:
 | 
			
		||||
       */
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
         _mesa_printf("%s - not PBO\n", __FUNCTION__);
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   if (ctx->_ImageTransferState ||
 | 
			
		||||
       !intel_check_blit_format(src, format, type)) {
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
         _mesa_printf("%s - bad format for blit\n", __FUNCTION__);
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) {
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
         _mesa_printf("%s: bad packing params\n", __FUNCTION__);
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (pack->RowLength > 0)
 | 
			
		||||
      rowLength = pack->RowLength;
 | 
			
		||||
   else
 | 
			
		||||
      rowLength = width;
 | 
			
		||||
 | 
			
		||||
   if (pack->Invert) {
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
         _mesa_printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__);
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
   else {
 | 
			
		||||
      rowLength = -rowLength;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   /* XXX 64-bit cast? */
 | 
			
		||||
   dst_offset = (GLuint) _mesa_image_address(2, pack, pixels, width, height,
 | 
			
		||||
                                             format, type, 0, 0, 0);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   /* Although the blits go on the command buffer, need to do this and
 | 
			
		||||
    * fire with lock held to guarentee cliprects are correct.
 | 
			
		||||
    */
 | 
			
		||||
   intelFlush(&intel->ctx);
 | 
			
		||||
   LOCK_HARDWARE(intel);
 | 
			
		||||
 | 
			
		||||
   if (intel->driDrawable->numClipRects) {
 | 
			
		||||
      GLboolean all = (width * height * src->cpp == dst->Base.Size &&
 | 
			
		||||
                       x == 0 && dst_offset == 0);
 | 
			
		||||
 | 
			
		||||
      dri_bo *dst_buffer = intel_bufferobj_buffer(intel, dst,
 | 
			
		||||
						  all ? INTEL_WRITE_FULL :
 | 
			
		||||
						  INTEL_WRITE_PART);
 | 
			
		||||
      __DRIdrawablePrivate *dPriv = intel->driDrawable;
 | 
			
		||||
      int nbox = dPriv->numClipRects;
 | 
			
		||||
      drm_clip_rect_t *box = dPriv->pClipRects;
 | 
			
		||||
      drm_clip_rect_t rect;
 | 
			
		||||
      drm_clip_rect_t src_rect;
 | 
			
		||||
      int i;
 | 
			
		||||
 | 
			
		||||
      src_rect.x1 = dPriv->x + x;
 | 
			
		||||
      src_rect.y1 = dPriv->y + dPriv->h - (y + height);
 | 
			
		||||
      src_rect.x2 = src_rect.x1 + width;
 | 
			
		||||
      src_rect.y2 = src_rect.y1 + height;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      for (i = 0; i < nbox; i++) {
 | 
			
		||||
         if (!intel_intersect_cliprects(&rect, &src_rect, &box[i]))
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
         intelEmitCopyBlit(intel,
 | 
			
		||||
                           src->cpp,
 | 
			
		||||
                           src->pitch, src->buffer, 0, src->tiling,
 | 
			
		||||
                           rowLength, dst_buffer, dst_offset, GL_FALSE,
 | 
			
		||||
                           rect.x1,
 | 
			
		||||
                           rect.y1,
 | 
			
		||||
                           rect.x1 - src_rect.x1,
 | 
			
		||||
                           rect.y2 - src_rect.y2,
 | 
			
		||||
                           rect.x2 - rect.x1, rect.y2 - rect.y1,
 | 
			
		||||
			   GL_COPY);
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   UNLOCK_HARDWARE(intel);
 | 
			
		||||
 | 
			
		||||
   if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
      _mesa_printf("%s - DONE\n", __FUNCTION__);
 | 
			
		||||
 | 
			
		||||
   return GL_TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
intelReadPixels(GLcontext * ctx,
 | 
			
		||||
                GLint x, GLint y, GLsizei width, GLsizei height,
 | 
			
		||||
                GLenum format, GLenum type,
 | 
			
		||||
                const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
 | 
			
		||||
{
 | 
			
		||||
   if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
      fprintf(stderr, "%s\n", __FUNCTION__);
 | 
			
		||||
 | 
			
		||||
   intelFlush(ctx);
 | 
			
		||||
 | 
			
		||||
   if (do_blit_readpixels
 | 
			
		||||
       (ctx, x, y, width, height, format, type, pack, pixels))
 | 
			
		||||
      return;
 | 
			
		||||
 | 
			
		||||
   if (do_texture_readpixels
 | 
			
		||||
       (ctx, x, y, width, height, format, type, pack, pixels))
 | 
			
		||||
      return;
 | 
			
		||||
 | 
			
		||||
   if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
      _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
 | 
			
		||||
 | 
			
		||||
   _swrast_ReadPixels(ctx, x, y, width, height, format, type, pack, pixels);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1
									
								
								src/mesa/drivers/dri/i915/intel_pixel_read.c
									
									
									
									
									
										Symbolic link
									
								
							
							
						
						
									
										1
									
								
								src/mesa/drivers/dri/i915/intel_pixel_read.c
									
									
									
									
									
										Symbolic link
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
../intel/intel_pixel_read.c
 | 
			
		||||
@@ -22,6 +22,7 @@ DRIVER_SOURCES = \
 | 
			
		||||
	intel_pixel_bitmap.c \
 | 
			
		||||
	intel_pixel_copy.c \
 | 
			
		||||
	intel_pixel_draw.c \
 | 
			
		||||
	intel_pixel_read.c \
 | 
			
		||||
	intel_state.c \
 | 
			
		||||
	intel_swapbuffers.c \
 | 
			
		||||
	intel_tex.c \
 | 
			
		||||
 
 | 
			
		||||
@@ -152,7 +152,8 @@ static void upload_clip_prog(struct brw_context *brw)
 | 
			
		||||
 | 
			
		||||
   /* _NEW_POLYGON */
 | 
			
		||||
   if (key.primitive == GL_TRIANGLES) {
 | 
			
		||||
      if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) 
 | 
			
		||||
      if (ctx->Polygon.CullFlag &&
 | 
			
		||||
	  ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
 | 
			
		||||
	 key.clip_mode = BRW_CLIPMODE_REJECT_ALL;
 | 
			
		||||
      else {
 | 
			
		||||
	 GLuint fill_front = CLIP_CULL;
 | 
			
		||||
 
 | 
			
		||||
@@ -386,6 +386,8 @@ struct brw_cached_batch_item {
 | 
			
		||||
struct brw_vertex_element {
 | 
			
		||||
   const struct gl_client_array *glarray;
 | 
			
		||||
 | 
			
		||||
   /** The corresponding Mesa vertex attribute */
 | 
			
		||||
   gl_vert_attrib attrib;
 | 
			
		||||
   /** Size of a complete element */
 | 
			
		||||
   GLuint element_size;
 | 
			
		||||
   /** Number of uploaded elements for this input. */
 | 
			
		||||
@@ -477,6 +479,9 @@ struct brw_context
 | 
			
		||||
   struct {
 | 
			
		||||
      struct brw_vertex_element inputs[VERT_ATTRIB_MAX];
 | 
			
		||||
 | 
			
		||||
      struct brw_vertex_element *enabled[VERT_ATTRIB_MAX];
 | 
			
		||||
      GLuint nr_enabled;
 | 
			
		||||
 | 
			
		||||
#define BRW_NR_UPLOAD_BUFS 17
 | 
			
		||||
#define BRW_UPLOAD_INIT_SIZE (128*1024)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -185,6 +185,7 @@ static void brw_merge_inputs( struct brw_context *brw,
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < VERT_ATTRIB_MAX; i++) {
 | 
			
		||||
      brw->vb.inputs[i].glarray = arrays[i];
 | 
			
		||||
      brw->vb.inputs[i].attrib = (gl_vert_attrib) i;
 | 
			
		||||
 | 
			
		||||
      if (arrays[i]->StrideB != 0)
 | 
			
		||||
	 brw->vb.info.varying |= 1 << i;
 | 
			
		||||
 
 | 
			
		||||
@@ -343,16 +343,13 @@ static void brw_prepare_vertices(struct brw_context *brw)
 | 
			
		||||
{
 | 
			
		||||
   GLcontext *ctx = &brw->intel.ctx;
 | 
			
		||||
   struct intel_context *intel = intel_context(ctx);
 | 
			
		||||
   GLuint tmp = brw->vs.prog_data->inputs_read; 
 | 
			
		||||
   GLbitfield vs_inputs = brw->vs.prog_data->inputs_read; 
 | 
			
		||||
   GLuint i;
 | 
			
		||||
   const unsigned char *ptr = NULL;
 | 
			
		||||
   GLuint interleave = 0;
 | 
			
		||||
   unsigned int min_index = brw->vb.min_index;
 | 
			
		||||
   unsigned int max_index = brw->vb.max_index;
 | 
			
		||||
 | 
			
		||||
   struct brw_vertex_element *enabled[VERT_ATTRIB_MAX];
 | 
			
		||||
   GLuint nr_enabled = 0;
 | 
			
		||||
 | 
			
		||||
   struct brw_vertex_element *upload[VERT_ATTRIB_MAX];
 | 
			
		||||
   GLuint nr_uploads = 0;
 | 
			
		||||
 | 
			
		||||
@@ -362,12 +359,13 @@ static void brw_prepare_vertices(struct brw_context *brw)
 | 
			
		||||
      _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
 | 
			
		||||
 | 
			
		||||
   /* Accumulate the list of enabled arrays. */
 | 
			
		||||
   while (tmp) {
 | 
			
		||||
      GLuint i = _mesa_ffsll(tmp)-1;
 | 
			
		||||
   brw->vb.nr_enabled = 0;
 | 
			
		||||
   while (vs_inputs) {
 | 
			
		||||
      GLuint i = _mesa_ffsll(vs_inputs) - 1;
 | 
			
		||||
      struct brw_vertex_element *input = &brw->vb.inputs[i];
 | 
			
		||||
 | 
			
		||||
      tmp &= ~(1<<i);
 | 
			
		||||
      enabled[nr_enabled++] = input;
 | 
			
		||||
      vs_inputs &= ~(1 << i);
 | 
			
		||||
      brw->vb.enabled[brw->vb.nr_enabled++] = input;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   /* XXX: In the rare cases where this happens we fallback all
 | 
			
		||||
@@ -376,13 +374,13 @@ static void brw_prepare_vertices(struct brw_context *brw)
 | 
			
		||||
    * cases with > 17 vertex attributes enabled, so it probably
 | 
			
		||||
    * isn't an issue at this point.
 | 
			
		||||
    */
 | 
			
		||||
   if (nr_enabled >= BRW_VEP_MAX) {
 | 
			
		||||
   if (brw->vb.nr_enabled >= BRW_VEP_MAX) {
 | 
			
		||||
      intel->Fallback = 1;
 | 
			
		||||
      return;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < nr_enabled; i++) {
 | 
			
		||||
      struct brw_vertex_element *input = enabled[i];
 | 
			
		||||
   for (i = 0; i < brw->vb.nr_enabled; i++) {
 | 
			
		||||
      struct brw_vertex_element *input = brw->vb.enabled[i];
 | 
			
		||||
 | 
			
		||||
      input->element_size = get_size(input->glarray->Type) * input->glarray->Size;
 | 
			
		||||
      input->count = input->glarray->StrideB ? max_index + 1 - min_index : 1;
 | 
			
		||||
@@ -398,6 +396,20 @@ static void brw_prepare_vertices(struct brw_context *brw)
 | 
			
		||||
	 dri_bo_reference(input->bo);
 | 
			
		||||
	 input->offset = (unsigned long)input->glarray->Ptr;
 | 
			
		||||
	 input->stride = input->glarray->StrideB;
 | 
			
		||||
 | 
			
		||||
	 /* This is a common place to reach if the user mistakenly supplies
 | 
			
		||||
	  * a pointer in place of a VBO offset.  If we just let it go through,
 | 
			
		||||
	  * we may end up dereferencing a pointer beyond the bounds of the
 | 
			
		||||
	  * GTT.  We would hope that the VBO's max_index would save us, but
 | 
			
		||||
	  * Mesa appears to hand us min/max values not clipped to the
 | 
			
		||||
	  * array object's _MaxElement, and _MaxElement frequently appears
 | 
			
		||||
	  * to be wrong anyway.
 | 
			
		||||
	  *
 | 
			
		||||
	  * The VBO spec allows application termination in this case, and it's
 | 
			
		||||
	  * probably a service to the poor programmer to do so rather than
 | 
			
		||||
	  * trying to just not render.
 | 
			
		||||
	  */
 | 
			
		||||
	 assert(input->offset < input->bo->size);
 | 
			
		||||
      } else {
 | 
			
		||||
	 if (input->bo != NULL) {
 | 
			
		||||
	    /* Already-uploaded vertex data is present from a previous
 | 
			
		||||
@@ -410,7 +422,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
 | 
			
		||||
	 /* Queue the buffer object up to be uploaded in the next pass,
 | 
			
		||||
	  * when we've decided if we're doing interleaved or not.
 | 
			
		||||
	  */
 | 
			
		||||
	 if (i == 0) {
 | 
			
		||||
	 if (input->attrib == VERT_ATTRIB_POS) {
 | 
			
		||||
	    /* Position array not properly enabled:
 | 
			
		||||
	     */
 | 
			
		||||
            if (input->glarray->StrideB == 0) {
 | 
			
		||||
@@ -466,8 +478,8 @@ static void brw_prepare_vertices(struct brw_context *brw)
 | 
			
		||||
 | 
			
		||||
   brw_prepare_query_begin(brw);
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < nr_enabled; i++) {
 | 
			
		||||
      struct brw_vertex_element *input = enabled[i];
 | 
			
		||||
   for (i = 0; i < brw->vb.nr_enabled; i++) {
 | 
			
		||||
      struct brw_vertex_element *input = brw->vb.enabled[i];
 | 
			
		||||
 | 
			
		||||
      brw_add_validated_bo(brw, input->bo);
 | 
			
		||||
   }
 | 
			
		||||
@@ -477,34 +489,44 @@ static void brw_emit_vertices(struct brw_context *brw)
 | 
			
		||||
{
 | 
			
		||||
   GLcontext *ctx = &brw->intel.ctx;
 | 
			
		||||
   struct intel_context *intel = intel_context(ctx);
 | 
			
		||||
   GLuint tmp = brw->vs.prog_data->inputs_read;
 | 
			
		||||
   struct brw_vertex_element *enabled[VERT_ATTRIB_MAX];
 | 
			
		||||
   GLuint i;
 | 
			
		||||
   GLuint nr_enabled = 0;
 | 
			
		||||
 | 
			
		||||
  /* Accumulate the list of enabled arrays. */
 | 
			
		||||
   while (tmp) {
 | 
			
		||||
      i = _mesa_ffsll(tmp)-1;
 | 
			
		||||
      struct brw_vertex_element *input = &brw->vb.inputs[i];
 | 
			
		||||
 | 
			
		||||
      tmp &= ~(1<<i);
 | 
			
		||||
      enabled[nr_enabled++] = input;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   brw_emit_query_begin(brw);
 | 
			
		||||
 | 
			
		||||
   /* If the VS doesn't read any inputs (calculating vertex position from
 | 
			
		||||
    * a state variable for some reason, for example), emit a single pad
 | 
			
		||||
    * VERTEX_ELEMENT struct and bail.
 | 
			
		||||
    *
 | 
			
		||||
    * The stale VB state stays in place, but they don't do anything unless
 | 
			
		||||
    * a VE loads from them.
 | 
			
		||||
    */
 | 
			
		||||
   if (brw->vb.nr_enabled == 0) {
 | 
			
		||||
      BEGIN_BATCH(3, IGNORE_CLIPRECTS);
 | 
			
		||||
      OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | 1);
 | 
			
		||||
      OUT_BATCH((0 << BRW_VE0_INDEX_SHIFT) |
 | 
			
		||||
		BRW_VE0_VALID |
 | 
			
		||||
		(BRW_SURFACEFORMAT_R32G32B32A32_FLOAT << BRW_VE0_FORMAT_SHIFT) |
 | 
			
		||||
		(0 << BRW_VE0_SRC_OFFSET_SHIFT));
 | 
			
		||||
      OUT_BATCH((BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_0_SHIFT) |
 | 
			
		||||
		(BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_1_SHIFT) |
 | 
			
		||||
		(BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_2_SHIFT) |
 | 
			
		||||
		(BRW_VE1_COMPONENT_STORE_1_FLT << BRW_VE1_COMPONENT_3_SHIFT));
 | 
			
		||||
      ADVANCE_BATCH();
 | 
			
		||||
      return;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   /* Now emit VB and VEP state packets.
 | 
			
		||||
    *
 | 
			
		||||
    * This still defines a hardware VB for each input, even if they
 | 
			
		||||
    * are interleaved or from the same VBO.  TBD if this makes a
 | 
			
		||||
    * performance difference.
 | 
			
		||||
    */
 | 
			
		||||
   BEGIN_BATCH(1 + nr_enabled * 4, IGNORE_CLIPRECTS);
 | 
			
		||||
   BEGIN_BATCH(1 + brw->vb.nr_enabled * 4, IGNORE_CLIPRECTS);
 | 
			
		||||
   OUT_BATCH((CMD_VERTEX_BUFFER << 16) |
 | 
			
		||||
	     ((1 + nr_enabled * 4) - 2));
 | 
			
		||||
	     ((1 + brw->vb.nr_enabled * 4) - 2));
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < nr_enabled; i++) {
 | 
			
		||||
      struct brw_vertex_element *input = enabled[i];
 | 
			
		||||
   for (i = 0; i < brw->vb.nr_enabled; i++) {
 | 
			
		||||
      struct brw_vertex_element *input = brw->vb.enabled[i];
 | 
			
		||||
 | 
			
		||||
      OUT_BATCH((i << BRW_VB0_INDEX_SHIFT) |
 | 
			
		||||
		BRW_VB0_ACCESS_VERTEXDATA |
 | 
			
		||||
@@ -517,10 +539,10 @@ static void brw_emit_vertices(struct brw_context *brw)
 | 
			
		||||
   }
 | 
			
		||||
   ADVANCE_BATCH();
 | 
			
		||||
 | 
			
		||||
   BEGIN_BATCH(1 + nr_enabled * 2, IGNORE_CLIPRECTS);
 | 
			
		||||
   OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | ((1 + nr_enabled * 2) - 2));
 | 
			
		||||
   for (i = 0; i < nr_enabled; i++) {
 | 
			
		||||
      struct brw_vertex_element *input = enabled[i];
 | 
			
		||||
   BEGIN_BATCH(1 + brw->vb.nr_enabled * 2, IGNORE_CLIPRECTS);
 | 
			
		||||
   OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | ((1 + brw->vb.nr_enabled * 2) - 2));
 | 
			
		||||
   for (i = 0; i < brw->vb.nr_enabled; i++) {
 | 
			
		||||
      struct brw_vertex_element *input = brw->vb.enabled[i];
 | 
			
		||||
      uint32_t format = get_surface_type(input->glarray->Type,
 | 
			
		||||
					 input->glarray->Size,
 | 
			
		||||
					 input->glarray->Format,
 | 
			
		||||
@@ -635,7 +657,7 @@ static void brw_emit_indices(struct brw_context *brw)
 | 
			
		||||
   if (index_buffer == NULL)
 | 
			
		||||
      return;
 | 
			
		||||
 | 
			
		||||
   ib_size = get_size(index_buffer->type) * index_buffer->count;
 | 
			
		||||
   ib_size = get_size(index_buffer->type) * index_buffer->count - 1;
 | 
			
		||||
 | 
			
		||||
   /* Emit the indexbuffer packet:
 | 
			
		||||
    */
 | 
			
		||||
 
 | 
			
		||||
@@ -62,7 +62,7 @@ void brw_set_predicate_control( struct brw_compile *p, GLuint pc )
 | 
			
		||||
 | 
			
		||||
void brw_set_conditionalmod( struct brw_compile *p, GLuint conditional )
 | 
			
		||||
{
 | 
			
		||||
   p->current->header.destreg__conditonalmod = conditional;
 | 
			
		||||
   p->current->header.destreg__conditionalmod = conditional;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void brw_set_access_mode( struct brw_compile *p, GLuint access_mode )
 | 
			
		||||
 
 | 
			
		||||
@@ -377,8 +377,8 @@ static struct brw_instruction *next_insn( struct brw_compile *p,
 | 
			
		||||
   /* Reset this one-shot flag: 
 | 
			
		||||
    */
 | 
			
		||||
 | 
			
		||||
   if (p->current->header.destreg__conditonalmod) {
 | 
			
		||||
      p->current->header.destreg__conditonalmod = 0;   
 | 
			
		||||
   if (p->current->header.destreg__conditionalmod) {
 | 
			
		||||
      p->current->header.destreg__conditionalmod = 0;
 | 
			
		||||
      p->current->header.predicate_control = BRW_PREDICATE_NORMAL;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
@@ -746,7 +746,7 @@ void brw_CMP(struct brw_compile *p,
 | 
			
		||||
{
 | 
			
		||||
   struct brw_instruction *insn = next_insn(p, BRW_OPCODE_CMP);
 | 
			
		||||
 | 
			
		||||
   insn->header.destreg__conditonalmod = conditional;
 | 
			
		||||
   insn->header.destreg__conditionalmod = conditional;
 | 
			
		||||
   brw_set_dest(insn, dest);
 | 
			
		||||
   brw_set_src0(insn, src0);
 | 
			
		||||
   brw_set_src1(insn, src1);
 | 
			
		||||
@@ -790,7 +790,7 @@ void brw_math( struct brw_compile *p,
 | 
			
		||||
    * instructions.
 | 
			
		||||
    */
 | 
			
		||||
   insn->header.predicate_control = 0; 
 | 
			
		||||
   insn->header.destreg__conditonalmod = msg_reg_nr;
 | 
			
		||||
   insn->header.destreg__conditionalmod = msg_reg_nr;
 | 
			
		||||
 | 
			
		||||
   brw_set_dest(insn, dest);
 | 
			
		||||
   brw_set_src0(insn, src);
 | 
			
		||||
@@ -826,7 +826,7 @@ void brw_math_16( struct brw_compile *p,
 | 
			
		||||
   brw_set_compression_control(p, BRW_COMPRESSION_NONE);
 | 
			
		||||
 | 
			
		||||
   insn = next_insn(p, BRW_OPCODE_SEND);
 | 
			
		||||
   insn->header.destreg__conditonalmod = msg_reg_nr;
 | 
			
		||||
   insn->header.destreg__conditionalmod = msg_reg_nr;
 | 
			
		||||
 | 
			
		||||
   brw_set_dest(insn, dest);
 | 
			
		||||
   brw_set_src0(insn, src);
 | 
			
		||||
@@ -842,7 +842,7 @@ void brw_math_16( struct brw_compile *p,
 | 
			
		||||
    */
 | 
			
		||||
   insn = next_insn(p, BRW_OPCODE_SEND);
 | 
			
		||||
   insn->header.compression_control = BRW_COMPRESSION_2NDHALF;
 | 
			
		||||
   insn->header.destreg__conditonalmod = msg_reg_nr+1;
 | 
			
		||||
   insn->header.destreg__conditionalmod = msg_reg_nr+1;
 | 
			
		||||
 | 
			
		||||
   brw_set_dest(insn, offset(dest,1));
 | 
			
		||||
   brw_set_src0(insn, src);
 | 
			
		||||
@@ -888,7 +888,7 @@ void brw_dp_WRITE_16( struct brw_compile *p,
 | 
			
		||||
   
 | 
			
		||||
      insn->header.predicate_control = 0; /* XXX */
 | 
			
		||||
      insn->header.compression_control = BRW_COMPRESSION_NONE; 
 | 
			
		||||
      insn->header.destreg__conditonalmod = msg_reg_nr;
 | 
			
		||||
      insn->header.destreg__conditionalmod = msg_reg_nr;
 | 
			
		||||
  
 | 
			
		||||
      brw_set_dest(insn, dest);
 | 
			
		||||
      brw_set_src0(insn, src);
 | 
			
		||||
@@ -933,7 +933,7 @@ void brw_dp_READ_16( struct brw_compile *p,
 | 
			
		||||
   
 | 
			
		||||
      insn->header.predicate_control = 0; /* XXX */
 | 
			
		||||
      insn->header.compression_control = BRW_COMPRESSION_NONE; 
 | 
			
		||||
      insn->header.destreg__conditonalmod = msg_reg_nr;
 | 
			
		||||
      insn->header.destreg__conditionalmod = msg_reg_nr;
 | 
			
		||||
  
 | 
			
		||||
      brw_set_dest(insn, dest);	/* UW? */
 | 
			
		||||
      brw_set_src0(insn, retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW));
 | 
			
		||||
@@ -986,7 +986,7 @@ void brw_dp_READ_4( struct brw_compile *p,
 | 
			
		||||
   
 | 
			
		||||
      insn->header.predicate_control = BRW_PREDICATE_NONE;
 | 
			
		||||
      insn->header.compression_control = BRW_COMPRESSION_NONE; 
 | 
			
		||||
      insn->header.destreg__conditonalmod = msg_reg_nr;
 | 
			
		||||
      insn->header.destreg__conditionalmod = msg_reg_nr;
 | 
			
		||||
      insn->header.mask_control = BRW_MASK_DISABLE;
 | 
			
		||||
  
 | 
			
		||||
      /* cast dest to a uword[8] vector */
 | 
			
		||||
@@ -1059,7 +1059,7 @@ void brw_dp_READ_4_vs(struct brw_compile *p,
 | 
			
		||||
   
 | 
			
		||||
      insn->header.predicate_control = BRW_PREDICATE_NONE;
 | 
			
		||||
      insn->header.compression_control = BRW_COMPRESSION_NONE; 
 | 
			
		||||
      insn->header.destreg__conditonalmod = msg_reg_nr;
 | 
			
		||||
      insn->header.destreg__conditionalmod = msg_reg_nr;
 | 
			
		||||
      insn->header.mask_control = BRW_MASK_DISABLE;
 | 
			
		||||
      /*insn->header.access_mode = BRW_ALIGN_16;*/
 | 
			
		||||
  
 | 
			
		||||
@@ -1092,7 +1092,7 @@ void brw_fb_WRITE(struct brw_compile *p,
 | 
			
		||||
   
 | 
			
		||||
   insn->header.predicate_control = 0; /* XXX */
 | 
			
		||||
   insn->header.compression_control = BRW_COMPRESSION_NONE; 
 | 
			
		||||
   insn->header.destreg__conditonalmod = msg_reg_nr;
 | 
			
		||||
   insn->header.destreg__conditionalmod = msg_reg_nr;
 | 
			
		||||
  
 | 
			
		||||
   brw_set_dest(insn, dest);
 | 
			
		||||
   brw_set_src0(insn, src0);
 | 
			
		||||
@@ -1187,7 +1187,7 @@ void brw_SAMPLE(struct brw_compile *p,
 | 
			
		||||
   
 | 
			
		||||
      insn->header.predicate_control = 0; /* XXX */
 | 
			
		||||
      insn->header.compression_control = BRW_COMPRESSION_NONE;
 | 
			
		||||
      insn->header.destreg__conditonalmod = msg_reg_nr;
 | 
			
		||||
      insn->header.destreg__conditionalmod = msg_reg_nr;
 | 
			
		||||
 | 
			
		||||
      brw_set_dest(insn, dest);
 | 
			
		||||
      brw_set_src0(insn, src0);
 | 
			
		||||
@@ -1238,7 +1238,7 @@ void brw_urb_WRITE(struct brw_compile *p,
 | 
			
		||||
   brw_set_src0(insn, src0);
 | 
			
		||||
   brw_set_src1(insn, brw_imm_d(0));
 | 
			
		||||
 | 
			
		||||
   insn->header.destreg__conditonalmod = msg_reg_nr;
 | 
			
		||||
   insn->header.destreg__conditionalmod = msg_reg_nr;
 | 
			
		||||
 | 
			
		||||
   brw_set_urb_message(insn,
 | 
			
		||||
		       allocate,
 | 
			
		||||
 
 | 
			
		||||
@@ -233,7 +233,7 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key,
 | 
			
		||||
   else if (sf.sf6.line_width <= 0x2)
 | 
			
		||||
       sf.sf6.line_width = 0;
 | 
			
		||||
 | 
			
		||||
   /* _NEW_POINT */
 | 
			
		||||
   /* _NEW_BUFFERS */
 | 
			
		||||
   key->render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0;
 | 
			
		||||
   if (!key->render_to_fbo) {
 | 
			
		||||
      /* Rendering to an OpenGL window */
 | 
			
		||||
@@ -263,6 +263,7 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key,
 | 
			
		||||
   }
 | 
			
		||||
   /* XXX clamp max depends on AA vs. non-AA */
 | 
			
		||||
 | 
			
		||||
   /* _NEW_POINT */
 | 
			
		||||
   sf.sf7.sprite_point = key->point_sprite;
 | 
			
		||||
   sf.sf7.point_size = CLAMP(rint(key->point_size), 1, 255) * (1<<3);
 | 
			
		||||
   sf.sf7.use_point_size_state = !key->point_attenuated;
 | 
			
		||||
@@ -328,7 +329,8 @@ const struct brw_tracked_state brw_sf_unit = {
 | 
			
		||||
      .mesa  = (_NEW_POLYGON | 
 | 
			
		||||
		_NEW_LINE | 
 | 
			
		||||
		_NEW_POINT | 
 | 
			
		||||
		_NEW_SCISSOR),
 | 
			
		||||
		_NEW_SCISSOR |
 | 
			
		||||
		_NEW_BUFFERS),
 | 
			
		||||
      .brw   = BRW_NEW_URB_FENCE,
 | 
			
		||||
      .cache = (CACHE_NEW_SF_VP |
 | 
			
		||||
		CACHE_NEW_SF_PROG)
 | 
			
		||||
 
 | 
			
		||||
@@ -1168,7 +1168,7 @@ struct brw_instruction
 | 
			
		||||
      GLuint predicate_control:4;
 | 
			
		||||
      GLuint predicate_inverse:1;
 | 
			
		||||
      GLuint execution_size:3;
 | 
			
		||||
      GLuint destreg__conditonalmod:4; /* destreg - send, conditionalmod - others */
 | 
			
		||||
      GLuint destreg__conditionalmod:4; /* destreg - send, conditionalmod - others */
 | 
			
		||||
      GLuint pad0:2;
 | 
			
		||||
      GLuint debug_control:1;
 | 
			
		||||
      GLuint saturate:1;
 | 
			
		||||
 
 | 
			
		||||
@@ -119,6 +119,16 @@ GLboolean brw_miptree_layout( struct intel_context *intel, struct intel_mipmap_t
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
      /* The 965's sampler lays cachelines out according to how accesses
 | 
			
		||||
       * in the texture surfaces run, so they may be "vertical" through
 | 
			
		||||
       * memory.  As a result, the docs say in Surface Padding Requirements:
 | 
			
		||||
       * Sampling Engine Surfaces that two extra rows of padding are required.
 | 
			
		||||
       * We don't know of similar requirements for pre-965, but given that
 | 
			
		||||
       * those docs are silent on padding requirements in general, let's play
 | 
			
		||||
       * it safe.
 | 
			
		||||
       */
 | 
			
		||||
      if (mt->target == GL_TEXTURE_CUBE_MAP)
 | 
			
		||||
	 mt->total_height += 2;
 | 
			
		||||
      break;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -68,6 +68,7 @@ static void release_tmps( struct brw_vs_compile *c )
 | 
			
		||||
static void brw_vs_alloc_regs( struct brw_vs_compile *c )
 | 
			
		||||
{
 | 
			
		||||
   GLuint i, reg = 0, mrf;
 | 
			
		||||
   int attributes_in_vue;
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
   if (c->vp->program.Base.Parameters->NumParameters >= 6)
 | 
			
		||||
@@ -123,6 +124,11 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c )
 | 
			
		||||
	 reg++;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   /* If there are no inputs, we'll still be reading one attribute's worth
 | 
			
		||||
    * because it's required -- see urb_read_length setting.
 | 
			
		||||
    */
 | 
			
		||||
   if (c->nr_inputs == 0)
 | 
			
		||||
      reg++;
 | 
			
		||||
 | 
			
		||||
   /* Allocate outputs: TODO: could organize the non-position outputs
 | 
			
		||||
    * to go straight into message regs.
 | 
			
		||||
@@ -200,8 +206,20 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c )
 | 
			
		||||
    * vertex urb, so is half the amount:
 | 
			
		||||
    */
 | 
			
		||||
   c->prog_data.urb_read_length = (c->nr_inputs + 1) / 2;
 | 
			
		||||
   /* Setting this field to 0 leads to undefined behavior according to the
 | 
			
		||||
    * the VS_STATE docs.  Our VUEs will always have at least one attribute
 | 
			
		||||
    * sitting in them, even if it's padding.
 | 
			
		||||
    */
 | 
			
		||||
   if (c->prog_data.urb_read_length == 0)
 | 
			
		||||
      c->prog_data.urb_read_length = 1;
 | 
			
		||||
 | 
			
		||||
   /* The VS VUEs are shared by VF (outputting our inputs) and VS, so size
 | 
			
		||||
    * them to fit the biggest thing they need to.
 | 
			
		||||
    */
 | 
			
		||||
   attributes_in_vue = MAX2(c->nr_outputs, c->nr_inputs);
 | 
			
		||||
 | 
			
		||||
   c->prog_data.urb_entry_size = (attributes_in_vue + 2 + 3) / 4;
 | 
			
		||||
 | 
			
		||||
   c->prog_data.urb_entry_size = (c->nr_outputs + 2 + 3) / 4;
 | 
			
		||||
   c->prog_data.total_grf = reg;
 | 
			
		||||
 | 
			
		||||
   if (INTEL_DEBUG & DEBUG_VS) {
 | 
			
		||||
@@ -1172,20 +1190,36 @@ post_vs_emit( struct brw_vs_compile *c,
 | 
			
		||||
   brw_set_src1(end_inst, brw_imm_d(offset * 16));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint32_t
 | 
			
		||||
get_predicate(uint32_t swizzle)
 | 
			
		||||
{
 | 
			
		||||
   switch (swizzle) {
 | 
			
		||||
   case SWIZZLE_XXXX:
 | 
			
		||||
      return BRW_PREDICATE_ALIGN16_REPLICATE_X;
 | 
			
		||||
   case SWIZZLE_YYYY:
 | 
			
		||||
      return BRW_PREDICATE_ALIGN16_REPLICATE_Y;
 | 
			
		||||
   case SWIZZLE_ZZZZ:
 | 
			
		||||
      return BRW_PREDICATE_ALIGN16_REPLICATE_Z;
 | 
			
		||||
   case SWIZZLE_WWWW:
 | 
			
		||||
      return BRW_PREDICATE_ALIGN16_REPLICATE_W;
 | 
			
		||||
   default:
 | 
			
		||||
      _mesa_problem(NULL, "Unexpected predicate: 0x%08x\n", swizzle);
 | 
			
		||||
      return BRW_PREDICATE_NORMAL;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Emit the vertex program instructions here.
 | 
			
		||||
 */
 | 
			
		||||
void brw_vs_emit(struct brw_vs_compile *c )
 | 
			
		||||
{
 | 
			
		||||
#define MAX_IFSN 32
 | 
			
		||||
#define MAX_IF_DEPTH 32
 | 
			
		||||
   struct brw_compile *p = &c->func;
 | 
			
		||||
   GLuint nr_insns = c->vp->program.Base.NumInstructions;
 | 
			
		||||
   GLuint insn, if_insn = 0;
 | 
			
		||||
   const GLuint nr_insns = c->vp->program.Base.NumInstructions;
 | 
			
		||||
   GLuint insn, if_depth = 0;
 | 
			
		||||
   GLuint end_offset = 0;
 | 
			
		||||
   struct brw_instruction *end_inst, *last_inst;
 | 
			
		||||
   struct brw_instruction *if_inst[MAX_IFSN];
 | 
			
		||||
   struct brw_indirect stack_index = brw_indirect(0, 0);   
 | 
			
		||||
 | 
			
		||||
   struct brw_instruction *if_inst[MAX_IF_DEPTH];
 | 
			
		||||
   const struct brw_indirect stack_index = brw_indirect(0, 0);   
 | 
			
		||||
   GLuint index;
 | 
			
		||||
   GLuint file;
 | 
			
		||||
 | 
			
		||||
@@ -1376,15 +1410,18 @@ void brw_vs_emit(struct brw_vs_compile *c )
 | 
			
		||||
	 emit_xpd(p, dst, args[0], args[1]);
 | 
			
		||||
	 break;
 | 
			
		||||
      case OPCODE_IF:
 | 
			
		||||
	 assert(if_insn < MAX_IFSN);
 | 
			
		||||
         if_inst[if_insn++] = brw_IF(p, BRW_EXECUTE_8);
 | 
			
		||||
	 assert(if_depth < MAX_IF_DEPTH);
 | 
			
		||||
	 if_inst[if_depth] = brw_IF(p, BRW_EXECUTE_8);
 | 
			
		||||
	 if_inst[if_depth]->header.predicate_control =
 | 
			
		||||
	    get_predicate(inst->DstReg.CondSwizzle);
 | 
			
		||||
	 if_depth++;
 | 
			
		||||
	 break;
 | 
			
		||||
      case OPCODE_ELSE:
 | 
			
		||||
	 if_inst[if_insn-1] = brw_ELSE(p, if_inst[if_insn-1]);
 | 
			
		||||
	 if_inst[if_depth-1] = brw_ELSE(p, if_inst[if_depth-1]);
 | 
			
		||||
	 break;
 | 
			
		||||
      case OPCODE_ENDIF:
 | 
			
		||||
         assert(if_insn > 0);
 | 
			
		||||
	 brw_ENDIF(p, if_inst[--if_insn]);
 | 
			
		||||
         assert(if_depth > 0);
 | 
			
		||||
	 brw_ENDIF(p, if_inst[--if_depth]);
 | 
			
		||||
	 break;			
 | 
			
		||||
      case OPCODE_BRA:
 | 
			
		||||
         brw_set_predicate_control(p, BRW_PREDICATE_NORMAL);
 | 
			
		||||
@@ -1430,6 +1467,19 @@ void brw_vs_emit(struct brw_vs_compile *c )
 | 
			
		||||
				    "unknown");
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      /* Set the predication update on the last instruction of the native
 | 
			
		||||
       * instruction sequence.
 | 
			
		||||
       *
 | 
			
		||||
       * This would be problematic if it was set on a math instruction,
 | 
			
		||||
       * but that shouldn't be the case with the current GLSL compiler.
 | 
			
		||||
       */
 | 
			
		||||
      if (inst->CondUpdate) {
 | 
			
		||||
	 struct brw_instruction *hw_insn = &p->store[p->nr_insn - 1];
 | 
			
		||||
 | 
			
		||||
	 assert(hw_insn->header.destreg__conditionalmod == 0);
 | 
			
		||||
	 hw_insn->header.destreg__conditionalmod = BRW_CONDITIONAL_NZ;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if ((inst->DstReg.File == PROGRAM_OUTPUT)
 | 
			
		||||
          && (inst->DstReg.Index != VERT_RESULT_HPOS)
 | 
			
		||||
          && c->output_regs[inst->DstReg.Index].used_in_src) {
 | 
			
		||||
 
 | 
			
		||||
@@ -202,6 +202,7 @@ static void brw_wm_populate_key( struct brw_context *brw,
 | 
			
		||||
   /* BRW_NEW_FRAGMENT_PROGRAM */
 | 
			
		||||
   const struct brw_fragment_program *fp = 
 | 
			
		||||
      (struct brw_fragment_program *)brw->fragment_program;
 | 
			
		||||
   GLboolean uses_depth = (fp->program.Base.InputsRead & (1 << FRAG_ATTRIB_WPOS)) != 0;
 | 
			
		||||
   GLuint lookup = 0;
 | 
			
		||||
   GLuint line_aa;
 | 
			
		||||
   GLuint i;
 | 
			
		||||
@@ -263,6 +264,7 @@ static void brw_wm_populate_key( struct brw_context *brw,
 | 
			
		||||
	 
 | 
			
		||||
   brw_wm_lookup_iz(line_aa,
 | 
			
		||||
		    lookup,
 | 
			
		||||
		    uses_depth,
 | 
			
		||||
		    key);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -286,6 +286,7 @@ void brw_wm_print_program( struct brw_wm_compile *c,
 | 
			
		||||
 | 
			
		||||
void brw_wm_lookup_iz( GLuint line_aa,
 | 
			
		||||
		       GLuint lookup,
 | 
			
		||||
		       GLboolean ps_uses_depth,
 | 
			
		||||
		       struct brw_wm_prog_key *key );
 | 
			
		||||
 | 
			
		||||
GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp);
 | 
			
		||||
 
 | 
			
		||||
@@ -705,7 +705,11 @@ static void precalc_tex( struct brw_wm_compile *c,
 | 
			
		||||
	      tmpcoord,
 | 
			
		||||
	      0,
 | 
			
		||||
	      inst->SrcReg[0],
 | 
			
		||||
	      scale,
 | 
			
		||||
	      src_swizzle(scale,
 | 
			
		||||
			  SWIZZLE_X,
 | 
			
		||||
			  SWIZZLE_Y,
 | 
			
		||||
			  SWIZZLE_ONE,
 | 
			
		||||
			  SWIZZLE_ONE),
 | 
			
		||||
	      src_undef());
 | 
			
		||||
 | 
			
		||||
      coord = src_reg_from_dst(tmpcoord);
 | 
			
		||||
 
 | 
			
		||||
@@ -118,6 +118,7 @@ const struct {
 | 
			
		||||
 | 
			
		||||
void brw_wm_lookup_iz( GLuint line_aa,
 | 
			
		||||
		       GLuint lookup,
 | 
			
		||||
		       GLboolean ps_uses_depth,
 | 
			
		||||
		       struct brw_wm_prog_key *key )
 | 
			
		||||
{
 | 
			
		||||
   GLuint reg = 2;
 | 
			
		||||
@@ -127,7 +128,7 @@ void brw_wm_lookup_iz( GLuint line_aa,
 | 
			
		||||
   if (lookup & IZ_PS_COMPUTES_DEPTH_BIT)
 | 
			
		||||
      key->computes_depth = 1;
 | 
			
		||||
 | 
			
		||||
   if (wm_iz_table[lookup].sd_present) {
 | 
			
		||||
   if (wm_iz_table[lookup].sd_present || ps_uses_depth) {
 | 
			
		||||
      key->source_depth_reg = reg;
 | 
			
		||||
      reg += 2;
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								src/mesa/drivers/dri/i965/intel_pixel_read.c
									
									
									
									
									
										Symbolic link
									
								
							
							
						
						
									
										1
									
								
								src/mesa/drivers/dri/i965/intel_pixel_read.c
									
									
									
									
									
										Symbolic link
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
../intel/intel_pixel_read.c
 | 
			
		||||
@@ -197,6 +197,11 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file,
 | 
			
		||||
   GLuint used = batch->ptr - batch->map;
 | 
			
		||||
   GLboolean was_locked = intel->locked;
 | 
			
		||||
 | 
			
		||||
   if (intel->first_post_swapbuffers_batch == NULL) {
 | 
			
		||||
      intel->first_post_swapbuffers_batch = intel->batch->buf;
 | 
			
		||||
      drm_intel_bo_reference(intel->first_post_swapbuffers_batch);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (used == 0) {
 | 
			
		||||
      batch->cliprect_mode = IGNORE_CLIPRECTS;
 | 
			
		||||
      return;
 | 
			
		||||
 
 | 
			
		||||
@@ -209,7 +209,10 @@ intel_bufferobj_get_subdata(GLcontext * ctx,
 | 
			
		||||
   struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
 | 
			
		||||
 | 
			
		||||
   assert(intel_obj);
 | 
			
		||||
   dri_bo_get_subdata(intel_obj->buffer, offset, size, data);
 | 
			
		||||
   if (intel_obj->sys_buffer)
 | 
			
		||||
      memcpy(data, (char *)intel_obj->sys_buffer + offset, size);
 | 
			
		||||
   else
 | 
			
		||||
      dri_bo_get_subdata(intel_obj->buffer, offset, size, data);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -345,6 +345,23 @@ intelDrawBuffer(GLcontext * ctx, GLenum mode)
 | 
			
		||||
static void
 | 
			
		||||
intelReadBuffer(GLcontext * ctx, GLenum mode)
 | 
			
		||||
{
 | 
			
		||||
   if ((ctx->DrawBuffer != NULL) && (ctx->DrawBuffer->Name == 0)) {
 | 
			
		||||
      struct intel_context *const intel = intel_context(ctx);
 | 
			
		||||
      const GLboolean was_front_buffer_reading =
 | 
			
		||||
	intel->is_front_buffer_reading;
 | 
			
		||||
 | 
			
		||||
      intel->is_front_buffer_reading = (mode == GL_FRONT_LEFT)
 | 
			
		||||
	|| (mode == GL_FRONT);
 | 
			
		||||
 | 
			
		||||
      /* If we weren't front-buffer reading before but we are now, make sure
 | 
			
		||||
       * that the front-buffer has actually been allocated.
 | 
			
		||||
       */
 | 
			
		||||
      if (!was_front_buffer_reading && intel->is_front_buffer_reading) {
 | 
			
		||||
	 intel_update_renderbuffers(intel->driContext,
 | 
			
		||||
				    intel->driContext->driDrawablePriv);
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (ctx->ReadBuffer == ctx->DrawBuffer) {
 | 
			
		||||
      /* This will update FBO completeness status.
 | 
			
		||||
       * A framebuffer will be incomplete if the GL_READ_BUFFER setting
 | 
			
		||||
 
 | 
			
		||||
@@ -66,6 +66,7 @@
 | 
			
		||||
#define PCI_CHIP_Q45_G                  0x2E12
 | 
			
		||||
#define PCI_CHIP_G45_G                  0x2E22
 | 
			
		||||
#define PCI_CHIP_G41_G                  0x2E32
 | 
			
		||||
#define PCI_CHIP_B43_G                  0x2E42
 | 
			
		||||
 | 
			
		||||
#define IS_MOBILE(devid)	(devid == PCI_CHIP_I855_GM || \
 | 
			
		||||
				 devid == PCI_CHIP_I915_GM || \
 | 
			
		||||
@@ -78,7 +79,8 @@
 | 
			
		||||
#define IS_G45(devid)           (devid == PCI_CHIP_IGD_E_G || \
 | 
			
		||||
                                 devid == PCI_CHIP_Q45_G || \
 | 
			
		||||
                                 devid == PCI_CHIP_G45_G || \
 | 
			
		||||
                                 devid == PCI_CHIP_G41_G)
 | 
			
		||||
                                 devid == PCI_CHIP_G41_G || \
 | 
			
		||||
                                 devid == PCI_CHIP_B43_G)
 | 
			
		||||
#define IS_GM45(devid)          (devid == PCI_CHIP_GM45_GM)
 | 
			
		||||
#define IS_G4X(devid)		(IS_G45(devid) || IS_GM45(devid))
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -161,6 +161,9 @@ intelGetString(GLcontext * ctx, GLenum name)
 | 
			
		||||
      case PCI_CHIP_G41_G:
 | 
			
		||||
         chipset = "Intel(R) G41";
 | 
			
		||||
         break;
 | 
			
		||||
      case PCI_CHIP_B43_G:
 | 
			
		||||
         chipset = "Intel(R) B43";
 | 
			
		||||
         break;
 | 
			
		||||
      default:
 | 
			
		||||
         chipset = "Unknown Intel Chipset";
 | 
			
		||||
         break;
 | 
			
		||||
@@ -220,7 +223,9 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
 | 
			
		||||
      struct intel_renderbuffer *stencil_rb;
 | 
			
		||||
 | 
			
		||||
      i = 0;
 | 
			
		||||
      if ((intel->is_front_buffer_rendering || !intel_fb->color_rb[1])
 | 
			
		||||
      if ((intel->is_front_buffer_rendering ||
 | 
			
		||||
	   intel->is_front_buffer_reading ||
 | 
			
		||||
	   !intel_fb->color_rb[1])
 | 
			
		||||
	   && intel_fb->color_rb[0]) {
 | 
			
		||||
	 attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
 | 
			
		||||
	 attachments[i++] = intel_bits_per_pixel(intel_fb->color_rb[0]);
 | 
			
		||||
@@ -495,7 +500,8 @@ intel_flush(GLcontext *ctx, GLboolean needs_mi_flush)
 | 
			
		||||
 | 
			
		||||
      if (screen->dri2.loader &&
 | 
			
		||||
          (screen->dri2.loader->base.version >= 2)
 | 
			
		||||
	  && (screen->dri2.loader->flushFrontBuffer != NULL)) {
 | 
			
		||||
	  && (screen->dri2.loader->flushFrontBuffer != NULL) &&
 | 
			
		||||
          intel->driDrawable && intel->driDrawable->loaderPrivate) {
 | 
			
		||||
	 (*screen->dri2.loader->flushFrontBuffer)(intel->driDrawable,
 | 
			
		||||
						  intel->driDrawable->loaderPrivate);
 | 
			
		||||
 | 
			
		||||
@@ -505,7 +511,7 @@ intel_flush(GLcontext *ctx, GLboolean needs_mi_flush)
 | 
			
		||||
	  * each of N places that do rendering.  This has worse performances,
 | 
			
		||||
	  * but it is much easier to get correct.
 | 
			
		||||
	  */
 | 
			
		||||
	 if (intel->is_front_buffer_rendering) {
 | 
			
		||||
	 if (!intel->is_front_buffer_rendering) {
 | 
			
		||||
	    intel->front_buffer_dirty = GL_FALSE;
 | 
			
		||||
	 }
 | 
			
		||||
      }
 | 
			
		||||
@@ -521,7 +527,27 @@ intelFlush(GLcontext * ctx)
 | 
			
		||||
static void
 | 
			
		||||
intel_glFlush(GLcontext *ctx)
 | 
			
		||||
{
 | 
			
		||||
   struct intel_context *intel = intel_context(ctx);
 | 
			
		||||
 | 
			
		||||
   intel_flush(ctx, GL_TRUE);
 | 
			
		||||
 | 
			
		||||
   /* We're using glFlush as an indicator that a frame is done, which is
 | 
			
		||||
    * what DRI2 does before calling SwapBuffers (and means we should catch
 | 
			
		||||
    * people doing front-buffer rendering, as well)..
 | 
			
		||||
    *
 | 
			
		||||
    * Wait for the swapbuffers before the one we just emitted, so we don't
 | 
			
		||||
    * get too many swaps outstanding for apps that are GPU-heavy but not
 | 
			
		||||
    * CPU-heavy.
 | 
			
		||||
    *
 | 
			
		||||
    * Unfortunately, we don't have a handle to the batch containing the swap,
 | 
			
		||||
    * and getting our hands on that doesn't seem worth it, so we just us the
 | 
			
		||||
    * first batch we emitted after the last swap.
 | 
			
		||||
    */
 | 
			
		||||
   if (intel->first_post_swapbuffers_batch != NULL) {
 | 
			
		||||
      drm_intel_bo_wait_rendering(intel->first_post_swapbuffers_batch);
 | 
			
		||||
      drm_intel_bo_unreference(intel->first_post_swapbuffers_batch);
 | 
			
		||||
      intel->first_post_swapbuffers_batch = NULL;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
@@ -787,6 +813,8 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
 | 
			
		||||
      intel->prim.vb = NULL;
 | 
			
		||||
      dri_bo_unreference(intel->prim.vb_bo);
 | 
			
		||||
      intel->prim.vb_bo = NULL;
 | 
			
		||||
      dri_bo_unreference(intel->first_post_swapbuffers_batch);
 | 
			
		||||
      intel->first_post_swapbuffers_batch = NULL;
 | 
			
		||||
 | 
			
		||||
      if (release_texture_heaps) {
 | 
			
		||||
         /* This share group is about to go away, free our private
 | 
			
		||||
@@ -804,12 +832,23 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
 | 
			
		||||
 | 
			
		||||
      /* free the Mesa context */
 | 
			
		||||
      _mesa_free_context_data(&intel->ctx);
 | 
			
		||||
 | 
			
		||||
      FREE(intel);
 | 
			
		||||
      driContextPriv->driverPrivate = NULL;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GLboolean
 | 
			
		||||
intelUnbindContext(__DRIcontextPrivate * driContextPriv)
 | 
			
		||||
{
 | 
			
		||||
   struct intel_context *intel =
 | 
			
		||||
      (struct intel_context *) driContextPriv->driverPrivate;
 | 
			
		||||
 | 
			
		||||
   /* Deassociate the context with the drawables.
 | 
			
		||||
    */
 | 
			
		||||
   intel->driDrawable = NULL;
 | 
			
		||||
   intel->driReadDrawable = NULL;
 | 
			
		||||
 | 
			
		||||
   return GL_TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -191,6 +191,7 @@ struct intel_context
 | 
			
		||||
   GLboolean ttm;
 | 
			
		||||
 | 
			
		||||
   struct intel_batchbuffer *batch;
 | 
			
		||||
   drm_intel_bo *first_post_swapbuffers_batch;
 | 
			
		||||
   GLboolean no_batch_wrap;
 | 
			
		||||
   unsigned batch_id;
 | 
			
		||||
 | 
			
		||||
@@ -294,6 +295,14 @@ struct intel_context
 | 
			
		||||
    * easily.
 | 
			
		||||
    */
 | 
			
		||||
   GLboolean is_front_buffer_rendering;
 | 
			
		||||
   /**
 | 
			
		||||
    * Track whether front-buffer is the current read target.
 | 
			
		||||
    *
 | 
			
		||||
    * This is closely associated with is_front_buffer_rendering, but may
 | 
			
		||||
    * be set separately.  The DRI2 fake front buffer must be referenced
 | 
			
		||||
    * either way.
 | 
			
		||||
    */
 | 
			
		||||
   GLboolean is_front_buffer_reading;
 | 
			
		||||
 | 
			
		||||
   drm_clip_rect_t fboRect;     /**< cliprect for FBO rendering */
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -680,6 +680,11 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
 | 
			
		||||
      if (rb == NULL)
 | 
			
		||||
	 continue;
 | 
			
		||||
 | 
			
		||||
      if (irb == NULL) {
 | 
			
		||||
	 fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
 | 
			
		||||
	 continue;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      switch (irb->texformat->MesaFormat) {
 | 
			
		||||
      case MESA_FORMAT_ARGB8888:
 | 
			
		||||
      case MESA_FORMAT_RGB565:
 | 
			
		||||
 
 | 
			
		||||
@@ -342,10 +342,8 @@ intelInitPixelFuncs(struct dd_function_table *functions)
 | 
			
		||||
      functions->Bitmap = intelBitmap;
 | 
			
		||||
      functions->CopyPixels = intelCopyPixels;
 | 
			
		||||
      functions->DrawPixels = intelDrawPixels;
 | 
			
		||||
#ifdef I915
 | 
			
		||||
      functions->ReadPixels = intelReadPixels;
 | 
			
		||||
#endif
 | 
			
		||||
   }
 | 
			
		||||
   functions->ReadPixels = intelReadPixels;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
 
 | 
			
		||||
@@ -409,6 +409,12 @@ intel_texture_bitmap(GLcontext * ctx,
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (ctx->Fog.Enabled) {
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_FALLBACKS)
 | 
			
		||||
	 fprintf(stderr, "glBitmap() fallback: fog\n");
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   /* Check that we can load in a texture this big. */
 | 
			
		||||
   if (width > (1 << (ctx->Const.MaxTextureLevels - 1)) ||
 | 
			
		||||
       height > (1 << (ctx->Const.MaxTextureLevels - 1))) {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										321
									
								
								src/mesa/drivers/dri/intel/intel_pixel_read.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										321
									
								
								src/mesa/drivers/dri/intel/intel_pixel_read.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,321 @@
 | 
			
		||||
/**************************************************************************
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
 | 
			
		||||
 * All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a
 | 
			
		||||
 * copy of this software and associated documentation files (the
 | 
			
		||||
 * "Software"), to deal in the Software without restriction, including
 | 
			
		||||
 * without limitation the rights to use, copy, modify, merge, publish,
 | 
			
		||||
 * distribute, sub license, and/or sell copies of the Software, and to
 | 
			
		||||
 * permit persons to whom the Software is furnished to do so, subject to
 | 
			
		||||
 * the following conditions:
 | 
			
		||||
 *
 | 
			
		||||
 * The above copyright notice and this permission notice (including the
 | 
			
		||||
 * next paragraph) shall be included in all copies or substantial portions
 | 
			
		||||
 * of the Software.
 | 
			
		||||
 *
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 | 
			
		||||
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 | 
			
		||||
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
 | 
			
		||||
 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
 | 
			
		||||
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 | 
			
		||||
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 | 
			
		||||
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 | 
			
		||||
 *
 | 
			
		||||
 **************************************************************************/
 | 
			
		||||
 | 
			
		||||
#include "main/glheader.h"
 | 
			
		||||
#include "main/enums.h"
 | 
			
		||||
#include "main/mtypes.h"
 | 
			
		||||
#include "main/macros.h"
 | 
			
		||||
#include "main/image.h"
 | 
			
		||||
#include "main/bufferobj.h"
 | 
			
		||||
#include "main/state.h"
 | 
			
		||||
#include "swrast/swrast.h"
 | 
			
		||||
 | 
			
		||||
#include "intel_screen.h"
 | 
			
		||||
#include "intel_context.h"
 | 
			
		||||
#include "intel_batchbuffer.h"
 | 
			
		||||
#include "intel_blit.h"
 | 
			
		||||
#include "intel_buffers.h"
 | 
			
		||||
#include "intel_regions.h"
 | 
			
		||||
#include "intel_pixel.h"
 | 
			
		||||
#include "intel_buffer_objects.h"
 | 
			
		||||
 | 
			
		||||
/* For many applications, the new ability to pull the source buffers
 | 
			
		||||
 * back out of the GTT and then do the packing/conversion operations
 | 
			
		||||
 * in software will be as much of an improvement as trying to get the
 | 
			
		||||
 * blitter and/or texture engine to do the work.
 | 
			
		||||
 *
 | 
			
		||||
 * This step is gated on private backbuffers.
 | 
			
		||||
 *
 | 
			
		||||
 * Obviously the frontbuffer can't be pulled back, so that is either
 | 
			
		||||
 * an argument for blit/texture readpixels, or for blitting to a
 | 
			
		||||
 * temporary and then pulling that back.
 | 
			
		||||
 *
 | 
			
		||||
 * When the destination is a pbo, however, it's not clear if it is
 | 
			
		||||
 * ever going to be pulled to main memory (though the access param
 | 
			
		||||
 * will be a good hint).  So it sounds like we do want to be able to
 | 
			
		||||
 * choose between blit/texture implementation on the gpu and pullback
 | 
			
		||||
 * and cpu-based copying.
 | 
			
		||||
 *
 | 
			
		||||
 * Unless you can magically turn client memory into a PBO for the
 | 
			
		||||
 * duration of this call, there will be a cpu-based copying step in
 | 
			
		||||
 * any case.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static GLboolean
 | 
			
		||||
do_texture_readpixels(GLcontext * ctx,
 | 
			
		||||
                      GLint x, GLint y, GLsizei width, GLsizei height,
 | 
			
		||||
                      GLenum format, GLenum type,
 | 
			
		||||
                      const struct gl_pixelstore_attrib *pack,
 | 
			
		||||
                      struct intel_region *dest_region)
 | 
			
		||||
{
 | 
			
		||||
#if 0
 | 
			
		||||
   struct intel_context *intel = intel_context(ctx);
 | 
			
		||||
   intelScreenPrivate *screen = intel->intelScreen;
 | 
			
		||||
   GLint pitch = pack->RowLength ? pack->RowLength : width;
 | 
			
		||||
   __DRIdrawablePrivate *dPriv = intel->driDrawable;
 | 
			
		||||
   int textureFormat;
 | 
			
		||||
   GLenum glTextureFormat;
 | 
			
		||||
   int destFormat, depthFormat, destPitch;
 | 
			
		||||
   drm_clip_rect_t tmp;
 | 
			
		||||
 | 
			
		||||
   if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
      fprintf(stderr, "%s\n", __FUNCTION__);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   if (ctx->_ImageTransferState ||
 | 
			
		||||
       pack->SwapBytes || pack->LsbFirst || !pack->Invert) {
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
         fprintf(stderr, "%s: check_color failed\n", __FUNCTION__);
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   intel->vtbl.meta_texrect_source(intel, intel_readbuf_region(intel));
 | 
			
		||||
 | 
			
		||||
   if (!intel->vtbl.meta_render_dest(intel, dest_region, type, format)) {
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
         fprintf(stderr, "%s: couldn't set dest %s/%s\n",
 | 
			
		||||
                 __FUNCTION__,
 | 
			
		||||
                 _mesa_lookup_enum_by_nr(type),
 | 
			
		||||
                 _mesa_lookup_enum_by_nr(format));
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   LOCK_HARDWARE(intel);
 | 
			
		||||
 | 
			
		||||
   if (intel->driDrawable->numClipRects) {
 | 
			
		||||
      intel->vtbl.install_meta_state(intel);
 | 
			
		||||
      intel->vtbl.meta_no_depth_write(intel);
 | 
			
		||||
      intel->vtbl.meta_no_stencil_write(intel);
 | 
			
		||||
 | 
			
		||||
      if (!driClipRectToFramebuffer(ctx->ReadBuffer, &x, &y, &width, &height)) {
 | 
			
		||||
         UNLOCK_HARDWARE(intel);
 | 
			
		||||
         SET_STATE(i830, state);
 | 
			
		||||
         if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
            fprintf(stderr, "%s: cliprect failed\n", __FUNCTION__);
 | 
			
		||||
         return GL_TRUE;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      y = dPriv->h - y - height;
 | 
			
		||||
      x += dPriv->x;
 | 
			
		||||
      y += dPriv->y;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      /* Set the frontbuffer up as a large rectangular texture.
 | 
			
		||||
       */
 | 
			
		||||
      intel->vtbl.meta_tex_rect_source(intel, src_region, textureFormat);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      intel->vtbl.meta_texture_blend_replace(i830, glTextureFormat);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      /* Set the 3d engine to draw into the destination region:
 | 
			
		||||
       */
 | 
			
		||||
 | 
			
		||||
      intel->vtbl.meta_draw_region(intel, dest_region);
 | 
			
		||||
      intel->vtbl.meta_draw_format(intel, destFormat, depthFormat);     /* ?? */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      /* Draw a single quad, no cliprects:
 | 
			
		||||
       */
 | 
			
		||||
      intel->vtbl.meta_disable_cliprects(intel);
 | 
			
		||||
 | 
			
		||||
      intel->vtbl.draw_quad(intel,
 | 
			
		||||
                            0, width, 0, height,
 | 
			
		||||
                            0x00ff00ff, x, x + width, y, y + height);
 | 
			
		||||
 | 
			
		||||
      intel->vtbl.leave_meta_state(intel);
 | 
			
		||||
   }
 | 
			
		||||
   UNLOCK_HARDWARE(intel);
 | 
			
		||||
 | 
			
		||||
   intel_region_wait_fence(ctx, dest_region);   /* required by GL */
 | 
			
		||||
   return GL_TRUE;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   return GL_FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static GLboolean
 | 
			
		||||
do_blit_readpixels(GLcontext * ctx,
 | 
			
		||||
                   GLint x, GLint y, GLsizei width, GLsizei height,
 | 
			
		||||
                   GLenum format, GLenum type,
 | 
			
		||||
                   const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
 | 
			
		||||
{
 | 
			
		||||
   struct intel_context *intel = intel_context(ctx);
 | 
			
		||||
   struct intel_region *src = intel_readbuf_region(intel);
 | 
			
		||||
   struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj);
 | 
			
		||||
   GLuint dst_offset;
 | 
			
		||||
   GLuint rowLength;
 | 
			
		||||
 | 
			
		||||
   if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
      _mesa_printf("%s\n", __FUNCTION__);
 | 
			
		||||
 | 
			
		||||
   if (!src)
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   if (dst) {
 | 
			
		||||
      /* XXX This validation should be done by core mesa:
 | 
			
		||||
       */
 | 
			
		||||
      if (!_mesa_validate_pbo_access(2, pack, width, height, 1,
 | 
			
		||||
                                     format, type, pixels)) {
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels");
 | 
			
		||||
         return GL_TRUE;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   else {
 | 
			
		||||
      /* PBO only for now:
 | 
			
		||||
       */
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
         _mesa_printf("%s - not PBO\n", __FUNCTION__);
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   if (ctx->_ImageTransferState ||
 | 
			
		||||
       !intel_check_blit_format(src, format, type)) {
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
         _mesa_printf("%s - bad format for blit\n", __FUNCTION__);
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) {
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
         _mesa_printf("%s: bad packing params\n", __FUNCTION__);
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (pack->RowLength > 0)
 | 
			
		||||
      rowLength = pack->RowLength;
 | 
			
		||||
   else
 | 
			
		||||
      rowLength = width;
 | 
			
		||||
 | 
			
		||||
   if (pack->Invert) {
 | 
			
		||||
      if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
         _mesa_printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__);
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
   else {
 | 
			
		||||
      rowLength = -rowLength;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   /* XXX 64-bit cast? */
 | 
			
		||||
   dst_offset = (GLuint) _mesa_image_address(2, pack, pixels, width, height,
 | 
			
		||||
                                             format, type, 0, 0, 0);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   /* Although the blits go on the command buffer, need to do this and
 | 
			
		||||
    * fire with lock held to guarentee cliprects are correct.
 | 
			
		||||
    */
 | 
			
		||||
   intelFlush(&intel->ctx);
 | 
			
		||||
   LOCK_HARDWARE(intel);
 | 
			
		||||
 | 
			
		||||
   if (intel->driDrawable->numClipRects) {
 | 
			
		||||
      GLboolean all = (width * height * src->cpp == dst->Base.Size &&
 | 
			
		||||
                       x == 0 && dst_offset == 0);
 | 
			
		||||
 | 
			
		||||
      dri_bo *dst_buffer = intel_bufferobj_buffer(intel, dst,
 | 
			
		||||
						  all ? INTEL_WRITE_FULL :
 | 
			
		||||
						  INTEL_WRITE_PART);
 | 
			
		||||
      __DRIdrawablePrivate *dPriv = intel->driDrawable;
 | 
			
		||||
      int nbox = dPriv->numClipRects;
 | 
			
		||||
      drm_clip_rect_t *box = dPriv->pClipRects;
 | 
			
		||||
      drm_clip_rect_t rect;
 | 
			
		||||
      drm_clip_rect_t src_rect;
 | 
			
		||||
      int i;
 | 
			
		||||
 | 
			
		||||
      src_rect.x1 = dPriv->x + x;
 | 
			
		||||
      src_rect.y1 = dPriv->y + dPriv->h - (y + height);
 | 
			
		||||
      src_rect.x2 = src_rect.x1 + width;
 | 
			
		||||
      src_rect.y2 = src_rect.y1 + height;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      for (i = 0; i < nbox; i++) {
 | 
			
		||||
         if (!intel_intersect_cliprects(&rect, &src_rect, &box[i]))
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
         intelEmitCopyBlit(intel,
 | 
			
		||||
                           src->cpp,
 | 
			
		||||
                           src->pitch, src->buffer, 0, src->tiling,
 | 
			
		||||
                           rowLength, dst_buffer, dst_offset, GL_FALSE,
 | 
			
		||||
                           rect.x1,
 | 
			
		||||
                           rect.y1,
 | 
			
		||||
                           rect.x1 - src_rect.x1,
 | 
			
		||||
                           rect.y2 - src_rect.y2,
 | 
			
		||||
                           rect.x2 - rect.x1, rect.y2 - rect.y1,
 | 
			
		||||
			   GL_COPY);
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   UNLOCK_HARDWARE(intel);
 | 
			
		||||
 | 
			
		||||
   if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
      _mesa_printf("%s - DONE\n", __FUNCTION__);
 | 
			
		||||
 | 
			
		||||
   return GL_TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
intelReadPixels(GLcontext * ctx,
 | 
			
		||||
                GLint x, GLint y, GLsizei width, GLsizei height,
 | 
			
		||||
                GLenum format, GLenum type,
 | 
			
		||||
                const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
 | 
			
		||||
{
 | 
			
		||||
   if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
      fprintf(stderr, "%s\n", __FUNCTION__);
 | 
			
		||||
 | 
			
		||||
   intelFlush(ctx);
 | 
			
		||||
 | 
			
		||||
#ifdef I915
 | 
			
		||||
   if (do_blit_readpixels
 | 
			
		||||
       (ctx, x, y, width, height, format, type, pack, pixels))
 | 
			
		||||
      return;
 | 
			
		||||
 | 
			
		||||
   if (do_texture_readpixels
 | 
			
		||||
       (ctx, x, y, width, height, format, type, pack, pixels))
 | 
			
		||||
      return;
 | 
			
		||||
#else
 | 
			
		||||
   (void)do_blit_readpixels;
 | 
			
		||||
   (void)do_texture_readpixels;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   if (INTEL_DEBUG & DEBUG_PIXEL)
 | 
			
		||||
      _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
 | 
			
		||||
 | 
			
		||||
   /* Update Mesa state before calling down into _swrast_ReadPixels, as
 | 
			
		||||
    * the spans code requires the computed buffer states to be up to date,
 | 
			
		||||
    * but _swrast_ReadPixels only updates Mesa state after setting up
 | 
			
		||||
    * the spans code.
 | 
			
		||||
    */
 | 
			
		||||
 | 
			
		||||
   if (ctx->NewState)
 | 
			
		||||
      _mesa_update_state(ctx);
 | 
			
		||||
 | 
			
		||||
   _swrast_ReadPixels(ctx, x, y, width, height, format, type, pack, pixels);
 | 
			
		||||
}
 | 
			
		||||
@@ -114,6 +114,13 @@ intel_region_alloc(struct intel_context *intel,
 | 
			
		||||
{
 | 
			
		||||
   dri_bo *buffer;
 | 
			
		||||
 | 
			
		||||
   /* If we're untiled, we have to align to 2 rows high because the
 | 
			
		||||
    * data port accesses 2x2 blocks even if the bottom row isn't to be
 | 
			
		||||
    * rendered, so failure to align means we could walk off the end of the
 | 
			
		||||
    * GTT and fault.
 | 
			
		||||
    */
 | 
			
		||||
   height = ALIGN(height, 2);
 | 
			
		||||
 | 
			
		||||
   if (expect_accelerated_upload) {
 | 
			
		||||
      buffer = drm_intel_bo_alloc_for_render(intel->bufmgr, "region",
 | 
			
		||||
					     pitch * cpp * height, 64);
 | 
			
		||||
 
 | 
			
		||||
@@ -305,7 +305,7 @@ intelDestroyScreen(__DRIscreenPrivate * sPriv)
 | 
			
		||||
 | 
			
		||||
   dri_bufmgr_destroy(intelScreen->bufmgr);
 | 
			
		||||
   intelUnmapScreenRegions(intelScreen);
 | 
			
		||||
   driDestroyOptionCache(&intelScreen->optionCache);
 | 
			
		||||
   driDestroyOptionInfo(&intelScreen->optionCache);
 | 
			
		||||
 | 
			
		||||
   FREE(intelScreen);
 | 
			
		||||
   sPriv->private = NULL;
 | 
			
		||||
@@ -617,10 +617,10 @@ intel_init_bufmgr(intelScreenPrivate *intelScreen)
 | 
			
		||||
   /* Otherwise, use the classic buffer manager. */
 | 
			
		||||
   if (intelScreen->bufmgr == NULL) {
 | 
			
		||||
      if (gem_disable) {
 | 
			
		||||
	 fprintf(stderr, "GEM disabled.  Using classic.\n");
 | 
			
		||||
	 _mesa_warning(NULL, "GEM disabled.  Using classic.");
 | 
			
		||||
      } else {
 | 
			
		||||
	 fprintf(stderr, "Failed to initialize GEM.  "
 | 
			
		||||
		 "Falling back to classic.\n");
 | 
			
		||||
	 _mesa_warning(NULL,
 | 
			
		||||
                       "Failed to initialize GEM.  Falling back to classic.");
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (intelScreen->tex.size == 0) {
 | 
			
		||||
 
 | 
			
		||||
@@ -283,12 +283,12 @@ radeonFillInModes( __DRIscreenPrivate *psp,
 | 
			
		||||
     * with a stencil buffer.  It will be a sw fallback, but some apps won't
 | 
			
		||||
     * care about that.
 | 
			
		||||
     */
 | 
			
		||||
    stencil_bits_array[0] = 0;
 | 
			
		||||
    stencil_bits_array[0] = stencil_bits;
 | 
			
		||||
    stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
 | 
			
		||||
 | 
			
		||||
    msaa_samples_array[0] = 0;
 | 
			
		||||
 | 
			
		||||
    depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
 | 
			
		||||
    depth_buffer_factor = (stencil_bits == 0) ? 2 : 1;
 | 
			
		||||
    back_buffer_factor  = (have_back_buffer) ? 2 : 1;
 | 
			
		||||
 | 
			
		||||
    if (pixel_bits == 16) {
 | 
			
		||||
 
 | 
			
		||||
@@ -902,7 +902,6 @@ EXPORTS
 | 
			
		||||
	_mesa_generate_mipmap
 | 
			
		||||
	_mesa_get_compressed_teximage
 | 
			
		||||
	_mesa_get_current_context
 | 
			
		||||
	_mesa_get_program_register
 | 
			
		||||
	_mesa_get_teximage
 | 
			
		||||
	_mesa_init_driver_functions
 | 
			
		||||
	_mesa_init_glsl_driver_functions
 | 
			
		||||
 
 | 
			
		||||
@@ -1040,7 +1040,7 @@ _mesa_MapBufferARB(GLenum target, GLenum access)
 | 
			
		||||
   ASSERT(ctx->Driver.MapBuffer);
 | 
			
		||||
   bufObj->Pointer = ctx->Driver.MapBuffer( ctx, target, access, bufObj );
 | 
			
		||||
   if (!bufObj->Pointer) {
 | 
			
		||||
      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(access)");
 | 
			
		||||
      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(map failed)");
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   bufObj->Access = access;
 | 
			
		||||
 
 | 
			
		||||
@@ -110,10 +110,8 @@ extern "C" {
 | 
			
		||||
#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP)
 | 
			
		||||
#  define __WIN32__
 | 
			
		||||
#  define finite _finite
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(__WATCOMC__)
 | 
			
		||||
#elif defined(__WATCOMC__)
 | 
			
		||||
#  define finite _finite
 | 
			
		||||
#  pragma disable_message(201) /* Disable unreachable code warnings */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -135,6 +133,10 @@ extern "C" {
 | 
			
		||||
#    endif
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(__WATCOMC__)
 | 
			
		||||
#  pragma disable_message(201) /* Disable unreachable code warnings */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
@@ -138,9 +138,14 @@
 | 
			
		||||
/** 
 | 
			
		||||
 * Maximum viewport/image width. Must accomodate all texture sizes too. 
 | 
			
		||||
 */
 | 
			
		||||
#define MAX_WIDTH 4096
 | 
			
		||||
 | 
			
		||||
#ifndef MAX_WIDTH
 | 
			
		||||
#   define MAX_WIDTH 4096
 | 
			
		||||
#endif
 | 
			
		||||
/** Maximum viewport/image height */
 | 
			
		||||
#define MAX_HEIGHT 4096
 | 
			
		||||
#ifndef MAX_HEIGHT
 | 
			
		||||
#   define MAX_HEIGHT 4096
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/** Maxmimum size for CVA.  May be overridden by the drivers.  */
 | 
			
		||||
#define MAX_ARRAY_LOCK_SIZE 3000
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -231,7 +231,7 @@ enable_texture(GLcontext *ctx, GLboolean state, GLbitfield bit)
 | 
			
		||||
   const GLuint newenabled = (!state)
 | 
			
		||||
       ? (texUnit->Enabled & ~bit) :  (texUnit->Enabled | bit);
 | 
			
		||||
 | 
			
		||||
   if (!ctx->DrawBuffer->Visual.rgbMode || texUnit->Enabled == newenabled)
 | 
			
		||||
   if (texUnit->Enabled == newenabled)
 | 
			
		||||
       return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   FLUSH_VERTICES(ctx, _NEW_TEXTURE);
 | 
			
		||||
@@ -933,11 +933,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state)
 | 
			
		||||
      /* GL_EXT_depth_bounds_test */
 | 
			
		||||
      case GL_DEPTH_BOUNDS_TEST_EXT:
 | 
			
		||||
         CHECK_EXTENSION(EXT_depth_bounds_test, cap);
 | 
			
		||||
         if (state && ctx->DrawBuffer->Visual.depthBits == 0) {
 | 
			
		||||
            _mesa_warning(ctx,
 | 
			
		||||
                   "glEnable(GL_DEPTH_BOUNDS_TEST_EXT) but no depth buffer");
 | 
			
		||||
            return;
 | 
			
		||||
         }
 | 
			
		||||
         if (ctx->Depth.BoundsTest == state)
 | 
			
		||||
            return;
 | 
			
		||||
         FLUSH_VERTICES(ctx, _NEW_DEPTH);
 | 
			
		||||
 
 | 
			
		||||
@@ -404,6 +404,7 @@ _mesa_enable_2_0_extensions(GLcontext *ctx)
 | 
			
		||||
   ctx->Extensions.ARB_fragment_shader = GL_TRUE;
 | 
			
		||||
#endif
 | 
			
		||||
   ctx->Extensions.ARB_point_sprite = GL_TRUE;
 | 
			
		||||
   ctx->Extensions.EXT_blend_equation_separate = GL_TRUE;
 | 
			
		||||
   ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;
 | 
			
		||||
#if FEATURE_ARB_shader_objects
 | 
			
		||||
   ctx->Extensions.ARB_shader_objects = GL_TRUE;
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user