Compare commits
204 Commits
mesa-7.9-r
...
mesa-7.9.1
Author | SHA1 | Date | |
---|---|---|---|
|
42a9472dc6 | ||
|
234144b48d | ||
|
3d90628138 | ||
|
d0f0a6920b | ||
|
110c49fddd | ||
|
c438a09b4c | ||
|
0ab166d556 | ||
|
b50658c804 | ||
|
3c8dd6a8de | ||
|
801e26a02a | ||
|
247774085c | ||
|
d5d573b592 | ||
|
54c2846f23 | ||
|
8941450010 | ||
|
0ff45dd5d7 | ||
|
4e7cdca57a | ||
|
69cc356832 | ||
|
0d98ceb4bf | ||
|
40390b80e9 | ||
|
7ffeced927 | ||
|
b8c16ee7b1 | ||
|
f5435ec3a9 | ||
|
a3740ba31e | ||
|
166da97889 | ||
|
2fb170c90f | ||
|
4f2f3440d0 | ||
|
760288bec1 | ||
|
84e7dd0114 | ||
|
9d1c6dd79b | ||
|
47552b2c66 | ||
|
edfe057f94 | ||
|
a4cda571f0 | ||
|
ecb68d51aa | ||
|
be1f4cfd96 | ||
|
7b6b66d617 | ||
|
2b4277dcf3 | ||
|
585fa612c9 | ||
|
b8e73354d9 | ||
|
154d0a3e7e | ||
|
7c0ff4a5df | ||
|
d192179605 | ||
|
b2cd388b79 | ||
|
bb2cd98e51 | ||
|
d9d4f22e65 | ||
|
d347b90b94 | ||
|
23a868930c | ||
|
1e88b3461a | ||
|
573c78803d | ||
|
5650cc462d | ||
|
54a596e34a | ||
|
2127692542 | ||
|
0795cb71fc | ||
|
cefccebd89 | ||
|
927c752dd6 | ||
|
0b4287a687 | ||
|
69d19cb84b | ||
|
0ab2bb8270 | ||
|
1e2e387a15 | ||
|
dcc7a8a80a | ||
|
0a8ad737e7 | ||
|
4b19941399 | ||
|
1cfd517b15 | ||
|
a0d5da96b5 | ||
|
50ec3c74e3 | ||
|
d595657e5a | ||
|
c055239bae | ||
|
6b96b002c8 | ||
|
ce8f4f266e | ||
|
e0dbd44a00 | ||
|
67b7a3844a | ||
|
69cc62b907 | ||
|
8c8c1b2c99 | ||
|
9b8e56a502 | ||
|
5a8d1d5b72 | ||
|
029252a448 | ||
|
4b30da86a7 | ||
|
da5d6c42c0 | ||
|
0c56721cfc | ||
|
6333f1d224 | ||
|
639e65e054 | ||
|
8454f931d6 | ||
|
0da1c7b90f | ||
|
6e5907c390 | ||
|
4c1db8c7a4 | ||
|
edd9b9350e | ||
|
5c71690096 | ||
|
44df2b0844 | ||
|
5b28db24ff | ||
|
2f4af9e37b | ||
|
34e0da8e73 | ||
|
1ee289960f | ||
|
22ba37aae2 | ||
|
3b200dd3c5 | ||
|
5f05ade503 | ||
|
9ef05d27a6 | ||
|
1d63a77177 | ||
|
554dbaa8a0 | ||
|
1c089271fd | ||
|
2c57c020a3 | ||
|
2f398485f2 | ||
|
e5ad6c3366 | ||
|
1c15fb4414 | ||
|
a138a59966 | ||
|
6fc544dd50 | ||
|
42e9750975 | ||
|
72a3bddb24 | ||
|
e8bc8d6a5c | ||
|
dc4956922d | ||
|
b486197013 | ||
|
2cb8522523 | ||
|
564a6a15fe | ||
|
7d280a3bbe | ||
|
988a35c7f7 | ||
|
4e7548aafc | ||
|
277655d7fa | ||
|
d42db5b738 | ||
|
62f2b7e759 | ||
|
44ba61c518 | ||
|
1c746ba9d4 | ||
|
c9661d695b | ||
|
aa7bf2d88e | ||
|
9d644e7b95 | ||
|
54047fcd8d | ||
|
bcdd93e3a7 | ||
|
75065b0b55 | ||
|
8ae23176d6 | ||
|
7d0c0d32b5 | ||
|
e5c78c2003 | ||
|
930c168df6 | ||
|
5551faf649 | ||
|
80ff25b628 | ||
|
7c8715ef0a | ||
|
06fa5d81da | ||
|
b86bf31b05 | ||
|
68afe8f685 | ||
|
0d060d9933 | ||
|
aa5574e78f | ||
|
5105e3d415 | ||
|
feacfc4a93 | ||
|
b6ae3d7b23 | ||
|
3db8f85446 | ||
|
3e4ed38791 | ||
|
acee46d9a1 | ||
|
97805cfedd | ||
|
9b1ac4d127 | ||
|
78ccca5a69 | ||
|
2fe82c281d | ||
|
773e8fadc8 | ||
|
7f2d1280e7 | ||
|
075640e37e | ||
|
fb7a095785 | ||
|
f245bb4c9c | ||
|
cc71f76be2 | ||
|
47887b1efe | ||
|
764f9974e5 | ||
|
aa2b751abb | ||
|
6f5c6e5cc5 | ||
|
e5b2a8d350 | ||
|
da580c734f | ||
|
db7de707a3 | ||
|
bce3917192 | ||
|
2eac388bfe | ||
|
6730630804 | ||
|
d5618c55ec | ||
|
ee6417f97f | ||
|
14bae5cdf2 | ||
|
799e6d4d15 | ||
|
6936fbc039 | ||
|
0a060c8fb0 | ||
|
34c518be52 | ||
|
2b4a05e74a | ||
|
7afce798ee | ||
|
ab502d0d6b | ||
|
548a50caae | ||
|
11e290daa4 | ||
|
889cb2539b | ||
|
242facde45 | ||
|
73be0dfe03 | ||
|
0b300a4e3d | ||
|
586797d7a8 | ||
|
9b646b1fd3 | ||
|
dc8e22e4f0 | ||
|
21078eef10 | ||
|
968a9ec76e | ||
|
2cdfda8851 | ||
|
09d89dc95b | ||
|
15ad34f012 | ||
|
094fe2aa23 | ||
|
ba889a2b3e | ||
|
71cc467f4c | ||
|
d6e2b707ba | ||
|
0ab9d8d94b | ||
|
759e9fb737 | ||
|
4af00f1a5e | ||
|
1c8795075f | ||
|
5d43c78d03 | ||
|
9f076a0848 | ||
|
9bab8ca4f8 | ||
|
f6eb5d991c | ||
|
f282d72678 | ||
|
e1918fd5d5 | ||
|
fcf5819945 | ||
|
c584318a21 | ||
|
b24238c49a |
10
Makefile
10
Makefile
@@ -180,7 +180,7 @@ ultrix-gcc:
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
VERSION=7.9-rc2
|
||||
VERSION=7.9.1
|
||||
DIRECTORY = Mesa-$(VERSION)
|
||||
LIB_NAME = MesaLib-$(VERSION)
|
||||
GLUT_NAME = MesaGLUT-$(VERSION)
|
||||
@@ -329,6 +329,8 @@ GALLIUM_FILES = \
|
||||
$(DIRECTORY)/src/gallium/Makefile.template \
|
||||
$(DIRECTORY)/src/gallium/SConscript \
|
||||
$(DIRECTORY)/src/gallium/targets/Makefile.dri \
|
||||
$(DIRECTORY)/src/gallium/targets/Makefile.xorg \
|
||||
$(DIRECTORY)/src/gallium/targets/SConscript.dri \
|
||||
$(DIRECTORY)/src/gallium/*/Makefile \
|
||||
$(DIRECTORY)/src/gallium/*/SConscript \
|
||||
$(DIRECTORY)/src/gallium/*/*/Makefile \
|
||||
@@ -345,23 +347,19 @@ GALLIUM_FILES = \
|
||||
|
||||
DRI_FILES = \
|
||||
$(DIRECTORY)/include/GL/internal/dri_interface.h \
|
||||
$(DIRECTORY)/include/GL/internal/glcore.h \
|
||||
$(DIRECTORY)/include/GL/internal/sarea.h \
|
||||
$(DIRECTORY)/src/glx/Makefile \
|
||||
$(DIRECTORY)/src/glx/Makefile \
|
||||
$(DIRECTORY)/src/glx/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/*.cpp \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
|
||||
|
||||
SGI_GLU_FILES = \
|
||||
$(DIRECTORY)/src/glu/Makefile \
|
||||
|
@@ -53,7 +53,7 @@ MKDEP_OPTIONS = @MKDEP_OPTIONS@
|
||||
INSTALL = @INSTALL@
|
||||
|
||||
# Python and flags (generally only needed by the developers)
|
||||
PYTHON2 = python
|
||||
PYTHON2 = @PYTHON2@
|
||||
PYTHON_FLAGS = -t -O -O
|
||||
|
||||
# Library names (base name)
|
||||
|
@@ -30,6 +30,7 @@ AC_PROG_CPP
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_CHECK_PROGS([MAKE], [gmake make])
|
||||
AC_CHECK_PROGS([PYTHON2], [python2 python])
|
||||
AC_PATH_PROG([MKDEP], [makedepend])
|
||||
AC_PATH_PROG([SED], [sed])
|
||||
|
||||
@@ -1687,6 +1688,8 @@ echo ""
|
||||
echo " CFLAGS: $cflags"
|
||||
echo " CXXFLAGS: $cxxflags"
|
||||
echo " Macros: $defines"
|
||||
echo ""
|
||||
echo " PYTHON2: $PYTHON2"
|
||||
|
||||
echo ""
|
||||
echo " Run '${MAKE-make}' to build Mesa"
|
||||
|
@@ -145,7 +145,7 @@ Make sure the values in src/mesa/main/version.h are correct.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Update the docs/news.html file and docs/download.html files.
|
||||
Update docs/news.html.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -208,10 +208,11 @@ sftp USERNAME,mesa3d@web.sourceforge.net
|
||||
|
||||
<p>
|
||||
Make an announcement on the mailing lists:
|
||||
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>,
|
||||
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
|
||||
|
||||
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>,
|
||||
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
|
||||
and
|
||||
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
|
||||
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
|
||||
</p>
|
||||
|
||||
|
||||
|
@@ -11,10 +11,18 @@
|
||||
<H1>News</H1>
|
||||
|
||||
|
||||
<h2>October 4, 2010</h2>
|
||||
|
||||
<p>
|
||||
<a href="relnotes-7.9.html">Mesa 7.9</a> (final) is released. This is a new
|
||||
development release.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>September 27, 2010</h2>
|
||||
|
||||
<p>
|
||||
<a href="relnotes-7.9.0.html">Mesa 7.9.0-rc1</a> is released. This is a
|
||||
<a href="relnotes-7.9.html">Mesa 7.9.0-rc1</a> is released. This is a
|
||||
release candidate for the 7.9 development release.
|
||||
</p>
|
||||
|
||||
|
@@ -26,7 +26,15 @@ for DRI hardware acceleration.
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
tbd
|
||||
c89b63d253605ed40e8ac370d25a833c MesaLib-7.8.2.tar.gz
|
||||
6be2d343a0089bfd395ce02aaf8adb57 MesaLib-7.8.2.tar.bz2
|
||||
a04ad3b06ac5ff3969a003fa7bbf7d5b MesaLib-7.8.2.zip
|
||||
7c213f92efeb471f0331670d5079d4c0 MesaDemos-7.8.2.tar.gz
|
||||
757d9e2e06f48b1a52848be9b0307ced MesaDemos-7.8.2.tar.bz2
|
||||
8d0e5cfe68b8ebf90265d350ae2c48b1 MesaDemos-7.8.2.zip
|
||||
b74482e3f44f35ed395c4aada4fd8240 MesaGLUT-7.8.2.tar.gz
|
||||
a471807b65e49c325808ba4551be93ed MesaGLUT-7.8.2.tar.bz2
|
||||
9f190268c42be582ef66e47365ee61e3 MesaGLUT-7.8.2.zip
|
||||
</pre>
|
||||
|
||||
|
||||
@@ -44,10 +52,95 @@ tbd
|
||||
<ul>
|
||||
<li>Fixed Gallium glDrawPixels(GL_DEPTH_COMPONENT).
|
||||
<li>Fixed Gallium Cell driver to buildable, runable state
|
||||
<li>Fixed bad error checking for glFramebufferRenderbuffer(attachment=GL_DEPTH_STENCIL_ATTACHMENT).
|
||||
<li>Fixed incorrect Z coordinate handling in "meta" glDraw/CopyPixels.
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=23670">Bug
|
||||
#23670</a>.</li>
|
||||
|
||||
<li>Assorted i965 driver fixes.
|
||||
Including but not limited to:
|
||||
<ul>
|
||||
<li>Fix scissoring when width or height is
|
||||
0. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27643">Bug
|
||||
#27643</a>.
|
||||
<li>Fix bit allocation for number of color regions for
|
||||
ARB_draw_buffers.</li>
|
||||
<li>Set the correct provoking vertex for clipped first-mode
|
||||
trifans. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24470">Bug
|
||||
#24470</a>.</li>
|
||||
<li>Use <code>R16G16B16A16_FLOAT</code> for 3-component half-float.</li>
|
||||
<li>Fix assertion for surface tile offset usage on Ironlake.</li>
|
||||
<li>Fix cube map layouts on Ironlake.</li>
|
||||
<li>When an RB gets a new region, clear the old from the state
|
||||
cache. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24119">Bug
|
||||
#24119</a>.</li>
|
||||
<li>Reject shaders with uninlined function calls instead of hanging.</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Assorted i915 driver fixes. Including but not limited to:
|
||||
<ul>
|
||||
<li>Fixed texture LOD clamping in i915 driver.
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=24846">Bug
|
||||
#24846</a>.</li>
|
||||
<li>Fix off-by-one for drawing rectangle.
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27408">Bug
|
||||
#27408</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Fixed hangs in etracer on 830 and 845
|
||||
chipsets. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=26557">Bug
|
||||
#26557</a>.</li>
|
||||
<li>Fixed tiling of small textures on all Intel drivers.</li>
|
||||
<li>Fixed crash in Savage driver when using <code>_mesa_CopyTexImage2D</code>.
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27652">Bug
|
||||
#27652</a>.</li>
|
||||
|
||||
<li>Assorted GLX fixes. Including but not limited to:
|
||||
<ul>
|
||||
<li>Fixed <code>__glXInitializeVisualConfigFromTags</code>'s handling of
|
||||
unrecognized fbconfig tags.</li>
|
||||
<li>Fixed regression with <code>GLX_USE_GL</code>.
|
||||
<li>Fixed config chooser logic for 'mask' matching.</li>
|
||||
<li>Report swap events correctly in direct rendered case (DRI2)</li>
|
||||
<li>Fixed build with dri2proto which doesn't define
|
||||
<code>X_DRI2SwapInterval</code>.</li>
|
||||
<li>Get <code>GLX_SCREEN</code> first in <code>__glXQueryContextInfo</code>.
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=14245">Bug
|
||||
#14245</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Assorted GLSL fixes. Including but not limited to:
|
||||
<ul>
|
||||
<li>Change variable declared assertion into conditional in GLSL
|
||||
compiler. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27921">Bug
|
||||
#27921</a>.</li>
|
||||
<li>Fix instruction indexing
|
||||
bugs. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27566">Bug
|
||||
#27566</a>.</li>
|
||||
<li>Updated uniform location / offset encoding to be more like
|
||||
other implementations.</li>
|
||||
<li>Don't overwrite a driver's shader infolog with generic failure
|
||||
message.</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>Fixed OSMesa build for 16 and 32-bit color channel depth.
|
||||
<li>Fixed OSMesa build with hidden symbol visibility. libOSMesa no longer links to libGL.
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28305">Bug
|
||||
#28305</a>.
|
||||
<li>Fixed handling of multiple render targets in fixed-function
|
||||
texture envrionmnent programs.</li>
|
||||
<li>Fixed conversion errors in <code>signed_rgba8888[rev]</code> texel
|
||||
fetch.</li>
|
||||
<li>Don't set srcLevel on <code>GL_TEXTURE_RECTANGLE_ARB</code> targets.</li>
|
||||
<li>Various build fixes for OpenBSD.</li>
|
||||
<li>Various build fixes for OS X.</li>
|
||||
<li>Various build fixes for GCC 3.3.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
<p>None.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
89
docs/relnotes-7.8.3.html
Normal file
89
docs/relnotes-7.8.3.html
Normal file
@@ -0,0 +1,89 @@
|
||||
<HTML>
|
||||
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
|
||||
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.8.3 Release Notes / (date tbd)</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.8.3 is a bug fix release which fixes bugs found since the 7.8.2 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 7.8.3 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>
|
||||
x MesaLib-7.8.3.tar.gz
|
||||
x MesaLib-7.8.3.tar.bz2
|
||||
x MesaLib-7.8.3.zip
|
||||
x MesaDemos-7.8.3.tar.gz
|
||||
x MesaDemos-7.8.3.tar.bz2
|
||||
x MesaDemos-7.8.3.zip
|
||||
x MesaGLUT-7.8.3.tar.gz
|
||||
x MesaGLUT-7.8.3.tar.bz2
|
||||
x MesaGLUT-7.8.3.zip
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None.</p>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
<ul>
|
||||
<li>The radeon driver should use less memory when searching for a valid mip
|
||||
image.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<ul>
|
||||
<li>Fix unsupported FB with D24S8 (bug
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=23670">29116</a>)</li>
|
||||
<li>Fix ReadPixels crash when reading depth/stencil from an FBO</li>
|
||||
<li>Fixed a bug rendering to 16-bit buffers using swrast.</li>
|
||||
<li>Fixed a state tracker/TGSI bug that caused crashes when using Windows'
|
||||
memory debugging features.</li>
|
||||
<li>Fixed an issue rendering to 32-bit channels with swrast (bug
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=29487">29487</a>)</li>
|
||||
<li>GLSL: fix indirect <TT>gl_TextureMatrix</TT> addressing (bug
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28967">28967</a>)</li>
|
||||
<li>GLSL: fix for bug
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27216">27216</a></li>
|
||||
<li>GLSL: fix zw fragcoord entries in some cases (bug
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=29183">29183</a>)</li>
|
||||
<li>Fix texture env generation in some cases (bug
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28169">28169</a>)</li>
|
||||
<li>osmesa: a fix for calling <TT>OSMesaMakeCurrent</TT> twice was applied (bug
|
||||
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=10966">10966</a></li>
|
||||
<li>A bug was fixed which could cause Mesa to ignore the
|
||||
<TT>MESA_EXTENSION_OVERRIDE</TT> environment variable.</li>
|
||||
<li>A bug related to specular highlights on backfaces was fixed.</li>
|
||||
<li>A radeon-specific issue with <TT>glCopyTex(Sub)Image</TT> was
|
||||
corrected.</li>
|
||||
<li>radeon/wine: flush command stream in more cases, fixing wine d3d9
|
||||
tests.</li>
|
||||
<li>r600: fix sin+cos normalization.</li>
|
||||
<li>r600: (properly) ignore <TT>GL_COORD_REPLACE</TT> when point sprites are
|
||||
disabled.</li>
|
||||
<li>radeon: avoid flushing when the context is not current.</li>
|
||||
<li>r300c: a bug affecting unaligned BOs was fixed.</li>
|
||||
<li>r300c: a hardlock caused by ARB_half_float_vertex incorrectly advertised on some chipsets.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
399
docs/relnotes-7.9.1.html
Normal file
399
docs/relnotes-7.9.1.html
Normal file
@@ -0,0 +1,399 @@
|
||||
<HTML>
|
||||
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
|
||||
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.9.1 Release Notes / January 7, 2011</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.9.1 is a bug fix release which fixes bugs found since the 7.9 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 7.9.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>
|
||||
TBD.
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None.</p>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<p>This list is likely incomplete.</p>
|
||||
<ul>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28800">Bug 28800</a> - [r300c, r300g] Texture corruption with World of Warcraft</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29420">Bug 29420</a> - Amnesia / HPL2 RendererFeatTest - not rendering correctly</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29946">Bug 29946</a> - [swrast] piglit valgrind glsl-array-bounds-04 fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30261">Bug 30261</a> - [GLSL 1.20] allowing inconsistent invariant declaration between two vertex shaders</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30632">Bug 30632</a> - [softpipe] state_tracker/st_manager.c:489: st_context_notify_invalid_framebuffer: Assertion `stfb && stfb->iface == stfbi' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30694">Bug 30694</a> - wincopy will crash on Gallium drivers when going to front buffer</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30787">Bug 30787</a> - Invalid asm shader does not generate draw-time error when used with GLSL shader</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30993">Bug 30993</a> - getFramebufferAttachmentParameteriv wrongly generates error</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31101">Bug 31101</a> - [glsl2] abort() in ir_validate::visit_enter(ir_assignment *ir)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31193">Bug 31193</a> - [regression] aa43176e break water reflections</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31194">Bug 31194</a> - The mesa meta save/restore code doesn't ref the current GLSL program</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31371">Bug 31371</a> - glslparsertest: ir.cpp:358: ir_constant::ir_constant(const glsl_type*, const ir_constant_data*): Assertion `(type->base_type >= 0) && (type->base_type <= 3)' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31439">Bug 31439</a> - Crash in glBufferSubData() with size == 0</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31495">Bug 31495</a> - [i965 gles2c bisected] OpenGL ES 2.0 conformance GL2Tests_GetBIFD_input.run regressed</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31514">Bug 31514</a> - isBuffer returns true for unbound buffers</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31560">Bug 31560</a> - [tdfx] tdfx_tex.c:702: error: ‘const struct gl_color_table’ has no member named ‘Format’</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31617">Bug 31617</a> - Radeon/Compiz: 'failed to attach dri2 front buffer', error case not handled</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31648">Bug 31648</a> - [GLSL] array-struct-array gets assertion: `(size >= 1) && (size <= 4)' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31650">Bug 31650</a> - [GLSL] varying gl_TexCoord fails to be re-declared to different size in the second shader</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31673">Bug 31673</a> - GL_FRAGMENT_PRECISION_HIGH preprocessor macro undefined in GLSL ES</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31690">Bug 31690</a> - i915 shader compiler fails to flatten if in Aquarium webgl demo.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31832">Bug 31832</a> - [i915] Bad renderbuffer format: 21</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31841">Bug 31841</a> - [drm:radeon_cs_ioctl] *ERROR* Invalid command stream !</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31894">Bug 31894</a> - Writing to gl_PointSize with GLES2 corrupts other varyings</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31909">Bug 31909</a> - [i965] brw_fs.cpp:1461: void fs_visitor::emit_bool_to_cond_code(ir_rvalue*): Assertion `expr->operands[i]->type->is_scalar()' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31934">Bug 31934</a> - [gallium] Mapping empty buffer object causes SIGSEGV</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31983">Bug 31983</a> - [i915 gles2] "if (expression with builtin/varying variables) discard" breaks linkage</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31985">Bug 31985</a> - [GLSL 1.20] initialized uniform array considered as "unsized"</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31987">Bug 31987</a> - [gles2] if input a wrong pname(GL_NONE) to glGetBoolean, it will not case GL_INVALID_ENUM</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32035">Bug 32035</a> - [GLSL bisected] comparing unsized array gets segfault</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32070">Bug 32070</a> - llvmpipe renders stencil demo incorrectly</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32273">Bug 32273</a> - assertion fails when starting vdrift 2010 release with shaders enabled</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32287">Bug 32287</a> - [bisected GLSL] float-int failure</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32311">Bug 32311</a> - [965 bisected] Array look-ups broken on GM45</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32520">Bug 32520</a> - [gles2] glBlendFunc(GL_ZERO, GL_DST_COLOR) will result in GL_INVALID_ENUM</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32825">Bug 32825</a> - egl_glx driver completely broken in 7.9 branch [fix in master]</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
<p>The full set of changes can be viewed by using the following GIT command:</p>
|
||||
|
||||
<pre>
|
||||
git log mesa-7.9..mesa-7.9.1
|
||||
</pre>
|
||||
|
||||
<p>Alex Deucher (5):
|
||||
<ul>
|
||||
<li>r100: revalidate after radeon_update_renderbuffers</li>
|
||||
<li>r600c: add missing radeon_prepare_render() call on evergreen</li>
|
||||
<li>r600c: properly align mipmaps to group size</li>
|
||||
<li>gallium/egl: fix r300 vs r600 loading</li>
|
||||
<li>r600c: fix some opcodes on evergreen</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Aras Pranckevicius (2):
|
||||
<ul>
|
||||
<li>glsl: fix crash in loop analysis when some controls can't be determined</li>
|
||||
<li>glsl: fix matrix type check in ir_algebraic</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Brian Paul (27):
|
||||
<ul>
|
||||
<li>swrast: fix choose_depth_texture_level() to respect mipmap filtering state</li>
|
||||
<li>st/mesa: replace assertion w/ conditional in framebuffer invalidation</li>
|
||||
<li>egl/i965: include inline_wrapper_sw_helper.h</li>
|
||||
<li>mesa: Add missing else in do_row_3D</li>
|
||||
<li>mesa: add missing formats in _mesa_format_to_type_and_comps()</li>
|
||||
<li>mesa: handle more pixel types in mipmap generation code</li>
|
||||
<li>mesa: make glIsBuffer() return false for never bound buffers</li>
|
||||
<li>mesa: fix glDeleteBuffers() regression</li>
|
||||
<li>swrast: init alpha value to 1.0 in opt_sample_rgb_2d()</li>
|
||||
<li>meta: Mask Stencil.Clear against stencilMax in _mesa_meta_Clear</li>
|
||||
<li>st/mesa: fix mapping of zero-sized buffer objects</li>
|
||||
<li>mesa: check for posix_memalign() errors</li>
|
||||
<li>llvmpipe: fix broken stencil writemask</li>
|
||||
<li>mesa: fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query</li>
|
||||
<li>mesa: return GL_FRAMEBUFFER_DEFAULT as FBO attachment type</li>
|
||||
<li>mesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM</li>
|
||||
<li>mesa: test for cube map completeness in glGenerateMipmap()</li>
|
||||
<li>tnl: Initialize gl_program_machine memory in run_vp.</li>
|
||||
<li>tnl: a better way to initialize the gl_program_machine memory</li>
|
||||
<li>mesa, st/mesa: disable GL_ARB_geometry_shader4</li>
|
||||
<li>glsl: fix off by one in register index assertion</li>
|
||||
<li>st/mesa: fix mipmap generation bug</li>
|
||||
<li>glsl: new glsl_strtod() wrapper to fix decimal point interpretation</li>
|
||||
<li>mesa: no-op glBufferSubData() on size==0</li>
|
||||
<li>tdfx: s/Format/_BaseFormat/</li>
|
||||
<li>st/mesa: fix renderbuffer pointer check in st_Clear()</li>
|
||||
<li>mesa: Bump the number of bits in the register index.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Chad Versace (5):
|
||||
<ul>
|
||||
<li>glsl: Fix lexer rule for ^=</li>
|
||||
<li>glsl: Fix ast-to-hir for ARB_fragment_coord_conventions</li>
|
||||
<li>glsl: Fix ir_expression::constant_expression_value()</li>
|
||||
<li>glsl: Fix erroneous cast in ast_jump_statement::hir()</li>
|
||||
<li>glsl: Fix linker bug in cross_validate_globals()</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Chia-I Wu (10):
|
||||
<ul>
|
||||
<li>targets/egl: Fix linking with libdrm.</li>
|
||||
<li>st/vega: Fix version check in context creation.</li>
|
||||
<li>st/egl: Do not finish a fence that is NULL.</li>
|
||||
<li>egl: Fix a false negative check in _eglCheckMakeCurrent.</li>
|
||||
<li>st/mesa: Unreference the sampler view in st_bind_surface.</li>
|
||||
<li>egl_dri2: Fix __DRI_DRI2 version 1 support.</li>
|
||||
<li>st/vega: Do not wait NULL fences.</li>
|
||||
<li>mesa: Do not advertise GL_OES_texture_3D.</li>
|
||||
<li>egl_glx: Fix borken driver.</li>
|
||||
<li>egl: Check extensions.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Daniel Lichtenberger (1):
|
||||
<ul>
|
||||
<li>radeon: fix potential segfault in renderbuffer update</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Daniel Vetter (1):
|
||||
<ul>
|
||||
<li>r200: revalidate after radeon_update_renderbuffers</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Dave Airlie (1):
|
||||
<ul>
|
||||
<li>r300g: fixup rs690 tiling stride alignment calculations.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Eric Anholt (13):
|
||||
<ul>
|
||||
<li>intel: Allow CopyTexSubImage to InternalFormat 3/4 textures, like RGB/RGBA.</li>
|
||||
<li>glsl: Free the loop state context when we free the loop state.</li>
|
||||
<li>i965: Allow OPCODE_SWZ to put immediates in the first arg.</li>
|
||||
<li>i965: Add support for rendering to SARGB8 FBOs.</li>
|
||||
<li>glsl: Add a helper constructor for expressions that works out result type.</li>
|
||||
<li>glsl: Fix structure and array comparisions.</li>
|
||||
<li>glsl: Quiet unreachable no-return-from-function warning.</li>
|
||||
<li>glsl: Mark the array access for whole-array comparisons.</li>
|
||||
<li>glsl: Fix flipped return of has_value() for array constants.</li>
|
||||
<li>mesa: Add getters for the rest of the supported draw buffers.</li>
|
||||
<li>mesa: Add getters for ARB_copy_buffer's attachment points.</li>
|
||||
<li>i965: Correct the dp_read message descriptor setup on g4x.</li>
|
||||
<li>glsl: Correct the marking of InputsRead/OutputsWritten on in/out matrices.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Fabian Bieler (1):
|
||||
<ul>
|
||||
<li>glsl: fix lowering conditional returns in subroutines</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Francisco Jerez (3):
|
||||
<ul>
|
||||
<li>meta: Don't leak alpha function/reference value changes.</li>
|
||||
<li>meta: Fix incorrect rendering of the bitmap alpha component.</li>
|
||||
<li>meta: Don't try to disable cube maps if the driver doesn't expose the extension.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Henri Verbeet (2):
|
||||
<ul>
|
||||
<li>r600: Evergreen has two extra frac_bits for the sampler LOD state.</li>
|
||||
<li>st/mesa: Handle wrapped depth buffers in st_copy_texsubimage().</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Ian Romanick (33):
|
||||
<ul>
|
||||
<li>Add 7.9 md5sums</li>
|
||||
<li>docs: Import 7.8.x release notes from 7.8 branch.</li>
|
||||
<li>docs: download.html does not need to be updated for each release</li>
|
||||
<li>docs: Update mailing lines from sf.net to freedesktop.org</li>
|
||||
<li>docs: added news item for 7.9 release</li>
|
||||
<li>mesa: Validate assembly shaders when GLSL shaders are used</li>
|
||||
<li>linker: Reject shaders that have unresolved function calls</li>
|
||||
<li>mesa: Refactor validation of shader targets</li>
|
||||
<li>glsl: Slightly change the semantic of _LinkedShaders</li>
|
||||
<li>linker: Improve handling of unread/unwritten shader inputs/outputs</li>
|
||||
<li>glsl: Commit lexer files changed by previous cherry picking</li>
|
||||
<li>mesa: Make metaops use program refcounts instead of names.</li>
|
||||
<li>glsl: Fix incorrect gl_type of sampler2DArray and sampler1DArrayShadow</li>
|
||||
<li>mesa: Allow query of MAX_SAMPLES with EXT_framebuffer_multisample</li>
|
||||
<li>glsl: better handling of linker failures</li>
|
||||
<li>mesa: Fix glGet of ES2's GL_MAX_*_VECTORS properties.</li>
|
||||
<li>i915: Disallow alpha, red, RG, and sRGB as render targets</li>
|
||||
<li>glsl/linker: Free any IR discarded by optimization passes.</li>
|
||||
<li>glsl: Add an optimization pass to simplify discards.</li>
|
||||
<li>glsl: Add a lowering pass to move discards out of if-statements.</li>
|
||||
<li>i915: Correctly generate unconditional KIL instructions</li>
|
||||
<li>glsl: Add unary ir_expression constructor</li>
|
||||
<li>glsl: Ensure that equality comparisons don't return a NULL IR tree</li>
|
||||
<li>glcpp: Commit changes in generated files cause by previous commit</li>
|
||||
<li>glsl: Inherrit type of declared variable from initializer</li>
|
||||
<li>glsl: Inherrit type of declared variable from initializer after processing assignment</li>
|
||||
<li>linker: Ensure that unsized arrays have a size after linking</li>
|
||||
<li>linker: Fix regressions caused by previous commit</li>
|
||||
<li>linker: Allow built-in arrays to have different sizes between shader stages</li>
|
||||
<li>ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectors</li>
|
||||
<li>Refresh autogenerated file builtin_function.cpp.</li>
|
||||
<li>docs: Initial set of release notes for 7.9.1</li>
|
||||
<li>mesa: set version string to 7.9.1</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Julien Cristau (1):
|
||||
<ul>
|
||||
<li>Makefile: don't include the same files twice in the tarball</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Kenneth Graunke (19):
|
||||
<ul>
|
||||
<li>glcpp: Return NEWLINE token for newlines inside multi-line comments.</li>
|
||||
<li>generate_builtins.py: Output large strings as arrays of characters.</li>
|
||||
<li>glsl: Fix constant component count in vector constructor emitting.</li>
|
||||
<li>ir_dead_functions: Actually free dead functions and signatures.</li>
|
||||
<li>glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version >= 1.30.</li>
|
||||
<li>glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.</li>
|
||||
<li>glsl: Fix constant expression handling for <, >, <=, >= on vectors.</li>
|
||||
<li>glsl: Use do_common_optimization in the standalone compiler.</li>
|
||||
<li>glsl: Don't inline function prototypes.</li>
|
||||
<li>glsl: Add a virtual as_discard() method.</li>
|
||||
<li>glsl: Remove "discard" support from lower_jumps.</li>
|
||||
<li>glsl: Refactor get_num_operands.</li>
|
||||
<li>glcpp: Don't emit SPACE tokens in conditional_tokens production.</li>
|
||||
<li>glsl: Clean up code by adding a new is_break() function.</li>
|
||||
<li>glsl: Consider the "else" branch when looking for loop breaks.</li>
|
||||
<li>Remove OES_compressed_paletted_texture from the ES2 extension list.</li>
|
||||
<li>glsl/builtins: Compute the correct value for smoothstep(vec, vec, vec).</li>
|
||||
<li>Fix build on systems where "python" is python 3.</li>
|
||||
<li>i965: Internally enable GL_NV_blend_square on ES2.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Kristian Høgsberg (1):
|
||||
<ul>
|
||||
<li>i965: Don't write mrf assignment for pointsize output</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Luca Barbieri (1):
|
||||
<ul>
|
||||
<li>glsl: Unroll loops with conditional breaks anywhere (not just the end)</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Marek Olšák (17):
|
||||
<ul>
|
||||
<li>r300g: fix microtiling for 16-bits-per-channel formats</li>
|
||||
<li>r300g: fix texture border for 16-bits-per-channel formats</li>
|
||||
<li>r300g: add a default channel ordering of texture border for unhandled formats</li>
|
||||
<li>r300g: fix texture border color for all texture formats</li>
|
||||
<li>r300g: fix rendering with no vertex elements</li>
|
||||
<li>r300/compiler: fix rc_rewrite_depth_out for it to work with any instruction</li>
|
||||
<li>r300g: fix texture border color once again</li>
|
||||
<li>r300g: fix texture swizzling with compressed textures on r400-r500</li>
|
||||
<li>r300g: disable ARB_texture_swizzle if S3TC is enabled on r3xx-only</li>
|
||||
<li>mesa, st/mesa: fix gl_FragCoord with FBOs in Gallium</li>
|
||||
<li>st/mesa: initialize key in st_vp_varient</li>
|
||||
<li>r300/compiler: fix swizzle lowering with a presubtract source operand</li>
|
||||
<li>r300g: fix rendering with a vertex attrib having a zero stride</li>
|
||||
<li>ir_to_mesa: Add support for conditional discards.</li>
|
||||
<li>r300g: finally fix the texture corruption on r3xx-r4xx</li>
|
||||
<li>mesa: fix texel store functions for some float formats</li>
|
||||
<li>r300/compiler: disable the rename_regs pass for loops</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Mario Kleiner (1):
|
||||
<ul>
|
||||
<li>mesa/r300classic: Fix dri2Invalidate/radeon_prepare_render for page flipping.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Peter Clifton (1):
|
||||
<ul>
|
||||
<li>intel: Fix emit_linear_blit to use DWORD aligned width blits</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Robert Hooker (2):
|
||||
<ul>
|
||||
<li>intel: Add a new B43 pci id.</li>
|
||||
<li>egl_dri2: Add missing intel chip ids.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Roland Scheidegger (1):
|
||||
<ul>
|
||||
<li>r200: fix r200 large points</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Thomas Hellstrom (17):
|
||||
<ul>
|
||||
<li>st/xorg: Don't try to use option values before processing options</li>
|
||||
<li>xorg/vmwgfx: Make vmwarectrl work also on 64-bit servers</li>
|
||||
<li>st/xorg: Add a customizer option to get rid of annoying cursor update flicker</li>
|
||||
<li>xorg/vmwgfx: Don't hide HW cursors when updating them</li>
|
||||
<li>st/xorg: Don't try to remove invalid fbs</li>
|
||||
<li>st/xorg: Fix typo</li>
|
||||
<li>st/xorg, xorg/vmwgfx: Be a bit more frendly towards cross-compiling environments</li>
|
||||
<li>st/xorg: Fix compilation errors for Xservers compiled without Composite</li>
|
||||
<li>st/xorg: Don't use deprecated x*alloc / xfree functions</li>
|
||||
<li>xorg/vmwgfx: Don't use deprecated x*alloc / xfree functions</li>
|
||||
<li>st/xorg: Fix compilation for Xservers >= 1.10</li>
|
||||
<li>mesa: Make sure we have the talloc cflags when using the talloc headers</li>
|
||||
<li>egl: Add an include for size_t</li>
|
||||
<li>mesa: Add talloc includes for gles</li>
|
||||
<li>st/egl: Fix build for include files in nonstandard places</li>
|
||||
<li>svga/drm: Optionally resolve calls to powf during link-time</li>
|
||||
<li>gallium/targets: Trivial crosscompiling fix</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Tom Stellard (7):
|
||||
<ul>
|
||||
<li>r300/compiler: Make sure presubtract sources use supported swizzles</li>
|
||||
<li>r300/compiler: Fix register allocator's handling of loops</li>
|
||||
<li>r300/compiler: Fix instruction scheduling within IF blocks</li>
|
||||
<li>r300/compiler: Use zero as the register index for unused sources</li>
|
||||
<li>r300/compiler: Ignore alpha dest register when replicating the result</li>
|
||||
<li>r300/compiler: Use correct swizzles for all presubtract sources</li>
|
||||
<li>r300/compiler: Don't allow presubtract sources to be remapped twice</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Vinson Lee (1):
|
||||
<ul>
|
||||
<li>glsl: Fix 'control reaches end of non-void function' warning.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>richard (1):
|
||||
<ul>
|
||||
<li>r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well.</li>
|
||||
</ul></p>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -8,7 +8,7 @@
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.9 Release Notes / date TBD</H1>
|
||||
<H1>Mesa 7.9 Release Notes / October 4, 2010</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.9 is a new development release.
|
||||
@@ -28,12 +28,12 @@ for DRI hardware acceleration.
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
f1f01a7baec255f13e9468fb4b05922a MesaLib-7.9-rc1.tar.gz
|
||||
7ffbda3b7056c60b8f87e3082d853af1 MesaLib-7.9-rc1.tar.bz2
|
||||
9d4650df4e5b530178d6fde840f76664 MesaLib-7.9-rc1.zip
|
||||
a81c2e7a0c7832e67c768d6f209f2c8f MesaGLUT-7.9-rc1.tar.gz
|
||||
b4c1c2f0b47a07be10fa2dd42e6a63d7 MesaGLUT-7.9-rc1.tar.bz2
|
||||
c9dd7419a19bcb24a1fe556ec2e78451 MesaGLUT-7.9-rc1.zip
|
||||
ed65ab425b25895c7f473d0a5e6e64f8 MesaLib-7.9.tar.gz
|
||||
82c740c49d572baa6da2b1a1eee90bca MesaLib-7.9.tar.bz2
|
||||
cd2b6ecec759b0457475e94bbb38fedb MesaLib-7.9.zip
|
||||
7b54af9fb9b1f6a1a65db2520f50848f MesaGLUT-7.9.tar.gz
|
||||
20d07419d1929f833fdb36bced290ad5 MesaGLUT-7.9.tar.bz2
|
||||
62a7edecd7c92675cd6029b05217eb0a MesaGLUT-7.9.zip
|
||||
</pre>
|
||||
|
||||
|
||||
@@ -42,16 +42,85 @@ c9dd7419a19bcb24a1fe556ec2e78451 MesaGLUT-7.9-rc1.zip
|
||||
<li>New, improved GLSL compiler written by Intel.
|
||||
See the <a href="shading.html"> Shading Language</a> page for
|
||||
more information.
|
||||
<li>GL_EXT_timer_query extension (i965 driver only)
|
||||
<li>New, very experimental Gallium driver for R600-R700 Radeons.
|
||||
<li>Support for AMD Evergreen-based Radeons (HD 5xxx)
|
||||
<li>GL_EXT_timer_query extension (i965 driver and softpipe only)
|
||||
<li>GL_EXT_framebuffer_multisample extension (intel drivers, MAX_SAMPLES = 1)
|
||||
<li>GL_ARB_texture_swizzle extension (alias of GL_EXT_texture_swizzle)
|
||||
<li>GL_ARB_draw_elements_base_vertex, GL_ARB_fragment_program_shadow
|
||||
and GL_EXT_draw_buffers2 in Gallium drivers
|
||||
<li>GL_ARB_draw_elements_base_vertex, GL_ARB_fragment_program_shadow,
|
||||
GL_ARB_window_pos, GL_EXT_gpu_program_parameters,
|
||||
GL_ATI_texture_env_combine3, GL_MESA_pack_invert, and GL_OES_EGL_image
|
||||
extensions in Gallium drivers
|
||||
<li>GL_ARB_depth_clamp and GL_NV_depth_clamp extensions (in nv50 and r600
|
||||
Gallium drivers)
|
||||
<li>GL_ARB_half_float_vertex extension (in nvfx, r300, r600, softpipe,
|
||||
and llvmpipe Gallium drivers)
|
||||
<li>GL_EXT_draw_buffers2 (in nv50, r600, softpipe, and llvmpipe Gallium
|
||||
drivers)
|
||||
<li>GL_EXT_texture_swizzle (in nvfx, r300, r600, softpipe, and llvmpipe
|
||||
Gallium drivers)
|
||||
<li>GL_ATI_texture_mirror_once (in nvfx, nv50, r300, r600, softpipe, and
|
||||
llvmpipe Gallium drivers)
|
||||
<li>GL_NV_conditional_render (in r300 Gallium driver)
|
||||
<li>Initial "signs of life" support for Sandybridge hardware in i965 DRI
|
||||
driver.
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<p>This list is likely incomplete.</p>
|
||||
<ul>
|
||||
<li>Massive improvements to the Gallium driver for R300-R500 Radeons; this
|
||||
driver is now considered stable for use as a DRI (OpenGL) driver.
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=10908">Bug 10908</a> - GLSL: gl_FogParamaters gl_Fog built-in uniform not functioning</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=13753">Bug 13753</a> - Numerous bugs in GLSL uniform handling</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=16854">Bug 16854</a> - GLSL function call at global scope causes SEGV</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=16856">Bug 16856</a> - GLSL indexing of unsized array results in assertion failure</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=18659">Bug 18659</a> - Crash in shader/slang/slang_codegen.c _slang_gen_function_call_name()</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=19089">Bug 19089</a> - [GLSL] glsl1/shadow2D() cases fail</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=22622">Bug 22622</a> - [GM965 GLSL] noise*() cause GPU lockup</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=23743">Bug 23743</a> - For loop from 0 to 0 not optimized out</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=24553">Bug 24553</a> - shader compilation times explode when using more () pairs</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25664">Bug 25664</a> - [GLSL] re-declaring an empty array fails to compile</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25769">Bug 25769</a> - [GLSL] "float" can be implicitly converted to "int"</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25808">Bug 25808</a> - [GLSL] const variable is modified successfully</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25826">Bug 25826</a> - [GLSL] declaring an unsized array then re-declaring with a size fails</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25827">Bug 25827</a> - [GLSL] vector constructor accepts too many arguments successfully</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25829">Bug 25829</a> - [GLSL] allowing non-void function without returning value</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25830">Bug 25830</a> - [GLSL] allowing non-constant-expression as const declaration initializer</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25877">Bug 25877</a> - [GLSL 1.10] implicit conversion from "int" to "float" should not be allowed</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25878">Bug 25878</a> - [GLSL] sampler is converted to int successfully</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25994">Bug 25994</a> - [GM45][GLSL] 'return' statement in vertex shader unsupported</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25999">Bug 25999</a> - [GLSL] embedded structure constructor fails to compile</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26000">Bug 26000</a> - [GLSL] allowing different parameter qualifier between the function definition and declaration</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26001">Bug 26001</a> - [GLSL 1.10] constructing matrix from matrix succeeds</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26224">Bug 26224</a> - [GLSL] Cannot get location of a uniform struct member</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26990">Bug 26990</a> - [GLSL] variable declaration in "while" fails to compile</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27004">Bug 27004</a> - [GLSL] allowing macro redefinition</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27060">Bug 27060</a> - [965] piglit glsl-fs-raytrace failure due to lack of function calls.</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27216">Bug 27216</a> - Assignment with a function call in an if statement causes an assertion failure</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27261">Bug 27261</a> - GLSL Compiler fails on the following vertex shader</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27265">Bug 27265</a> - GLSL Compiler doesnt link the attached vertex shader</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27388">Bug 27388</a> - [i965] piglit glsl-vs-arrays failure</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27403">Bug 27403</a> - GLSL struct causing "Invalid src register file ..." error</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27914">Bug 27914</a> - GLSL compiler uses MUL+ADD where it could use MAD</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28055">Bug 28055</a> - glsl-texcoord-array fails GLSL compilation</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28374">Bug 28374</a> - SIGSEGV shader/slang/slang_typeinfo.c:534</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28748">Bug 28748</a> - [i965] uninlined function calls support</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28833">Bug 28833</a> - piglit/shaders/glsl-texcoord-array fail</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28834">Bug 28834</a> - Add support for system fpclassify to GL_OES_query_matrix function for OpenBSD / NetBSD</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28837">Bug 28837</a> - varying vec4 index support</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28845">Bug 28845</a> - The GLU tesselator code has some warnings</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28889">Bug 28889</a> - [regression] wine game crash</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28894">Bug 28894</a> - slang build fails if absolute path contains spaces</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28913">Bug 28913</a> - [GLSL] allowing two version statements</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28931">Bug 28931</a> - Floating Point Exception in Warzone2100 Trunk version</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28966">Bug 28966</a> - [r300g] Dynamic branching 3 demo does not run</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28967">Bug 28967</a> - slang/slang_emit.c:350: storage_to_src_reg: Assertion `index >= 0' failed.</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29013">Bug 29013</a> - [r300g] translate_rgb_op: unknown opcode ILLEGAL OPCODE</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29020">Bug 29020</a> - [r300g] Wine d3d9 tests hardlock</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29910">Bug 29910</a> - Mesa advertises bogus GL_ARB_shading_language_120</li>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30196">Bug 30196</a> - [GLSL] gl_TextureMatrix{Inverse,Transpose,InverseTranspose} unsupported</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
@@ -14,6 +14,7 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="relnotes-7.9.html">7.9 release notes</A>
|
||||
<LI><A HREF="relnotes-7.8.3.html">7.8.3 release notes</A>
|
||||
<LI><A HREF="relnotes-7.8.2.html">7.8.2 release notes</A>
|
||||
<LI><A HREF="relnotes-7.8.1.html">7.8.1 release notes</A>
|
||||
<LI><A HREF="relnotes-7.8.html">7.8 release notes</A>
|
||||
|
@@ -741,7 +741,7 @@ dri2_create_screen(_EGLDisplay *disp)
|
||||
if (dri2_dpy->dri2->base.version >= 2)
|
||||
api_mask = dri2_dpy->dri2->getAPIMask(dri2_dpy->dri_screen);
|
||||
else
|
||||
api_mask = __DRI_API_OPENGL;
|
||||
api_mask = 1 << __DRI_API_OPENGL;
|
||||
|
||||
disp->ClientAPIsMask = 0;
|
||||
if (api_mask & (1 <<__DRI_API_OPENGL))
|
||||
@@ -888,10 +888,20 @@ const int i915_chip_ids[] = {
|
||||
0x29b2, /* PCI_CHIP_Q35_G */
|
||||
0x29c2, /* PCI_CHIP_G33_G */
|
||||
0x29d2, /* PCI_CHIP_Q33_G */
|
||||
0xa001, /* PCI_CHIP_IGD_G */
|
||||
0xa011, /* Pineview */
|
||||
};
|
||||
|
||||
const int i965_chip_ids[] = {
|
||||
0x0042, /* PCI_CHIP_ILD_G */
|
||||
0x0046, /* PCI_CHIP_ILM_G */
|
||||
0x0102, /* PCI_CHIP_SANDYBRIDGE_GT1 */
|
||||
0x0106, /* PCI_CHIP_SANDYBRIDGE_M_GT1 */
|
||||
0x010a, /* PCI_CHIP_SANDYBRIDGE_S */
|
||||
0x0112, /* PCI_CHIP_SANDYBRIDGE_GT2 */
|
||||
0x0116, /* PCI_CHIP_SANDYBRIDGE_M_GT2 */
|
||||
0x0122, /* PCI_CHIP_SANDYBRIDGE_GT2_PLUS */
|
||||
0x0126, /* PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS */
|
||||
0x29a2, /* PCI_CHIP_I965_G */
|
||||
0x2992, /* PCI_CHIP_I965_Q */
|
||||
0x2982, /* PCI_CHIP_I965_G_1 */
|
||||
@@ -903,6 +913,8 @@ const int i965_chip_ids[] = {
|
||||
0x2e12, /* PCI_CHIP_Q45_G */
|
||||
0x2e22, /* PCI_CHIP_G45_G */
|
||||
0x2e32, /* PCI_CHIP_G41_G */
|
||||
0x2e42, /* PCI_CHIP_B43_G */
|
||||
0x2e92, /* PCI_CHIP_B43_G1 */
|
||||
};
|
||||
|
||||
const struct dri2_driver_map driver_map[] = {
|
||||
|
@@ -142,7 +142,6 @@ static const struct {
|
||||
{ GLX_STENCIL_SIZE, EGL_STENCIL_SIZE },
|
||||
{ GLX_SAMPLE_BUFFERS, EGL_SAMPLE_BUFFERS },
|
||||
{ GLX_SAMPLES, EGL_SAMPLES },
|
||||
{ GLX_RENDER_TYPE, EGL_RENDERABLE_TYPE },
|
||||
{ GLX_X_RENDERABLE, EGL_NATIVE_RENDERABLE },
|
||||
{ GLX_X_VISUAL_TYPE, EGL_NATIVE_VISUAL_TYPE },
|
||||
{ GLX_CONFIG_CAVEAT, EGL_CONFIG_CAVEAT },
|
||||
@@ -218,6 +217,16 @@ convert_fbconfig(Display *dpy, GLXFBConfig fbconfig,
|
||||
|
||||
_eglSetConfigKey(&GLX_conf->Base, EGL_SURFACE_TYPE, surface_type);
|
||||
|
||||
_eglSetConfigKey(&GLX_conf->Base, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT);
|
||||
|
||||
glXGetFBConfigAttrib(dpy, fbconfig, GLX_TRANSPARENT_TYPE, &val);
|
||||
if (val == GLX_NONE) {
|
||||
_eglSetConfigKey(&GLX_conf->Base, EGL_TRANSPARENT_TYPE, EGL_NONE);
|
||||
_eglSetConfigKey(&GLX_conf->Base, EGL_TRANSPARENT_RED_VALUE, 0);
|
||||
_eglSetConfigKey(&GLX_conf->Base, EGL_TRANSPARENT_GREEN_VALUE, 0);
|
||||
_eglSetConfigKey(&GLX_conf->Base, EGL_TRANSPARENT_BLUE_VALUE, 0);
|
||||
}
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
@@ -294,6 +303,7 @@ convert_visual(Display *dpy, XVisualInfo *vinfo,
|
||||
surface_type |= EGL_PIXMAP_BIT;
|
||||
|
||||
_eglSetConfigKey(&GLX_conf->Base, EGL_SURFACE_TYPE, surface_type);
|
||||
_eglSetConfigKey(&GLX_conf->Base, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT);
|
||||
|
||||
_eglSetConfigKey(&GLX_conf->Base, EGL_NATIVE_RENDERABLE, EGL_TRUE);
|
||||
|
||||
|
@@ -402,10 +402,15 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list,
|
||||
_EGLContext *context;
|
||||
EGLContext ret;
|
||||
|
||||
if (config)
|
||||
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_CONTEXT, drv);
|
||||
else
|
||||
_EGL_CHECK_DISPLAY(disp, EGL_NO_CONTEXT, drv);
|
||||
_EGL_CHECK_DISPLAY(disp, EGL_NO_CONTEXT, drv);
|
||||
|
||||
if (!config) {
|
||||
/* config may be NULL if surfaceless */
|
||||
if (!disp->Extensions.KHR_surfaceless_gles1 &&
|
||||
!disp->Extensions.KHR_surfaceless_gles2 &&
|
||||
!disp->Extensions.KHR_surfaceless_opengl)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_CONFIG, EGL_NO_CONTEXT);
|
||||
}
|
||||
|
||||
if (!share && share_list != EGL_NO_CONTEXT)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_CONTEXT);
|
||||
@@ -459,9 +464,19 @@ eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read,
|
||||
|
||||
if (!context && ctx != EGL_NO_CONTEXT)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE);
|
||||
if ((!draw_surf && draw != EGL_NO_SURFACE) ||
|
||||
(!read_surf && read != EGL_NO_SURFACE))
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
|
||||
if (!draw_surf || !read_surf) {
|
||||
/* surfaces may be NULL if surfaceless */
|
||||
if (!disp->Extensions.KHR_surfaceless_gles1 &&
|
||||
!disp->Extensions.KHR_surfaceless_gles2 &&
|
||||
!disp->Extensions.KHR_surfaceless_opengl)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
|
||||
|
||||
if ((!draw_surf && draw != EGL_NO_SURFACE) ||
|
||||
(!read_surf && read != EGL_NO_SURFACE))
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
|
||||
if (draw_surf || read_surf)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_FALSE);
|
||||
}
|
||||
|
||||
ret = drv->API.MakeCurrent(drv, disp, draw_surf, read_surf, context);
|
||||
|
||||
@@ -1276,6 +1291,8 @@ eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
|
||||
EGLImageKHR ret;
|
||||
|
||||
_EGL_CHECK_DISPLAY(disp, EGL_NO_IMAGE_KHR, drv);
|
||||
if (!disp->Extensions.KHR_image_base)
|
||||
RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR);
|
||||
if (!context && ctx != EGL_NO_CONTEXT)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_IMAGE_KHR);
|
||||
|
||||
@@ -1296,6 +1313,8 @@ eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
|
||||
EGLBoolean ret;
|
||||
|
||||
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
|
||||
if (!disp->Extensions.KHR_image_base)
|
||||
RETURN_EGL_EVAL(disp, EGL_FALSE);
|
||||
if (!img)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
|
||||
|
||||
@@ -1321,6 +1340,8 @@ eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
|
||||
EGLSyncKHR ret;
|
||||
|
||||
_EGL_CHECK_DISPLAY(disp, EGL_NO_SYNC_KHR, drv);
|
||||
if (!disp->Extensions.KHR_reusable_sync)
|
||||
RETURN_EGL_EVAL(disp, EGL_NO_SYNC_KHR);
|
||||
|
||||
sync = drv->API.CreateSyncKHR(drv, disp, type, attrib_list);
|
||||
ret = (sync) ? _eglLinkSync(sync, disp) : EGL_NO_SYNC_KHR;
|
||||
@@ -1338,6 +1359,8 @@ eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
|
||||
EGLBoolean ret;
|
||||
|
||||
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
|
||||
assert(disp->Extensions.KHR_reusable_sync);
|
||||
|
||||
_eglUnlinkSync(s);
|
||||
ret = drv->API.DestroySyncKHR(drv, disp, s);
|
||||
|
||||
@@ -1354,6 +1377,7 @@ eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR t
|
||||
EGLint ret;
|
||||
|
||||
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
|
||||
assert(disp->Extensions.KHR_reusable_sync);
|
||||
ret = drv->API.ClientWaitSyncKHR(drv, disp, s, flags, timeout);
|
||||
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
@@ -1369,6 +1393,7 @@ eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode)
|
||||
EGLBoolean ret;
|
||||
|
||||
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
|
||||
assert(disp->Extensions.KHR_reusable_sync);
|
||||
ret = drv->API.SignalSyncKHR(drv, disp, s, mode);
|
||||
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
@@ -1384,6 +1409,7 @@ eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *v
|
||||
EGLBoolean ret;
|
||||
|
||||
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
|
||||
assert(disp->Extensions.KHR_reusable_sync);
|
||||
ret = drv->API.GetSyncAttribKHR(drv, disp, s, attribute, value);
|
||||
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
@@ -1407,14 +1433,14 @@ eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface,
|
||||
|
||||
_EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
|
||||
|
||||
if (!disp->Extensions.NOK_swap_region)
|
||||
RETURN_EGL_EVAL(disp, EGL_FALSE);
|
||||
|
||||
/* surface must be bound to current context in EGL 1.4 */
|
||||
if (!ctx || !_eglIsContextLinked(ctx) || surf != ctx->DrawSurface)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
|
||||
|
||||
if (drv->API.SwapBuffersRegionNOK)
|
||||
ret = drv->API.SwapBuffersRegionNOK(drv, disp, surf, numRects, rects);
|
||||
else
|
||||
ret = drv->API.SwapBuffers(drv, disp, surf);
|
||||
ret = drv->API.SwapBuffersRegionNOK(drv, disp, surf, numRects, rects);
|
||||
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
}
|
||||
@@ -1433,6 +1459,8 @@ eglCreateDRMImageMESA(EGLDisplay dpy, const EGLint *attr_list)
|
||||
EGLImageKHR ret;
|
||||
|
||||
_EGL_CHECK_DISPLAY(disp, EGL_NO_IMAGE_KHR, drv);
|
||||
if (!disp->Extensions.MESA_drm_image)
|
||||
RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR);
|
||||
|
||||
img = drv->API.CreateDRMImageMESA(drv, disp, attr_list);
|
||||
ret = (img) ? _eglLinkImage(img, disp) : EGL_NO_IMAGE_KHR;
|
||||
@@ -1450,6 +1478,8 @@ eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image,
|
||||
EGLBoolean ret;
|
||||
|
||||
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
|
||||
assert(disp->Extensions.MESA_drm_image);
|
||||
|
||||
if (!img)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
|
||||
|
||||
|
@@ -272,10 +272,6 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
|
||||
if (!surfaceless && (draw == NULL || read == NULL))
|
||||
return _eglError(EGL_BAD_MATCH, "eglMakeCurrent");
|
||||
|
||||
/* context stealing from another thread is not allowed */
|
||||
if (ctx->Binding && ctx->Binding != t)
|
||||
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
|
||||
|
||||
/*
|
||||
* The spec says
|
||||
*
|
||||
@@ -283,16 +279,23 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
|
||||
* bound to contexts in another thread, an EGL_BAD_ACCESS error is
|
||||
* generated."
|
||||
*
|
||||
* But it also says
|
||||
* and
|
||||
*
|
||||
* "at most one context may be bound to a particular surface at a given
|
||||
* time"
|
||||
*
|
||||
* The latter is more restrictive so we can check only the latter case.
|
||||
*/
|
||||
if ((draw && draw->CurrentContext && draw->CurrentContext != ctx) ||
|
||||
(read && read->CurrentContext && read->CurrentContext != ctx))
|
||||
if (ctx->Binding && ctx->Binding != t)
|
||||
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
|
||||
if (draw && draw->CurrentContext && draw->CurrentContext != ctx) {
|
||||
if (draw->CurrentContext->Binding != t ||
|
||||
draw->CurrentContext->ClientAPI != ctx->ClientAPI)
|
||||
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
|
||||
}
|
||||
if (read && read->CurrentContext && read->CurrentContext != ctx) {
|
||||
if (read->CurrentContext->Binding != t ||
|
||||
read->CurrentContext->ClientAPI != ctx->ClientAPI)
|
||||
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
|
||||
}
|
||||
|
||||
/* simply require the configs to be equal */
|
||||
if ((draw && draw->Config != ctx->Config) ||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "egltypedefs.h"
|
||||
#include "eglapi.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/**
|
||||
* Define an inline driver typecast function.
|
||||
|
@@ -206,16 +206,16 @@ include ../Makefile.template
|
||||
|
||||
|
||||
indices/u_indices_gen.c: indices/u_indices_gen.py
|
||||
python $< > $@
|
||||
$(PYTHON2) $< > $@
|
||||
|
||||
indices/u_unfilled_gen.c: indices/u_unfilled_gen.py
|
||||
python $< > $@
|
||||
$(PYTHON2) $< > $@
|
||||
|
||||
util/u_format_srgb.c: util/u_format_srgb.py
|
||||
python $< > $@
|
||||
$(PYTHON2) $< > $@
|
||||
|
||||
util/u_format_table.c: util/u_format_table.py util/u_format_pack.py util/u_format_parse.py util/u_format.csv
|
||||
python util/u_format_table.py util/u_format.csv > $@
|
||||
$(PYTHON2) util/u_format_table.py util/u_format.csv > $@
|
||||
|
||||
util/u_half.c: util/u_half.py
|
||||
python util/u_half.py > $@
|
||||
$(PYTHON2) util/u_half.py > $@
|
||||
|
@@ -605,8 +605,10 @@ tgsi_check_soa_dependencies(const struct tgsi_full_instruction *inst)
|
||||
for (i = 0; i < inst->Instruction.NumSrcRegs; i++) {
|
||||
if ((inst->Src[i].Register.File ==
|
||||
inst->Dst[0].Register.File) &&
|
||||
(inst->Src[i].Register.Index ==
|
||||
inst->Dst[0].Register.Index)) {
|
||||
((inst->Src[i].Register.Index ==
|
||||
inst->Dst[0].Register.Index) ||
|
||||
inst->Src[i].Register.Indirect ||
|
||||
inst->Dst[0].Register.Indirect)) {
|
||||
/* loop over dest channels */
|
||||
uint channelsWritten = 0x0;
|
||||
FOR_EACH_ENABLED_CHANNEL(*inst, chan) {
|
||||
|
@@ -2830,31 +2830,52 @@ static void soa_to_aos( struct x86_function *func,
|
||||
* Check if the instructions dst register is the same as any src
|
||||
* register and warn if there's a posible SOA dependency.
|
||||
*/
|
||||
static void
|
||||
static boolean
|
||||
check_soa_dependencies(const struct tgsi_full_instruction *inst)
|
||||
{
|
||||
switch (inst->Instruction.Opcode) {
|
||||
uint opcode = inst->Instruction.Opcode;
|
||||
|
||||
/* XXX: we only handle src/dst aliasing in a few opcodes currently.
|
||||
* Need to use an additional temporay to hold the result in the
|
||||
* cases where the code is too opaque to fix.
|
||||
*/
|
||||
|
||||
switch (opcode) {
|
||||
case TGSI_OPCODE_ADD:
|
||||
case TGSI_OPCODE_MOV:
|
||||
case TGSI_OPCODE_MUL:
|
||||
case TGSI_OPCODE_RCP:
|
||||
case TGSI_OPCODE_RSQ:
|
||||
case TGSI_OPCODE_EXP:
|
||||
case TGSI_OPCODE_LOG:
|
||||
case TGSI_OPCODE_DP3:
|
||||
case TGSI_OPCODE_DP4:
|
||||
case TGSI_OPCODE_DP2A:
|
||||
case TGSI_OPCODE_EX2:
|
||||
case TGSI_OPCODE_LG2:
|
||||
case TGSI_OPCODE_POW:
|
||||
case TGSI_OPCODE_XPD:
|
||||
case TGSI_OPCODE_DPH:
|
||||
case TGSI_OPCODE_COS:
|
||||
case TGSI_OPCODE_SIN:
|
||||
case TGSI_OPCODE_TEX:
|
||||
case TGSI_OPCODE_TXB:
|
||||
case TGSI_OPCODE_TXP:
|
||||
case TGSI_OPCODE_NRM:
|
||||
case TGSI_OPCODE_NRM4:
|
||||
case TGSI_OPCODE_DP2:
|
||||
/* OK - these opcodes correctly handle SOA dependencies */
|
||||
break;
|
||||
return TRUE;
|
||||
default:
|
||||
if (tgsi_check_soa_dependencies(inst)) {
|
||||
uint opcode = inst->Instruction.Opcode;
|
||||
if (!tgsi_check_soa_dependencies(inst))
|
||||
return TRUE;
|
||||
|
||||
/* XXX: we only handle src/dst aliasing in a few opcodes
|
||||
* currently. Need to use an additional temporay to hold
|
||||
* the result in the cases where the code is too opaque to
|
||||
* fix.
|
||||
*/
|
||||
if (opcode != TGSI_OPCODE_MOV) {
|
||||
debug_printf("Warning: src/dst aliasing in instruction"
|
||||
" is not handled:\n");
|
||||
tgsi_dump_instruction(inst, 1);
|
||||
}
|
||||
}
|
||||
debug_printf("Warning: src/dst aliasing in instruction"
|
||||
" is not handled:\n");
|
||||
debug_printf("Warning: ");
|
||||
tgsi_dump_instruction(inst, 1);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2954,7 +2975,8 @@ tgsi_emit_sse2(
|
||||
tgsi_get_processor_name(proc));
|
||||
}
|
||||
|
||||
check_soa_dependencies(&parse.FullToken.FullInstruction);
|
||||
if (ok)
|
||||
ok = check_soa_dependencies(&parse.FullToken.FullInstruction);
|
||||
break;
|
||||
|
||||
case TGSI_TOKEN_TYPE_IMMEDIATE:
|
||||
|
@@ -29,6 +29,8 @@
|
||||
#define PIPE_ATOMIC_ASM_MSVC_X86
|
||||
#elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86))
|
||||
#define PIPE_ATOMIC_ASM_GCC_X86
|
||||
#elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86_64))
|
||||
#define PIPE_ATOMIC_ASM_GCC_X86_64
|
||||
#elif defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION >= 401)
|
||||
#define PIPE_ATOMIC_GCC_INTRINSIC
|
||||
#else
|
||||
@@ -36,6 +38,51 @@
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(PIPE_ATOMIC_ASM_GCC_X86_64)
|
||||
#define PIPE_ATOMIC "GCC x86_64 assembly"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define p_atomic_set(_v, _i) (*(_v) = (_i))
|
||||
#define p_atomic_read(_v) (*(_v))
|
||||
|
||||
static INLINE boolean
|
||||
p_atomic_dec_zero(int32_t *v)
|
||||
{
|
||||
unsigned char c;
|
||||
|
||||
__asm__ __volatile__("lock; decl %0; sete %1":"+m"(*v), "=qm"(c)
|
||||
::"memory");
|
||||
|
||||
return c != 0;
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
p_atomic_inc(int32_t *v)
|
||||
{
|
||||
__asm__ __volatile__("lock; incl %0":"+m"(*v));
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
p_atomic_dec(int32_t *v)
|
||||
{
|
||||
__asm__ __volatile__("lock; decl %0":"+m"(*v));
|
||||
}
|
||||
|
||||
static INLINE int32_t
|
||||
p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
|
||||
{
|
||||
return __sync_val_compare_and_swap(v, old, _new);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PIPE_ATOMIC_ASM_GCC_X86_64 */
|
||||
|
||||
|
||||
#if defined(PIPE_ATOMIC_ASM_GCC_X86)
|
||||
|
||||
|
@@ -70,7 +70,7 @@ PROGS_DEPS := ../../auxiliary/libgallium.a
|
||||
include ../../Makefile.template
|
||||
|
||||
lp_tile_soa.c: lp_tile_soa.py ../../auxiliary/util/u_format_parse.py ../../auxiliary/util/u_format_pack.py ../../auxiliary/util/u_format.csv
|
||||
python lp_tile_soa.py ../../auxiliary/util/u_format.csv > $@
|
||||
$(PYTHON2) $(PYTHON_FLAGS) lp_tile_soa.py ../../auxiliary/util/u_format.csv > $@
|
||||
|
||||
LDFLAGS += $(LLVM_LDFLAGS)
|
||||
LIBS += -L../../auxiliary/ -lgallium libllvmpipe.a $(LLVM_LIBS) $(GL_LIB_DEPS)
|
||||
|
@@ -262,7 +262,7 @@ lp_build_stencil_op_single(struct lp_build_context *bld,
|
||||
LLVMValueRef writemask = lp_build_const_int_vec(type, stencil->writemask);
|
||||
mask = LLVMBuildAnd(bld->builder, mask, writemask, "");
|
||||
/* res = (res & mask) | (stencilVals & ~mask) */
|
||||
res = lp_build_select_bitwise(bld, writemask, res, stencilVals);
|
||||
res = lp_build_select_bitwise(bld, mask, res, stencilVals);
|
||||
}
|
||||
else {
|
||||
/* res = mask ? res : stencilVals */
|
||||
|
@@ -424,4 +424,5 @@ void r300_parse_chipset(struct r300_capabilities* caps)
|
||||
}
|
||||
|
||||
caps->is_rv350 = caps->family >= CHIP_FAMILY_RV350;
|
||||
caps->dxtc_swizzle = caps->is_r400 || caps->is_r500;
|
||||
}
|
||||
|
@@ -79,6 +79,8 @@ struct r300_capabilities {
|
||||
boolean is_r500;
|
||||
/* Whether or not the second pixel pipe is accessed with the high bit */
|
||||
boolean high_second_pipe;
|
||||
/* DXTC texture swizzling. */
|
||||
boolean dxtc_swizzle;
|
||||
};
|
||||
|
||||
/* Enumerations for legibility and telling which card we're running on. */
|
||||
|
@@ -79,6 +79,9 @@ static void r300_release_referenced_objects(struct r300_context *r300)
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* The dummy VBO. */
|
||||
pipe_resource_reference(&r300->dummy_vb, NULL);
|
||||
|
||||
/* The SWTCL VBO. */
|
||||
pipe_resource_reference(&r300->vbo, NULL);
|
||||
|
||||
@@ -488,6 +491,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
|
||||
rtempl.target = PIPE_TEXTURE_2D;
|
||||
rtempl.format = PIPE_FORMAT_I8_UNORM;
|
||||
rtempl.bind = PIPE_BIND_SAMPLER_VIEW;
|
||||
rtempl.usage = PIPE_USAGE_IMMUTABLE;
|
||||
rtempl.width0 = 1;
|
||||
rtempl.height0 = 1;
|
||||
rtempl.depth0 = 1;
|
||||
@@ -501,6 +505,19 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
|
||||
pipe_resource_reference(&tex, NULL);
|
||||
}
|
||||
|
||||
{
|
||||
struct pipe_resource vb = {};
|
||||
vb.target = PIPE_BUFFER;
|
||||
vb.format = PIPE_FORMAT_R8_UNORM;
|
||||
vb.bind = PIPE_BIND_VERTEX_BUFFER;
|
||||
vb.usage = PIPE_USAGE_IMMUTABLE;
|
||||
vb.width0 = sizeof(float) * 16;
|
||||
vb.height0 = 1;
|
||||
vb.depth0 = 1;
|
||||
|
||||
r300->dummy_vb = screen->resource_create(screen, &vb);
|
||||
}
|
||||
|
||||
return &r300->context;
|
||||
|
||||
fail:
|
||||
|
@@ -470,6 +470,10 @@ struct r300_context {
|
||||
* dummy texture there. */
|
||||
struct r300_sampler_view *texkill_sampler;
|
||||
|
||||
/* When no vertex buffer is set, this one is used instead to prevent
|
||||
* hardlocks. */
|
||||
struct pipe_resource *dummy_vb;
|
||||
|
||||
/* The currently active query. */
|
||||
struct r300_query *query_current;
|
||||
/* The saved query for blitter operations. */
|
||||
|
@@ -158,7 +158,7 @@ static void r300_render_condition(struct pipe_context *pipe,
|
||||
uint mode)
|
||||
{
|
||||
struct r300_context *r300 = r300_context(pipe);
|
||||
uint64_t result;
|
||||
uint64_t result = 0;
|
||||
boolean wait;
|
||||
|
||||
if (query) {
|
||||
@@ -167,9 +167,9 @@ static void r300_render_condition(struct pipe_context *pipe,
|
||||
|
||||
if (!r300_get_query_result(pipe, query, wait, &result)) {
|
||||
r300->skip_rendering = FALSE;
|
||||
} else {
|
||||
r300->skip_rendering = result == 0;
|
||||
}
|
||||
|
||||
r300->skip_rendering = result == 0;
|
||||
} else {
|
||||
r300->skip_rendering = FALSE;
|
||||
}
|
||||
|
@@ -1520,11 +1520,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
# define R300_TX_TRI_PERF_3_8 (3<<15)
|
||||
# define R300_ANISO_THRESHOLD_MASK (7<<17)
|
||||
|
||||
# define R400_DXTC_SWIZZLE_ENABLE (1<<21)
|
||||
# define R500_MACRO_SWITCH (1<<22)
|
||||
# define R500_TX_MAX_ANISO(x) ((x) << 23)
|
||||
# define R500_TX_MAX_ANISO_MASK (63 << 23)
|
||||
# define R500_TX_ANISO_HIGH_QUALITY (1 << 30)
|
||||
|
||||
# define R500_BORDER_FIX (1<<31)
|
||||
|
||||
#define R300_TX_FORMAT0_0 0x4480
|
||||
|
@@ -676,9 +676,6 @@ static void r300_draw_vbo(struct pipe_context* pipe,
|
||||
{
|
||||
struct r300_context* r300 = r300_context(pipe);
|
||||
|
||||
if (!r300->velems->count || !r300->vertex_buffer_count)
|
||||
return;
|
||||
|
||||
if (info->indexed && r300->index_buffer.buffer) {
|
||||
unsigned offset;
|
||||
|
||||
|
@@ -114,8 +114,9 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
|
||||
case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
|
||||
case PIPE_CAP_BLEND_EQUATION_SEPARATE:
|
||||
case PIPE_CAP_TEXTURE_SWIZZLE:
|
||||
return 1;
|
||||
case PIPE_CAP_TEXTURE_SWIZZLE:
|
||||
return util_format_s3tc_enabled ? r300screen->caps.dxtc_swizzle : 1;
|
||||
|
||||
/* Unsupported features (boolean caps). */
|
||||
case PIPE_CAP_TIMER_QUERY:
|
||||
|
@@ -1313,29 +1313,27 @@ static void r300_set_fragment_sampler_views(struct pipe_context* pipe,
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
if (&state->sampler_views[i]->base != views[i]) {
|
||||
pipe_sampler_view_reference(
|
||||
(struct pipe_sampler_view**)&state->sampler_views[i],
|
||||
views[i]);
|
||||
pipe_sampler_view_reference(
|
||||
(struct pipe_sampler_view**)&state->sampler_views[i],
|
||||
views[i]);
|
||||
|
||||
if (!views[i]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* A new sampler view (= texture)... */
|
||||
dirty_tex = TRUE;
|
||||
|
||||
/* Set the texrect factor in the fragment shader.
|
||||
* Needed for RECT and NPOT fallback. */
|
||||
texture = r300_texture(views[i]->texture);
|
||||
if (texture->desc.is_npot) {
|
||||
r300->fs_rc_constant_state.dirty = TRUE;
|
||||
}
|
||||
|
||||
state->sampler_views[i]->texcache_region =
|
||||
r300_assign_texture_cache_region(view_index, real_num_views);
|
||||
view_index++;
|
||||
if (!views[i]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* A new sampler view (= texture)... */
|
||||
dirty_tex = TRUE;
|
||||
|
||||
/* Set the texrect factor in the fragment shader.
|
||||
* Needed for RECT and NPOT fallback. */
|
||||
texture = r300_texture(views[i]->texture);
|
||||
if (texture->desc.is_npot) {
|
||||
r300->fs_rc_constant_state.dirty = TRUE;
|
||||
}
|
||||
|
||||
state->sampler_views[i]->texcache_region =
|
||||
r300_assign_texture_cache_region(view_index, real_num_views);
|
||||
view_index++;
|
||||
}
|
||||
|
||||
for (i = count; i < tex_units; i++) {
|
||||
@@ -1363,6 +1361,7 @@ r300_create_sampler_view(struct pipe_context *pipe,
|
||||
struct r300_sampler_view *view = CALLOC_STRUCT(r300_sampler_view);
|
||||
struct r300_texture *tex = r300_texture(texture);
|
||||
boolean is_r500 = r300_screen(pipe->screen)->caps.is_r500;
|
||||
boolean dxtc_swizzle = r300_screen(pipe->screen)->caps.dxtc_swizzle;
|
||||
|
||||
if (view) {
|
||||
view->base = *templ;
|
||||
@@ -1379,7 +1378,8 @@ r300_create_sampler_view(struct pipe_context *pipe,
|
||||
view->format = tex->tx_format;
|
||||
view->format.format1 |= r300_translate_texformat(templ->format,
|
||||
view->swizzle,
|
||||
is_r500);
|
||||
is_r500,
|
||||
dxtc_swizzle);
|
||||
if (is_r500) {
|
||||
view->format.format2 |= r500_tx_format_msb_bit(templ->format);
|
||||
}
|
||||
@@ -1464,6 +1464,15 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
|
||||
struct pipe_vertex_buffer *vbo;
|
||||
unsigned i, max_index = (1 << 24) - 1;
|
||||
boolean any_user_buffer = FALSE;
|
||||
struct pipe_vertex_buffer dummy_vb = {0};
|
||||
|
||||
/* There must be at least one vertex buffer set, otherwise it locks up. */
|
||||
if (!count) {
|
||||
dummy_vb.buffer = r300->dummy_vb;
|
||||
dummy_vb.max_index = r300->dummy_vb->width0 / 4;
|
||||
buffers = &dummy_vb;
|
||||
count = 1;
|
||||
}
|
||||
|
||||
if (count == r300->vertex_buffer_count &&
|
||||
memcmp(r300->vertex_buffer, buffers,
|
||||
@@ -1499,14 +1508,14 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
|
||||
any_user_buffer = TRUE;
|
||||
}
|
||||
|
||||
/* The stride of zero means we will be fetching only the first
|
||||
* vertex, so don't care about max_index. */
|
||||
if (!vbo->stride)
|
||||
continue;
|
||||
|
||||
if (vbo->max_index == ~0) {
|
||||
/* if no VBO stride then only one vertex value so max index is 1 */
|
||||
/* should think about converting to VS constants like svga does */
|
||||
if (!vbo->stride)
|
||||
vbo->max_index = 1;
|
||||
else
|
||||
vbo->max_index =
|
||||
(vbo->buffer->width0 - vbo->buffer_offset) / vbo->stride;
|
||||
vbo->max_index =
|
||||
(vbo->buffer->width0 - vbo->buffer_offset) / vbo->stride;
|
||||
}
|
||||
|
||||
max_index = MIN2(vbo->max_index, max_index);
|
||||
@@ -1617,6 +1626,14 @@ static void* r300_create_vertex_elements_state(struct pipe_context* pipe,
|
||||
struct r300_vertex_element_state *velems;
|
||||
unsigned i;
|
||||
enum pipe_format *format;
|
||||
struct pipe_vertex_element dummy_attrib = {0};
|
||||
|
||||
/* R300 Programmable Stream Control (PSC) doesn't support 0 vertex elements. */
|
||||
if (!count) {
|
||||
dummy_attrib.src_format = PIPE_FORMAT_R8G8B8A8_UNORM;
|
||||
attribs = &dummy_attrib;
|
||||
count = 1;
|
||||
}
|
||||
|
||||
assert(count <= PIPE_MAX_ATTRIBS);
|
||||
velems = CALLOC_STRUCT(r300_vertex_element_state);
|
||||
@@ -1683,7 +1700,8 @@ static void* r300_create_vertex_elements_state(struct pipe_context* pipe,
|
||||
* swizzles are already set up.
|
||||
* Also compute the vertex size. */
|
||||
for (i = 0; i < count; i++) {
|
||||
/* This is OK because we check for aligned strides too. */
|
||||
/* This is OK because we check for aligned strides too
|
||||
* elsewhere. */
|
||||
velems->hw_format_size[i] =
|
||||
align(util_format_get_blocksize(velems->hw_format[i]), 4);
|
||||
velems->vertex_size_dwords += velems->hw_format_size[i] / 4;
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "util/u_math.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_pack_color.h"
|
||||
|
||||
#include "r300_context.h"
|
||||
#include "r300_fs.h"
|
||||
@@ -568,55 +569,93 @@ static void r300_update_rs_block(struct r300_context *r300)
|
||||
}
|
||||
|
||||
static uint32_t r300_get_border_color(enum pipe_format format,
|
||||
const float border[4])
|
||||
const float border[4],
|
||||
boolean is_r500)
|
||||
{
|
||||
const struct util_format_description *desc;
|
||||
float border_swizzled[4] = {
|
||||
border[2],
|
||||
border[1],
|
||||
border[0],
|
||||
border[3]
|
||||
};
|
||||
uint32_t r;
|
||||
float border_swizzled[4] = {0};
|
||||
unsigned i;
|
||||
union util_color uc = {0};
|
||||
|
||||
desc = util_format_description(format);
|
||||
|
||||
/* We don't use util_pack_format because it does not handle the formats
|
||||
* we want, e.g. R4G4B4A4 is non-existent in Gallium. */
|
||||
/* Do depth formats first. */
|
||||
if (util_format_is_depth_or_stencil(format)) {
|
||||
switch (format) {
|
||||
case PIPE_FORMAT_Z16_UNORM:
|
||||
return util_pack_z(PIPE_FORMAT_Z16_UNORM, border[0]);
|
||||
case PIPE_FORMAT_X8Z24_UNORM:
|
||||
case PIPE_FORMAT_S8_USCALED_Z24_UNORM:
|
||||
if (is_r500) {
|
||||
return util_pack_z(PIPE_FORMAT_X8Z24_UNORM, border[0]);
|
||||
} else {
|
||||
return util_pack_z(PIPE_FORMAT_Z16_UNORM, border[0]) << 16;
|
||||
}
|
||||
default:
|
||||
assert(0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Apply inverse swizzle of the format. */
|
||||
for (i = 0; i < 4; i++) {
|
||||
switch (desc->swizzle[i]) {
|
||||
case UTIL_FORMAT_SWIZZLE_X:
|
||||
border_swizzled[2] = border[i];
|
||||
break;
|
||||
case UTIL_FORMAT_SWIZZLE_Y:
|
||||
border_swizzled[1] = border[i];
|
||||
break;
|
||||
case UTIL_FORMAT_SWIZZLE_Z:
|
||||
border_swizzled[0] = border[i];
|
||||
break;
|
||||
case UTIL_FORMAT_SWIZZLE_W:
|
||||
border_swizzled[3] = border[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Compressed formats. */
|
||||
if (util_format_is_compressed(format)) {
|
||||
util_pack_color(border_swizzled, PIPE_FORMAT_R8G8B8A8_UNORM, &uc);
|
||||
return uc.ui;
|
||||
}
|
||||
|
||||
switch (desc->channel[0].size) {
|
||||
case 4:
|
||||
r = ((float_to_ubyte(border_swizzled[0]) & 0xf0) >> 4) |
|
||||
((float_to_ubyte(border_swizzled[1]) & 0xf0) << 0) |
|
||||
((float_to_ubyte(border_swizzled[2]) & 0xf0) << 4) |
|
||||
((float_to_ubyte(border_swizzled[3]) & 0xf0) << 8);
|
||||
util_pack_color(border_swizzled, PIPE_FORMAT_B4G4R4A4_UNORM, &uc);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (desc->channel[1].size == 5) {
|
||||
r = ((float_to_ubyte(border_swizzled[0]) & 0xf8) >> 3) |
|
||||
((float_to_ubyte(border_swizzled[1]) & 0xf8) << 2) |
|
||||
((float_to_ubyte(border_swizzled[2]) & 0xf8) << 7) |
|
||||
((float_to_ubyte(border_swizzled[3]) & 0x80) << 8);
|
||||
util_pack_color(border_swizzled, PIPE_FORMAT_B5G5R5A1_UNORM, &uc);
|
||||
} else if (desc->channel[1].size == 6) {
|
||||
r = ((float_to_ubyte(border_swizzled[0]) & 0xf8) >> 3) |
|
||||
((float_to_ubyte(border_swizzled[1]) & 0xfc) << 3) |
|
||||
((float_to_ubyte(border_swizzled[2]) & 0xf8) << 8);
|
||||
util_pack_color(border_swizzled, PIPE_FORMAT_B5G6R5_UNORM, &uc);
|
||||
} else {
|
||||
assert(0);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* I think the fat formats (16, 32) are specified
|
||||
* as the 8-bit ones. I am not sure how compressed formats
|
||||
* work here. */
|
||||
r = ((float_to_ubyte(border_swizzled[0]) & 0xff) << 0) |
|
||||
((float_to_ubyte(border_swizzled[1]) & 0xff) << 8) |
|
||||
((float_to_ubyte(border_swizzled[2]) & 0xff) << 16) |
|
||||
((float_to_ubyte(border_swizzled[3]) & 0xff) << 24);
|
||||
case 8:
|
||||
util_pack_color(border_swizzled, PIPE_FORMAT_B8G8R8A8_UNORM, &uc);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
util_pack_color(border_swizzled, PIPE_FORMAT_B10G10R10A2_UNORM, &uc);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
if (desc->nr_channels <= 2) {
|
||||
border_swizzled[0] = border_swizzled[2];
|
||||
util_pack_color(border_swizzled, PIPE_FORMAT_R16G16_UNORM, &uc);
|
||||
} else {
|
||||
util_pack_color(border_swizzled, PIPE_FORMAT_B8G8R8A8_UNORM, &uc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return r;
|
||||
return uc.ui;
|
||||
}
|
||||
|
||||
static void r300_merge_textures_and_samplers(struct r300_context* r300)
|
||||
@@ -655,7 +694,8 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300)
|
||||
/* Set the border color. */
|
||||
texstate->border_color =
|
||||
r300_get_border_color(view->base.format,
|
||||
sampler->state.border_color);
|
||||
sampler->state.border_color,
|
||||
r300->screen->caps.is_r500);
|
||||
|
||||
/* determine min/max levels */
|
||||
max_level = MIN3(sampler->max_lod + view->base.first_level,
|
||||
@@ -701,13 +741,18 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300)
|
||||
if (sampler->state.compare_mode == PIPE_TEX_COMPARE_NONE) {
|
||||
texstate->format.format1 |=
|
||||
r300_get_swizzle_combined(depth_swizzle,
|
||||
view->swizzle);
|
||||
view->swizzle, FALSE);
|
||||
} else {
|
||||
texstate->format.format1 |=
|
||||
r300_get_swizzle_combined(depth_swizzle, 0);
|
||||
r300_get_swizzle_combined(depth_swizzle, 0, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
if (r300->screen->caps.dxtc_swizzle &&
|
||||
util_format_is_compressed(tex->desc.b.b.format)) {
|
||||
texstate->filter1 |= R400_DXTC_SWIZZLE_ENABLE;
|
||||
}
|
||||
|
||||
/* to emulate 1D textures through 2D ones correctly */
|
||||
if (tex->desc.b.b.target == PIPE_TEXTURE_1D) {
|
||||
texstate->filter0 &= ~R300_TX_WRAP_T_MASK;
|
||||
|
@@ -40,7 +40,8 @@
|
||||
#include "pipe/p_screen.h"
|
||||
|
||||
unsigned r300_get_swizzle_combined(const unsigned char *swizzle_format,
|
||||
const unsigned char *swizzle_view)
|
||||
const unsigned char *swizzle_view,
|
||||
boolean dxtc_swizzle)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned char swizzle[4];
|
||||
@@ -51,10 +52,10 @@ unsigned r300_get_swizzle_combined(const unsigned char *swizzle_format,
|
||||
R300_TX_FORMAT_B_SHIFT,
|
||||
R300_TX_FORMAT_A_SHIFT
|
||||
};
|
||||
const uint32_t swizzle_bit[4] = {
|
||||
R300_TX_FORMAT_X,
|
||||
uint32_t swizzle_bit[4] = {
|
||||
dxtc_swizzle ? R300_TX_FORMAT_Z : R300_TX_FORMAT_X,
|
||||
R300_TX_FORMAT_Y,
|
||||
R300_TX_FORMAT_Z,
|
||||
dxtc_swizzle ? R300_TX_FORMAT_X : R300_TX_FORMAT_Z,
|
||||
R300_TX_FORMAT_W
|
||||
};
|
||||
|
||||
@@ -107,7 +108,8 @@ unsigned r300_get_swizzle_combined(const unsigned char *swizzle_format,
|
||||
* makes available X, Y, Z, W, ZERO, and ONE for swizzling. */
|
||||
uint32_t r300_translate_texformat(enum pipe_format format,
|
||||
const unsigned char *swizzle_view,
|
||||
boolean is_r500)
|
||||
boolean is_r500,
|
||||
boolean dxtc_swizzle)
|
||||
{
|
||||
uint32_t result = 0;
|
||||
const struct util_format_description *desc;
|
||||
@@ -169,7 +171,8 @@ uint32_t r300_translate_texformat(enum pipe_format format,
|
||||
}
|
||||
}
|
||||
|
||||
result |= r300_get_swizzle_combined(desc->swizzle, swizzle_view);
|
||||
result |= r300_get_swizzle_combined(desc->swizzle, swizzle_view,
|
||||
util_format_is_compressed(format) && dxtc_swizzle);
|
||||
|
||||
/* S3TC formats. */
|
||||
if (desc->layout == UTIL_FORMAT_LAYOUT_S3TC) {
|
||||
@@ -538,7 +541,7 @@ boolean r300_is_zs_format_supported(enum pipe_format format)
|
||||
|
||||
boolean r300_is_sampler_format_supported(enum pipe_format format)
|
||||
{
|
||||
return r300_translate_texformat(format, 0, TRUE) != ~0;
|
||||
return r300_translate_texformat(format, 0, TRUE, FALSE) != ~0;
|
||||
}
|
||||
|
||||
void r300_texture_setup_format_state(struct r300_screen *screen,
|
||||
@@ -862,7 +865,7 @@ struct pipe_surface* r300_get_tex_surface(struct pipe_screen* screen,
|
||||
tex->desc.b.b.nr_samples,
|
||||
tex->desc.microtile,
|
||||
tex->desc.macrotile[level],
|
||||
DIM_HEIGHT);
|
||||
DIM_HEIGHT, 0);
|
||||
|
||||
surface->cbzb_height = align((surface->base.height + 1) / 2,
|
||||
tile_height);
|
||||
|
@@ -35,11 +35,13 @@ struct r300_texture;
|
||||
struct r300_screen;
|
||||
|
||||
unsigned r300_get_swizzle_combined(const unsigned char *swizzle_format,
|
||||
const unsigned char *swizzle_view);
|
||||
const unsigned char *swizzle_view,
|
||||
boolean dxtc_swizzle);
|
||||
|
||||
uint32_t r300_translate_texformat(enum pipe_format format,
|
||||
const unsigned char *swizzle_view,
|
||||
boolean is_r500);
|
||||
boolean is_r500,
|
||||
boolean dxtc_swizzle);
|
||||
|
||||
uint32_t r500_tx_format_msb_bit(enum pipe_format format);
|
||||
|
||||
|
@@ -34,7 +34,7 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
|
||||
unsigned num_samples,
|
||||
enum r300_buffer_tiling microtile,
|
||||
enum r300_buffer_tiling macrotile,
|
||||
enum r300_dim dim)
|
||||
enum r300_dim dim, boolean is_rs690)
|
||||
{
|
||||
static const unsigned table[2][5][3][2] =
|
||||
{
|
||||
@@ -44,7 +44,7 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
|
||||
{{ 32, 1}, { 8, 4}, { 0, 0}}, /* 8 bits per pixel */
|
||||
{{ 16, 1}, { 8, 2}, { 4, 4}}, /* 16 bits per pixel */
|
||||
{{ 8, 1}, { 4, 2}, { 0, 0}}, /* 32 bits per pixel */
|
||||
{{ 4, 1}, { 0, 0}, { 2, 2}}, /* 64 bits per pixel */
|
||||
{{ 4, 1}, { 2, 2}, { 0, 0}}, /* 64 bits per pixel */
|
||||
{{ 2, 1}, { 0, 0}, { 0, 0}} /* 128 bits per pixel */
|
||||
},
|
||||
{
|
||||
@@ -53,10 +53,11 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
|
||||
{{256, 8}, {64, 32}, { 0, 0}}, /* 8 bits per pixel */
|
||||
{{128, 8}, {64, 16}, {32, 32}}, /* 16 bits per pixel */
|
||||
{{ 64, 8}, {32, 16}, { 0, 0}}, /* 32 bits per pixel */
|
||||
{{ 32, 8}, { 0, 0}, {16, 16}}, /* 64 bits per pixel */
|
||||
{{ 32, 8}, {16, 16}, { 0, 0}}, /* 64 bits per pixel */
|
||||
{{ 16, 8}, { 0, 0}, { 0, 0}} /* 128 bits per pixel */
|
||||
}
|
||||
};
|
||||
|
||||
static const unsigned aa_block[2] = {4, 8};
|
||||
unsigned tile = 0;
|
||||
unsigned pixsize = util_format_get_blocksize(format);
|
||||
@@ -74,6 +75,14 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
|
||||
} else {
|
||||
/* Standard alignment. */
|
||||
tile = table[macrotile][util_logbase2(pixsize)][microtile][dim];
|
||||
if (macrotile == 0 && is_rs690 && dim == DIM_WIDTH) {
|
||||
int align;
|
||||
int h_tile;
|
||||
h_tile = table[macrotile][util_logbase2(pixsize)][microtile][DIM_HEIGHT];
|
||||
align = 64 / (pixsize * h_tile);
|
||||
if (tile < align)
|
||||
tile = align;
|
||||
}
|
||||
}
|
||||
|
||||
assert(tile);
|
||||
@@ -89,7 +98,7 @@ static boolean r300_texture_macro_switch(struct r300_texture_desc *desc,
|
||||
unsigned tile, texdim;
|
||||
|
||||
tile = r300_get_pixel_alignment(desc->b.b.format, desc->b.b.nr_samples,
|
||||
desc->microtile, R300_BUFFER_TILED, dim);
|
||||
desc->microtile, R300_BUFFER_TILED, dim, 0);
|
||||
if (dim == DIM_WIDTH) {
|
||||
texdim = u_minify(desc->b.b.width0, level);
|
||||
} else {
|
||||
@@ -113,6 +122,9 @@ static unsigned r300_texture_get_stride(struct r300_screen *screen,
|
||||
unsigned level)
|
||||
{
|
||||
unsigned tile_width, width, stride;
|
||||
boolean is_rs690 = (screen->caps.family == CHIP_FAMILY_RS600 ||
|
||||
screen->caps.family == CHIP_FAMILY_RS690 ||
|
||||
screen->caps.family == CHIP_FAMILY_RS740);
|
||||
|
||||
if (desc->stride_in_bytes_override)
|
||||
return desc->stride_in_bytes_override;
|
||||
@@ -131,38 +143,14 @@ static unsigned r300_texture_get_stride(struct r300_screen *screen,
|
||||
desc->b.b.nr_samples,
|
||||
desc->microtile,
|
||||
desc->macrotile[level],
|
||||
DIM_WIDTH);
|
||||
DIM_WIDTH, is_rs690);
|
||||
width = align(width, tile_width);
|
||||
|
||||
stride = util_format_get_stride(desc->b.b.format, width);
|
||||
|
||||
/* Some IGPs need a minimum stride of 64 bytes, hmm... */
|
||||
if (!desc->macrotile[level] &&
|
||||
(screen->caps.family == CHIP_FAMILY_RS600 ||
|
||||
screen->caps.family == CHIP_FAMILY_RS690 ||
|
||||
screen->caps.family == CHIP_FAMILY_RS740)) {
|
||||
unsigned min_stride;
|
||||
|
||||
if (desc->microtile) {
|
||||
unsigned tile_height =
|
||||
r300_get_pixel_alignment(desc->b.b.format,
|
||||
desc->b.b.nr_samples,
|
||||
desc->microtile,
|
||||
desc->macrotile[level],
|
||||
DIM_HEIGHT);
|
||||
|
||||
min_stride = 64 / tile_height;
|
||||
} else {
|
||||
min_stride = 64;
|
||||
}
|
||||
|
||||
return stride < min_stride ? min_stride : stride;
|
||||
}
|
||||
|
||||
/* The alignment to 32 bytes is sort of implied by the layout... */
|
||||
return stride;
|
||||
} else {
|
||||
return align(util_format_get_stride(desc->b.b.format, width), 32);
|
||||
return align(util_format_get_stride(desc->b.b.format, width), is_rs690 ? 64 : 32);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +167,7 @@ static unsigned r300_texture_get_nblocksy(struct r300_texture_desc *desc,
|
||||
desc->b.b.nr_samples,
|
||||
desc->microtile,
|
||||
desc->macrotile[level],
|
||||
DIM_HEIGHT);
|
||||
DIM_HEIGHT, 0);
|
||||
height = align(height, tile_height);
|
||||
|
||||
/* This is needed for the kernel checker, unfortunately. */
|
||||
@@ -368,11 +356,11 @@ static void r300_setup_tiling(struct r300_screen *screen,
|
||||
switch (util_format_get_blocksize(format)) {
|
||||
case 1:
|
||||
case 4:
|
||||
case 8:
|
||||
desc->microtile = R300_BUFFER_TILED;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 8:
|
||||
if (rws->get_value(rws, R300_VID_SQUARE_TILING_SUPPORT)) {
|
||||
desc->microtile = R300_BUFFER_SQUARETILED;
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
|
||||
unsigned num_samples,
|
||||
enum r300_buffer_tiling microtile,
|
||||
enum r300_buffer_tiling macrotile,
|
||||
enum r300_dim dim);
|
||||
enum r300_dim dim, boolean is_rs690);
|
||||
|
||||
boolean r300_texture_desc_init(struct r300_screen *rscreen,
|
||||
struct r300_texture_desc *desc,
|
||||
|
@@ -17,7 +17,7 @@ x11_INCLUDES = \
|
||||
-I$(TOP)/src/mapi \
|
||||
-I$(TOP)/src/mesa \
|
||||
$(X11_CFLAGS) \
|
||||
$(shell pkg-config --cflags-only-I libdrm)
|
||||
$(shell pkg-config --cflags-only-I libdrm dri2proto)
|
||||
|
||||
x11_SOURCES = $(wildcard x11/*.c) \
|
||||
$(TOP)/src/glx/dri2.c
|
||||
|
@@ -609,8 +609,10 @@ egl_g3d_wait_client(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
|
||||
|
||||
gctx->stctxi->flush(gctx->stctxi,
|
||||
PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
|
||||
screen->fence_finish(screen, fence, 0);
|
||||
screen->fence_reference(screen, &fence, NULL);
|
||||
if (fence) {
|
||||
screen->fence_finish(screen, fence, 0);
|
||||
screen->fence_reference(screen, &fence, NULL);
|
||||
}
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
@@ -51,7 +51,6 @@ egl_g3d_st_manager(struct st_manager *smapi)
|
||||
|
||||
static boolean
|
||||
egl_g3d_st_manager_get_egl_image(struct st_manager *smapi,
|
||||
struct st_context_iface *stctx,
|
||||
void *egl_image,
|
||||
struct st_egl_image *out)
|
||||
{
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#define _NATIVE_X11_H_
|
||||
|
||||
#include "common/native.h"
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
struct native_display *
|
||||
x11_create_ximage_display(Display *dpy,
|
||||
|
@@ -73,7 +73,8 @@ void vegaFinish(void)
|
||||
pipe = ctx->pipe;
|
||||
|
||||
pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
|
||||
|
||||
pipe->screen->fence_finish(pipe->screen, fence, 0);
|
||||
pipe->screen->fence_reference(pipe->screen, &fence, NULL);
|
||||
if (fence) {
|
||||
pipe->screen->fence_finish(pipe->screen, fence, 0);
|
||||
pipe->screen->fence_reference(pipe->screen, &fence, NULL);
|
||||
}
|
||||
}
|
||||
|
@@ -352,7 +352,7 @@ vg_api_create_context(struct st_api *stapi, struct st_manager *smapi,
|
||||
return NULL;
|
||||
|
||||
/* only 1.0 is supported */
|
||||
if (attribs->major != 1 || attribs->minor > 0)
|
||||
if (attribs->major > 1 || (attribs->major == 1 && attribs->minor > 0))
|
||||
return NULL;
|
||||
|
||||
pipe = smapi->screen->context_create(smapi->screen, NULL);
|
||||
|
@@ -10,7 +10,7 @@ LIBRARY_INCLUDES = \
|
||||
$(shell pkg-config libkms --atleast-version=1.0 \
|
||||
&& echo "-DHAVE_LIBKMS") \
|
||||
$(shell pkg-config libkms --silence-errors --cflags-only-I) \
|
||||
$(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \
|
||||
$(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto dri2proto) \
|
||||
-I$(TOP)/src/gallium/include \
|
||||
-I$(TOP)/src/gallium/auxiliary \
|
||||
-I$(TOP)/include \
|
||||
|
@@ -234,6 +234,10 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
|
||||
64, 64, (void*)image, 64 * 4, 0, 0);
|
||||
ms->ctx->transfer_unmap(ms->ctx, transfer);
|
||||
ms->ctx->transfer_destroy(ms->ctx, transfer);
|
||||
|
||||
if (crtc->cursor_shown)
|
||||
drmModeSetCursor(ms->fd, crtcp->drm_crtc->crtc_id,
|
||||
crtcp->cursor_handle, 64, 64);
|
||||
}
|
||||
|
||||
#if HAVE_LIBKMS
|
||||
@@ -271,6 +275,10 @@ crtc_load_cursor_argb_kms(xf86CrtcPtr crtc, CARD32 * image)
|
||||
memcpy(ptr, image, 64*64*4);
|
||||
kms_bo_unmap(crtcp->cursor_bo);
|
||||
|
||||
if (crtc->cursor_shown)
|
||||
drmModeSetCursor(ms->fd, crtcp->drm_crtc->crtc_id,
|
||||
crtcp->cursor_handle, 64, 64);
|
||||
|
||||
return;
|
||||
|
||||
err_bo_destroy:
|
||||
@@ -353,7 +361,7 @@ crtc_destroy(xf86CrtcPtr crtc)
|
||||
|
||||
drmModeFreeCrtc(crtcp->drm_crtc);
|
||||
|
||||
xfree(crtcp);
|
||||
free(crtcp);
|
||||
crtc->driver_private = NULL;
|
||||
}
|
||||
|
||||
@@ -401,7 +409,7 @@ xorg_crtc_init(ScrnInfoPtr pScrn)
|
||||
if (crtc == NULL)
|
||||
goto out;
|
||||
|
||||
crtcp = xcalloc(1, sizeof(struct crtc_private));
|
||||
crtcp = calloc(1, sizeof(struct crtc_private));
|
||||
if (!crtcp) {
|
||||
xf86CrtcDestroy(crtc);
|
||||
goto out;
|
||||
|
@@ -201,11 +201,11 @@ dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment, unsigned int form
|
||||
DRI2Buffer2Ptr buffer;
|
||||
BufferPrivatePtr private;
|
||||
|
||||
buffer = xcalloc(1, sizeof *buffer);
|
||||
buffer = calloc(1, sizeof *buffer);
|
||||
if (!buffer)
|
||||
return NULL;
|
||||
|
||||
private = xcalloc(1, sizeof *private);
|
||||
private = calloc(1, sizeof *private);
|
||||
if (!private) {
|
||||
goto fail;
|
||||
}
|
||||
@@ -217,9 +217,9 @@ dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment, unsigned int form
|
||||
if (dri2_do_create_buffer(pDraw, (DRI2BufferPtr)buffer, format))
|
||||
return buffer;
|
||||
|
||||
xfree(private);
|
||||
free(private);
|
||||
fail:
|
||||
xfree(buffer);
|
||||
free(buffer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -229,8 +229,8 @@ dri2_destroy_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer)
|
||||
/* So far it is safe to downcast a DRI2Buffer2Ptr to DRI2BufferPtr */
|
||||
dri2_do_destroy_buffer(pDraw, (DRI2BufferPtr)buffer);
|
||||
|
||||
xfree(buffer->driverPrivate);
|
||||
xfree(buffer);
|
||||
free(buffer->driverPrivate);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
#endif /* DRI2INFOREC_VERSION >= 2 */
|
||||
@@ -244,11 +244,11 @@ dri2_create_buffers(DrawablePtr pDraw, unsigned int *attachments, int count)
|
||||
DRI2BufferPtr buffers;
|
||||
int i;
|
||||
|
||||
buffers = xcalloc(count, sizeof *buffers);
|
||||
buffers = calloc(count, sizeof *buffers);
|
||||
if (!buffers)
|
||||
goto fail_buffers;
|
||||
|
||||
privates = xcalloc(count, sizeof *privates);
|
||||
privates = calloc(count, sizeof *privates);
|
||||
if (!privates)
|
||||
goto fail_privates;
|
||||
|
||||
@@ -263,9 +263,9 @@ dri2_create_buffers(DrawablePtr pDraw, unsigned int *attachments, int count)
|
||||
return buffers;
|
||||
|
||||
fail:
|
||||
xfree(privates);
|
||||
free(privates);
|
||||
fail_privates:
|
||||
xfree(buffers);
|
||||
free(buffers);
|
||||
fail_buffers:
|
||||
return NULL;
|
||||
}
|
||||
@@ -280,8 +280,8 @@ dri2_destroy_buffers(DrawablePtr pDraw, DRI2BufferPtr buffers, int count)
|
||||
}
|
||||
|
||||
if (buffers) {
|
||||
xfree(buffers[0].driverPrivate);
|
||||
xfree(buffers);
|
||||
free(buffers[0].driverPrivate);
|
||||
free(buffers);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -45,6 +45,7 @@
|
||||
#include "miscstruct.h"
|
||||
#include "dixstruct.h"
|
||||
#include "xf86xv.h"
|
||||
#include "xorgVersion.h"
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
#error "libpciaccess needed"
|
||||
#endif
|
||||
@@ -122,7 +123,7 @@ xorg_tracker_set_functions(ScrnInfoPtr scrn)
|
||||
Bool
|
||||
xorg_tracker_have_modesetting(ScrnInfoPtr pScrn, struct pci_device *device)
|
||||
{
|
||||
char *BusID = xalloc(64);
|
||||
char *BusID = malloc(64);
|
||||
sprintf(BusID, "pci:%04x:%02x:%02x.%d",
|
||||
device->domain, device->bus,
|
||||
device->dev, device->func);
|
||||
@@ -130,14 +131,14 @@ xorg_tracker_have_modesetting(ScrnInfoPtr pScrn, struct pci_device *device)
|
||||
if (drmCheckModesettingSupported(BusID)) {
|
||||
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
|
||||
"Drm modesetting not supported %s\n", BusID);
|
||||
xfree(BusID);
|
||||
free(BusID);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
|
||||
"Drm modesetting supported on %s\n", BusID);
|
||||
|
||||
xfree(BusID);
|
||||
free(BusID);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -174,7 +175,7 @@ drv_free_rec(ScrnInfoPtr pScrn)
|
||||
if (!pScrn->driverPrivate)
|
||||
return;
|
||||
|
||||
xfree(pScrn->driverPrivate);
|
||||
free(pScrn->driverPrivate);
|
||||
|
||||
pScrn->driverPrivate = NULL;
|
||||
}
|
||||
@@ -274,7 +275,7 @@ drv_init_drm(ScrnInfoPtr pScrn)
|
||||
if (ms->fd < 0) {
|
||||
char *BusID;
|
||||
|
||||
BusID = xalloc(64);
|
||||
BusID = malloc(64);
|
||||
sprintf(BusID, "PCI:%d:%d:%d",
|
||||
((ms->PciInfo->domain << 8) | ms->PciInfo->bus),
|
||||
ms->PciInfo->dev, ms->PciInfo->func
|
||||
@@ -283,7 +284,7 @@ drv_init_drm(ScrnInfoPtr pScrn)
|
||||
|
||||
ms->fd = drmOpen(driver_descriptor.driver_name, BusID);
|
||||
ms->isMaster = TRUE;
|
||||
xfree(BusID);
|
||||
free(BusID);
|
||||
|
||||
if (ms->fd >= 0)
|
||||
return TRUE;
|
||||
@@ -369,6 +370,7 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
|
||||
ms = modesettingPTR(pScrn);
|
||||
ms->pEnt = pEnt;
|
||||
ms->cust = cust;
|
||||
ms->fb_id = -1;
|
||||
|
||||
pScrn->displayWidth = 640; /* default it */
|
||||
|
||||
@@ -402,19 +404,6 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
|
||||
if (!drv_init_drm(pScrn))
|
||||
return FALSE;
|
||||
|
||||
use3D = cust ? !cust->no_3d : TRUE;
|
||||
ms->from_3D = xf86GetOptValBool(ms->Options, OPTION_3D_ACCEL,
|
||||
&use3D) ?
|
||||
X_CONFIG : X_PROBED;
|
||||
|
||||
ms->no3D = !use3D;
|
||||
|
||||
if (!drv_init_resource_management(pScrn)) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not init "
|
||||
"Gallium3D or libKMS.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pScrn->monitor = pScrn->confScreen->monitor;
|
||||
pScrn->progClock = TRUE;
|
||||
pScrn->rgbBits = 8;
|
||||
@@ -444,11 +433,24 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
/* Process the options */
|
||||
xf86CollectOptions(pScrn, NULL);
|
||||
if (!(ms->Options = xalloc(sizeof(drv_options))))
|
||||
if (!(ms->Options = malloc(sizeof(drv_options))))
|
||||
return FALSE;
|
||||
memcpy(ms->Options, drv_options, sizeof(drv_options));
|
||||
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options);
|
||||
|
||||
use3D = cust ? !cust->no_3d : TRUE;
|
||||
ms->from_3D = xf86GetOptValBool(ms->Options, OPTION_3D_ACCEL,
|
||||
&use3D) ?
|
||||
X_CONFIG : X_PROBED;
|
||||
|
||||
ms->no3D = !use3D;
|
||||
|
||||
if (!drv_init_resource_management(pScrn)) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not init "
|
||||
"Gallium3D or libKMS.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Allocate an xf86CrtcConfig */
|
||||
xf86CrtcConfigInit(pScrn, &crtc_config_funcs);
|
||||
xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||
@@ -791,7 +793,9 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
if (!ms->SWCursor)
|
||||
xf86_cursors_init(pScreen, 64, 64,
|
||||
HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 |
|
||||
HARDWARE_CURSOR_ARGB);
|
||||
HARDWARE_CURSOR_ARGB |
|
||||
((cust && cust->unhidden_hw_cursor_update) ?
|
||||
HARDWARE_CURSOR_UPDATE_UNHIDDEN : 0));
|
||||
|
||||
/* Must force it before EnterVT, so we are in control of VT and
|
||||
* later memory should be bound when allocating, e.g rotate_mem */
|
||||
@@ -862,8 +866,10 @@ drv_leave_vt(int scrnIndex, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
drmModeRmFB(ms->fd, ms->fb_id);
|
||||
ms->fb_id = -1;
|
||||
if (ms->fb_id != -1) {
|
||||
drmModeRmFB(ms->fd, ms->fb_id);
|
||||
ms->fb_id = -1;
|
||||
}
|
||||
|
||||
/* idle hardware */
|
||||
if (!ms->kms)
|
||||
@@ -944,7 +950,6 @@ drv_close_screen(int scrnIndex, ScreenPtr pScreen)
|
||||
}
|
||||
#endif
|
||||
|
||||
drmModeRmFB(ms->fd, ms->fb_id);
|
||||
ms->destroy_front_buffer(pScrn);
|
||||
|
||||
if (ms->exa)
|
||||
@@ -1178,6 +1183,8 @@ drv_bind_front_buffer_kms(ScrnInfoPtr pScrn)
|
||||
stride,
|
||||
ptr);
|
||||
|
||||
#if (XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 9, 99, 1, 0))
|
||||
|
||||
/* This a hack to work around EnableDisableFBAccess setting the pointer
|
||||
* the real fix would be to replace pScrn->EnableDisableFBAccess hook
|
||||
* and set the rootPixmap->devPrivate.ptr to something valid before that.
|
||||
@@ -1187,6 +1194,8 @@ drv_bind_front_buffer_kms(ScrnInfoPtr pScrn)
|
||||
*/
|
||||
pScrn->pixmapPrivate.ptr = ptr;
|
||||
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
|
||||
err_destroy:
|
||||
|
@@ -720,7 +720,7 @@ ExaCreatePixmap(ScreenPtr pScreen, int size, int align)
|
||||
{
|
||||
struct exa_pixmap_priv *priv;
|
||||
|
||||
priv = xcalloc(1, sizeof(struct exa_pixmap_priv));
|
||||
priv = calloc(1, sizeof(struct exa_pixmap_priv));
|
||||
if (!priv)
|
||||
return NULL;
|
||||
|
||||
@@ -737,7 +737,7 @@ ExaDestroyPixmap(ScreenPtr pScreen, void *dPriv)
|
||||
|
||||
pipe_resource_reference(&priv->tex, NULL);
|
||||
|
||||
xfree(priv);
|
||||
free(priv);
|
||||
}
|
||||
|
||||
static Bool
|
||||
@@ -975,7 +975,7 @@ xorg_exa_close(ScrnInfoPtr pScrn)
|
||||
ms->ctx = NULL;
|
||||
|
||||
exaDriverFini(pScrn->pScreen);
|
||||
xfree(exa);
|
||||
free(exa);
|
||||
ms->exa = NULL;
|
||||
}
|
||||
|
||||
@@ -987,7 +987,7 @@ xorg_exa_init(ScrnInfoPtr pScrn, Bool accel)
|
||||
ExaDriverPtr pExa;
|
||||
CustomizerPtr cust = ms->cust;
|
||||
|
||||
exa = xcalloc(1, sizeof(struct exa_context));
|
||||
exa = calloc(1, sizeof(struct exa_context));
|
||||
if (!exa)
|
||||
return NULL;
|
||||
|
||||
|
@@ -128,7 +128,7 @@ output_get_modes(xf86OutputPtr output)
|
||||
for (i = 0; i < drm_connector->count_modes; i++) {
|
||||
drm_mode = &drm_connector->modes[i];
|
||||
if (drm_mode) {
|
||||
mode = xcalloc(1, sizeof(DisplayModeRec));
|
||||
mode = calloc(1, sizeof(DisplayModeRec));
|
||||
if (!mode)
|
||||
continue;
|
||||
mode->Clock = drm_mode->clock;
|
||||
@@ -195,7 +195,7 @@ output_destroy(xf86OutputPtr output)
|
||||
{
|
||||
struct output_private *priv = output->driver_private;
|
||||
drmModeFreeConnector(priv->drm_connector);
|
||||
xfree(priv);
|
||||
free(priv);
|
||||
output->driver_private = NULL;
|
||||
}
|
||||
|
||||
@@ -262,14 +262,14 @@ xorg_output_init(ScrnInfoPtr pScrn)
|
||||
drm_connector->connector_type_id);
|
||||
|
||||
|
||||
priv = xcalloc(sizeof(*priv), 1);
|
||||
priv = calloc(sizeof(*priv), 1);
|
||||
if (!priv) {
|
||||
continue;
|
||||
}
|
||||
|
||||
output = xf86OutputCreate(pScrn, &output_funcs, name);
|
||||
if (!output) {
|
||||
xfree(priv);
|
||||
free(priv);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -76,6 +76,7 @@ typedef struct _CustomizerRec
|
||||
Bool dirty_throttling;
|
||||
Bool swap_throttling;
|
||||
Bool no_3d;
|
||||
Bool unhidden_hw_cursor_update;
|
||||
Bool (*winsys_pre_init) (struct _CustomizerRec *cust, int fd);
|
||||
Bool (*winsys_screen_init)(struct _CustomizerRec *cust);
|
||||
Bool (*winsys_screen_close)(struct _CustomizerRec *cust);
|
||||
|
@@ -536,8 +536,10 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id,
|
||||
dst_surf = xorg_gpu_surface(pPriv->r->pipe->screen, dst);
|
||||
hdtv = ((src_w >= RES_720P_X) && (src_h >= RES_720P_Y));
|
||||
|
||||
#ifdef COMPOSITE
|
||||
REGION_TRANSLATE(pScrn->pScreen, dstRegion, -pPixmap->screen_x,
|
||||
-pPixmap->screen_y);
|
||||
#endif
|
||||
|
||||
dxo = dstRegion->extents.x1;
|
||||
dyo = dstRegion->extents.y1;
|
||||
@@ -562,11 +564,16 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id,
|
||||
int box_y2 = pbox->y2;
|
||||
float diff_x = (float)src_w / (float)dst_w;
|
||||
float diff_y = (float)src_h / (float)dst_h;
|
||||
float offset_x = box_x1 - dstX + pPixmap->screen_x;
|
||||
float offset_y = box_y1 - dstY + pPixmap->screen_y;
|
||||
float offset_x = box_x1 - dstX;
|
||||
float offset_y = box_y1 - dstY;
|
||||
float offset_w;
|
||||
float offset_h;
|
||||
|
||||
#ifdef COMPOSITE
|
||||
offset_x += pPixmap->screen_x;
|
||||
offset_y += pPixmap->screen_y;
|
||||
#endif
|
||||
|
||||
x = box_x1;
|
||||
y = box_y1;
|
||||
w = box_x2 - box_x1;
|
||||
|
@@ -80,7 +80,7 @@ $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) Makefile \
|
||||
$(OBJECTS) $(PIPE_DRIVERS) \
|
||||
-Wl,--start-group $(MESA_MODULES) -Wl,--end-group \
|
||||
$(DRI_LIB_DEPS) $(DRIVER_EXTRAS)
|
||||
$(CXX) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS);
|
||||
$(CXX) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS) $(LDFLAGS);
|
||||
@rm -f $@.test
|
||||
mv -f $@.tmp $@
|
||||
|
||||
|
@@ -29,7 +29,7 @@ INCLUDES = \
|
||||
LIBNAME_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(TARGET)
|
||||
|
||||
ifeq ($(MESA_LLVM),1)
|
||||
LD = g++
|
||||
LD = $(CXX)
|
||||
LDFLAGS += $(LLVM_LDFLAGS)
|
||||
USE_CXX=1
|
||||
DRIVER_PIPES += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
|
||||
@@ -42,7 +42,7 @@ endif
|
||||
default: depend $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING)
|
||||
|
||||
$(LIBNAME): $(OBJECTS) Makefile ../Makefile.xorg $(LIBS) $(DRIVER_PIPES)
|
||||
$(MKLIB) -noprefix -o $@ $(LDFLAGS) $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
|
||||
$(MKLIB) -linker $(CC) -noprefix -o $@ $(LDFLAGS) $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
|
||||
|
||||
depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES)
|
||||
rm -f depend
|
||||
|
@@ -12,6 +12,7 @@ PIPE_DRIVERS = \
|
||||
|
||||
C_SOURCES = \
|
||||
target.c \
|
||||
vmw_powf.c \
|
||||
$(COMMON_GALLIUM_SOURCES)
|
||||
|
||||
DRIVER_DEFINES = \
|
||||
|
17
src/gallium/targets/dri-vmwgfx/vmw_powf.c
Normal file
17
src/gallium/targets/dri-vmwgfx/vmw_powf.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Powf may leave an unresolved symbol pointing to a libstdc++.so powf.
|
||||
* However, not all libstdc++.so include this function, so optionally
|
||||
* replace the powf function with calls to expf and logf.
|
||||
*/
|
||||
|
||||
#ifdef VMW_RESOLVE_POWF
|
||||
|
||||
extern float expf(float x);
|
||||
extern float logf(float x);
|
||||
extern float powf(float x, float y);
|
||||
|
||||
float powf(float x, float y) {
|
||||
return expf(logf(x)*y);
|
||||
}
|
||||
|
||||
#endif
|
@@ -24,7 +24,9 @@ common_CPPFLAGS := \
|
||||
-I$(TOP)/src/gallium/auxiliary \
|
||||
-I$(TOP)/src/gallium/drivers \
|
||||
-I$(TOP)/src/gallium/include \
|
||||
-I$(TOP)/src/gallium/winsys
|
||||
-I$(TOP)/src/gallium/winsys \
|
||||
$(LIBDRM_CFLAGS)
|
||||
|
||||
common_SYS :=
|
||||
common_LIBS := \
|
||||
$(TOP)/src/gallium/drivers/identity/libidentity.a \
|
||||
@@ -41,11 +43,11 @@ egl_SYS := -lm $(DLOPEN_LIBS) -L$(TOP)/$(LIB_DIR) -lEGL
|
||||
egl_LIBS := $(TOP)/src/gallium/state_trackers/egl/libegl.a
|
||||
|
||||
ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
|
||||
egl_SYS += -lX11 -lXext -lXfixes
|
||||
egl_SYS += -lX11 -lXext -lXfixes $(LIBDRM_LIB)
|
||||
egl_LIBS += $(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a
|
||||
endif
|
||||
ifneq ($(findstring kms, $(EGL_PLATFORMS)),)
|
||||
egl_SYS += -ldrm
|
||||
ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
|
||||
egl_SYS += $(LIBDRM_LIB)
|
||||
endif
|
||||
ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),)
|
||||
egl_LIBS += $(TOP)/src/gallium/winsys/sw/fbdev/libfbdev.a
|
||||
|
@@ -1,6 +1,7 @@
|
||||
|
||||
#include "target-helpers/inline_wrapper_sw_helper.h"
|
||||
#include "target-helpers/inline_debug_helper.h"
|
||||
#include "target-helpers/inline_wrapper_sw_helper.h"
|
||||
#include "state_tracker/drm_driver.h"
|
||||
#include "i965/drm/i965_drm_public.h"
|
||||
#include "i965/brw_public.h"
|
||||
|
@@ -32,6 +32,7 @@
|
||||
* allows X clients to communicate with the driver.
|
||||
*/
|
||||
|
||||
#include <xorg-server.h>
|
||||
#include "dixstruct.h"
|
||||
#include "extnsionst.h"
|
||||
#include <X11/X.h>
|
||||
@@ -211,7 +212,7 @@ VMwareCtrlDoSetTopology(ScrnInfoPtr pScrn,
|
||||
struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn));
|
||||
int i;
|
||||
|
||||
rects = xcalloc(number, sizeof(*rects));
|
||||
rects = calloc(number, sizeof(*rects));
|
||||
if (!rects)
|
||||
return FALSE;
|
||||
|
||||
@@ -224,7 +225,7 @@ VMwareCtrlDoSetTopology(ScrnInfoPtr pScrn,
|
||||
|
||||
vmw_ioctl_update_layout(vmw, number, rects);
|
||||
|
||||
xfree(rects);
|
||||
free(rects);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@@ -165,7 +165,7 @@ vmw_ioctl_buffer_create(struct vmw_customizer *vmw, uint32_t size, unsigned *han
|
||||
struct drm_vmw_dmabuf_rep *rep = &arg.rep;
|
||||
int ret;
|
||||
|
||||
buf = xcalloc(1, sizeof(*buf));
|
||||
buf = calloc(1, sizeof(*buf));
|
||||
if (!buf)
|
||||
goto err;
|
||||
|
||||
@@ -192,7 +192,7 @@ vmw_ioctl_buffer_create(struct vmw_customizer *vmw, uint32_t size, unsigned *han
|
||||
return buf;
|
||||
|
||||
err_free:
|
||||
xfree(buf);
|
||||
free(buf);
|
||||
err:
|
||||
return NULL;
|
||||
}
|
||||
@@ -211,7 +211,7 @@ vmw_ioctl_buffer_destroy(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf)
|
||||
arg.handle = buf->handle;
|
||||
drmCommandWrite(vmw->fd, DRM_VMW_UNREF_DMABUF, &arg, sizeof(arg));
|
||||
|
||||
xfree(buf);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
void *
|
||||
|
@@ -245,6 +245,7 @@ vmw_screen_pre_init(ScrnInfoPtr pScrn, int flags)
|
||||
cust->winsys_enter_vt = vmw_screen_enter_vt;
|
||||
cust->winsys_leave_vt = vmw_screen_leave_vt;
|
||||
cust->no_3d = TRUE;
|
||||
cust->unhidden_hw_cursor_update = TRUE;
|
||||
vmw->pScrn = pScrn;
|
||||
|
||||
pScrn->driverPrivate = cust;
|
||||
|
@@ -300,7 +300,7 @@ vmw_video_init(struct vmw_customizer *vmw)
|
||||
numAdaptors = 1;
|
||||
overlayAdaptors = &newAdaptor;
|
||||
} else {
|
||||
newAdaptors = xalloc((numAdaptors + 1) *
|
||||
newAdaptors = malloc((numAdaptors + 1) *
|
||||
sizeof(XF86VideoAdaptorPtr*));
|
||||
if (!newAdaptors) {
|
||||
xf86XVFreeVideoAdaptorRec(newAdaptor);
|
||||
@@ -320,7 +320,7 @@ vmw_video_init(struct vmw_customizer *vmw)
|
||||
}
|
||||
|
||||
if (newAdaptors) {
|
||||
xfree(newAdaptors);
|
||||
free(newAdaptors);
|
||||
}
|
||||
|
||||
debug_printf("Initialized VMware Xv extension successfully\n");
|
||||
@@ -438,7 +438,7 @@ vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_customizer *vmw)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
video = xcalloc(1, sizeof(*video));
|
||||
video = calloc(1, sizeof(*video));
|
||||
if (!video) {
|
||||
debug_printf("Not enough memory.\n");
|
||||
xf86XVFreeVideoAdaptorRec(adaptor);
|
||||
@@ -742,7 +742,7 @@ vmw_video_buffer_alloc(struct vmw_customizer *vmw, int size,
|
||||
}
|
||||
|
||||
out->size = size;
|
||||
out->extra_data = xcalloc(1, size);
|
||||
out->extra_data = calloc(1, size);
|
||||
|
||||
debug_printf("\t\t%s: allocated buffer %p of size %i\n", __func__, out, size);
|
||||
|
||||
@@ -773,7 +773,7 @@ vmw_video_buffer_free(struct vmw_customizer *vmw,
|
||||
if (out->size == 0)
|
||||
return Success;
|
||||
|
||||
xfree(out->extra_data);
|
||||
free(out->extra_data);
|
||||
vmw_ioctl_buffer_unmap(vmw, out->buf);
|
||||
vmw_ioctl_buffer_destroy(vmw, out->buf);
|
||||
|
||||
|
@@ -37,7 +37,214 @@
|
||||
* I believe that this check is valid, but I haven't been exhaustive. */
|
||||
static INLINE boolean is_r3xx(int pciid)
|
||||
{
|
||||
return (pciid > 0x3150) && (pciid < 0x796f);
|
||||
switch (pciid) {
|
||||
case 0x4144: /* PCI_CHIP_R300_AD */
|
||||
case 0x4145: /* PCI_CHIP_R300_AE */
|
||||
case 0x4146: /* PCI_CHIP_R300_AF */
|
||||
case 0x4147: /* PCI_CHIP_R300_AG */
|
||||
case 0x4E44: /* PCI_CHIP_R300_ND */
|
||||
case 0x4E45: /* PCI_CHIP_R300_NE */
|
||||
case 0x4E46: /* PCI_CHIP_R300_NF */
|
||||
case 0x4E47: /* PCI_CHIP_R300_NG */
|
||||
case 0x4E48: /* PCI_CHIP_R350_NH */
|
||||
case 0x4E49: /* PCI_CHIP_R350_NI */
|
||||
case 0x4E4B: /* PCI_CHIP_R350_NK */
|
||||
case 0x4148: /* PCI_CHIP_R350_AH */
|
||||
case 0x4149: /* PCI_CHIP_R350_AI */
|
||||
case 0x414A: /* PCI_CHIP_R350_AJ */
|
||||
case 0x414B: /* PCI_CHIP_R350_AK */
|
||||
case 0x4E4A: /* PCI_CHIP_R360_NJ */
|
||||
case 0x4150: /* PCI_CHIP_RV350_AP */
|
||||
case 0x4151: /* PCI_CHIP_RV350_AQ */
|
||||
case 0x4152: /* PCI_CHIP_RV350_AR */
|
||||
case 0x4153: /* PCI_CHIP_RV350_AS */
|
||||
case 0x4154: /* PCI_CHIP_RV350_AT */
|
||||
case 0x4155: /* PCI_CHIP_RV350_AU */
|
||||
case 0x4156: /* PCI_CHIP_RV350_AV */
|
||||
case 0x4E50: /* PCI_CHIP_RV350_NP */
|
||||
case 0x4E51: /* PCI_CHIP_RV350_NQ */
|
||||
case 0x4E52: /* PCI_CHIP_RV350_NR */
|
||||
case 0x4E53: /* PCI_CHIP_RV350_NS */
|
||||
case 0x4E54: /* PCI_CHIP_RV350_NT */
|
||||
case 0x4E56: /* PCI_CHIP_RV350_NV */
|
||||
case 0x5460: /* PCI_CHIP_RV370_5460 */
|
||||
case 0x5462: /* PCI_CHIP_RV370_5462 */
|
||||
case 0x5464: /* PCI_CHIP_RV370_5464 */
|
||||
case 0x5B60: /* PCI_CHIP_RV370_5B60 */
|
||||
case 0x5B62: /* PCI_CHIP_RV370_5B62 */
|
||||
case 0x5B63: /* PCI_CHIP_RV370_5B63 */
|
||||
case 0x5B64: /* PCI_CHIP_RV370_5B64 */
|
||||
case 0x5B65: /* PCI_CHIP_RV370_5B65 */
|
||||
case 0x3150: /* PCI_CHIP_RV380_3150 */
|
||||
case 0x3152: /* PCI_CHIP_RV380_3152 */
|
||||
case 0x3154: /* PCI_CHIP_RV380_3154 */
|
||||
case 0x3155: /* PCI_CHIP_RV380_3155 */
|
||||
case 0x3E50: /* PCI_CHIP_RV380_3E50 */
|
||||
case 0x3E54: /* PCI_CHIP_RV380_3E54 */
|
||||
case 0x4A48: /* PCI_CHIP_R420_JH */
|
||||
case 0x4A49: /* PCI_CHIP_R420_JI */
|
||||
case 0x4A4A: /* PCI_CHIP_R420_JJ */
|
||||
case 0x4A4B: /* PCI_CHIP_R420_JK */
|
||||
case 0x4A4C: /* PCI_CHIP_R420_JL */
|
||||
case 0x4A4D: /* PCI_CHIP_R420_JM */
|
||||
case 0x4A4E: /* PCI_CHIP_R420_JN */
|
||||
case 0x4A4F: /* PCI_CHIP_R420_JO */
|
||||
case 0x4A50: /* PCI_CHIP_R420_JP */
|
||||
case 0x4A54: /* PCI_CHIP_R420_JT */
|
||||
case 0x5548: /* PCI_CHIP_R423_UH */
|
||||
case 0x5549: /* PCI_CHIP_R423_UI */
|
||||
case 0x554A: /* PCI_CHIP_R423_UJ */
|
||||
case 0x554B: /* PCI_CHIP_R423_UK */
|
||||
case 0x5550: /* PCI_CHIP_R423_5550 */
|
||||
case 0x5551: /* PCI_CHIP_R423_UQ */
|
||||
case 0x5552: /* PCI_CHIP_R423_UR */
|
||||
case 0x5554: /* PCI_CHIP_R423_UT */
|
||||
case 0x5D57: /* PCI_CHIP_R423_5D57 */
|
||||
case 0x554C: /* PCI_CHIP_R430_554C */
|
||||
case 0x554D: /* PCI_CHIP_R430_554D */
|
||||
case 0x554E: /* PCI_CHIP_R430_554E */
|
||||
case 0x554F: /* PCI_CHIP_R430_554F */
|
||||
case 0x5D48: /* PCI_CHIP_R430_5D48 */
|
||||
case 0x5D49: /* PCI_CHIP_R430_5D49 */
|
||||
case 0x5D4A: /* PCI_CHIP_R430_5D4A */
|
||||
case 0x5D4C: /* PCI_CHIP_R480_5D4C */
|
||||
case 0x5D4D: /* PCI_CHIP_R480_5D4D */
|
||||
case 0x5D4E: /* PCI_CHIP_R480_5D4E */
|
||||
case 0x5D4F: /* PCI_CHIP_R480_5D4F */
|
||||
case 0x5D50: /* PCI_CHIP_R480_5D50 */
|
||||
case 0x5D52: /* PCI_CHIP_R480_5D52 */
|
||||
case 0x4B49: /* PCI_CHIP_R481_4B49 */
|
||||
case 0x4B4A: /* PCI_CHIP_R481_4B4A */
|
||||
case 0x4B4B: /* PCI_CHIP_R481_4B4B */
|
||||
case 0x4B4C: /* PCI_CHIP_R481_4B4C */
|
||||
case 0x564A: /* PCI_CHIP_RV410_564A */
|
||||
case 0x564B: /* PCI_CHIP_RV410_564B */
|
||||
case 0x564F: /* PCI_CHIP_RV410_564F */
|
||||
case 0x5652: /* PCI_CHIP_RV410_5652 */
|
||||
case 0x5653: /* PCI_CHIP_RV410_5653 */
|
||||
case 0x5657: /* PCI_CHIP_RV410_5657 */
|
||||
case 0x5E48: /* PCI_CHIP_RV410_5E48 */
|
||||
case 0x5E4A: /* PCI_CHIP_RV410_5E4A */
|
||||
case 0x5E4B: /* PCI_CHIP_RV410_5E4B */
|
||||
case 0x5E4C: /* PCI_CHIP_RV410_5E4C */
|
||||
case 0x5E4D: /* PCI_CHIP_RV410_5E4D */
|
||||
case 0x5E4F: /* PCI_CHIP_RV410_5E4F */
|
||||
case 0x5A41: /* PCI_CHIP_RS400_5A41 */
|
||||
case 0x5A42: /* PCI_CHIP_RS400_5A42 */
|
||||
case 0x5A61: /* PCI_CHIP_RC410_5A61 */
|
||||
case 0x5A62: /* PCI_CHIP_RC410_5A62 */
|
||||
case 0x5954: /* PCI_CHIP_RS480_5954 */
|
||||
case 0x5955: /* PCI_CHIP_RS480_5955 */
|
||||
case 0x5974: /* PCI_CHIP_RS482_5974 */
|
||||
case 0x5975: /* PCI_CHIP_RS482_5975 */
|
||||
case 0x7100: /* PCI_CHIP_R520_7100 */
|
||||
case 0x7101: /* PCI_CHIP_R520_7101 */
|
||||
case 0x7102: /* PCI_CHIP_R520_7102 */
|
||||
case 0x7103: /* PCI_CHIP_R520_7103 */
|
||||
case 0x7104: /* PCI_CHIP_R520_7104 */
|
||||
case 0x7105: /* PCI_CHIP_R520_7105 */
|
||||
case 0x7106: /* PCI_CHIP_R520_7106 */
|
||||
case 0x7108: /* PCI_CHIP_R520_7108 */
|
||||
case 0x7109: /* PCI_CHIP_R520_7109 */
|
||||
case 0x710A: /* PCI_CHIP_R520_710A */
|
||||
case 0x710B: /* PCI_CHIP_R520_710B */
|
||||
case 0x710C: /* PCI_CHIP_R520_710C */
|
||||
case 0x710E: /* PCI_CHIP_R520_710E */
|
||||
case 0x710F: /* PCI_CHIP_R520_710F */
|
||||
case 0x7140: /* PCI_CHIP_RV515_7140 */
|
||||
case 0x7141: /* PCI_CHIP_RV515_7141 */
|
||||
case 0x7142: /* PCI_CHIP_RV515_7142 */
|
||||
case 0x7143: /* PCI_CHIP_RV515_7143 */
|
||||
case 0x7144: /* PCI_CHIP_RV515_7144 */
|
||||
case 0x7145: /* PCI_CHIP_RV515_7145 */
|
||||
case 0x7146: /* PCI_CHIP_RV515_7146 */
|
||||
case 0x7147: /* PCI_CHIP_RV515_7147 */
|
||||
case 0x7149: /* PCI_CHIP_RV515_7149 */
|
||||
case 0x714A: /* PCI_CHIP_RV515_714A */
|
||||
case 0x714B: /* PCI_CHIP_RV515_714B */
|
||||
case 0x714C: /* PCI_CHIP_RV515_714C */
|
||||
case 0x714D: /* PCI_CHIP_RV515_714D */
|
||||
case 0x714E: /* PCI_CHIP_RV515_714E */
|
||||
case 0x714F: /* PCI_CHIP_RV515_714F */
|
||||
case 0x7151: /* PCI_CHIP_RV515_7151 */
|
||||
case 0x7152: /* PCI_CHIP_RV515_7152 */
|
||||
case 0x7153: /* PCI_CHIP_RV515_7153 */
|
||||
case 0x715E: /* PCI_CHIP_RV515_715E */
|
||||
case 0x715F: /* PCI_CHIP_RV515_715F */
|
||||
case 0x7180: /* PCI_CHIP_RV515_7180 */
|
||||
case 0x7181: /* PCI_CHIP_RV515_7181 */
|
||||
case 0x7183: /* PCI_CHIP_RV515_7183 */
|
||||
case 0x7186: /* PCI_CHIP_RV515_7186 */
|
||||
case 0x7187: /* PCI_CHIP_RV515_7187 */
|
||||
case 0x7188: /* PCI_CHIP_RV515_7188 */
|
||||
case 0x718A: /* PCI_CHIP_RV515_718A */
|
||||
case 0x718B: /* PCI_CHIP_RV515_718B */
|
||||
case 0x718C: /* PCI_CHIP_RV515_718C */
|
||||
case 0x718D: /* PCI_CHIP_RV515_718D */
|
||||
case 0x718F: /* PCI_CHIP_RV515_718F */
|
||||
case 0x7193: /* PCI_CHIP_RV515_7193 */
|
||||
case 0x7196: /* PCI_CHIP_RV515_7196 */
|
||||
case 0x719B: /* PCI_CHIP_RV515_719B */
|
||||
case 0x719F: /* PCI_CHIP_RV515_719F */
|
||||
case 0x7200: /* PCI_CHIP_RV515_7200 */
|
||||
case 0x7210: /* PCI_CHIP_RV515_7210 */
|
||||
case 0x7211: /* PCI_CHIP_RV515_7211 */
|
||||
case 0x71C0: /* PCI_CHIP_RV530_71C0 */
|
||||
case 0x71C1: /* PCI_CHIP_RV530_71C1 */
|
||||
case 0x71C2: /* PCI_CHIP_RV530_71C2 */
|
||||
case 0x71C3: /* PCI_CHIP_RV530_71C3 */
|
||||
case 0x71C4: /* PCI_CHIP_RV530_71C4 */
|
||||
case 0x71C5: /* PCI_CHIP_RV530_71C5 */
|
||||
case 0x71C6: /* PCI_CHIP_RV530_71C6 */
|
||||
case 0x71C7: /* PCI_CHIP_RV530_71C7 */
|
||||
case 0x71CD: /* PCI_CHIP_RV530_71CD */
|
||||
case 0x71CE: /* PCI_CHIP_RV530_71CE */
|
||||
case 0x71D2: /* PCI_CHIP_RV530_71D2 */
|
||||
case 0x71D4: /* PCI_CHIP_RV530_71D4 */
|
||||
case 0x71D5: /* PCI_CHIP_RV530_71D5 */
|
||||
case 0x71D6: /* PCI_CHIP_RV530_71D6 */
|
||||
case 0x71DA: /* PCI_CHIP_RV530_71DA */
|
||||
case 0x71DE: /* PCI_CHIP_RV530_71DE */
|
||||
case 0x7281: /* PCI_CHIP_RV560_7281 */
|
||||
case 0x7283: /* PCI_CHIP_RV560_7283 */
|
||||
case 0x7287: /* PCI_CHIP_RV560_7287 */
|
||||
case 0x7290: /* PCI_CHIP_RV560_7290 */
|
||||
case 0x7291: /* PCI_CHIP_RV560_7291 */
|
||||
case 0x7293: /* PCI_CHIP_RV560_7293 */
|
||||
case 0x7297: /* PCI_CHIP_RV560_7297 */
|
||||
case 0x7280: /* PCI_CHIP_RV570_7280 */
|
||||
case 0x7288: /* PCI_CHIP_RV570_7288 */
|
||||
case 0x7289: /* PCI_CHIP_RV570_7289 */
|
||||
case 0x728B: /* PCI_CHIP_RV570_728B */
|
||||
case 0x728C: /* PCI_CHIP_RV570_728C */
|
||||
case 0x7240: /* PCI_CHIP_R580_7240 */
|
||||
case 0x7243: /* PCI_CHIP_R580_7243 */
|
||||
case 0x7244: /* PCI_CHIP_R580_7244 */
|
||||
case 0x7245: /* PCI_CHIP_R580_7245 */
|
||||
case 0x7246: /* PCI_CHIP_R580_7246 */
|
||||
case 0x7247: /* PCI_CHIP_R580_7247 */
|
||||
case 0x7248: /* PCI_CHIP_R580_7248 */
|
||||
case 0x7249: /* PCI_CHIP_R580_7249 */
|
||||
case 0x724A: /* PCI_CHIP_R580_724A */
|
||||
case 0x724B: /* PCI_CHIP_R580_724B */
|
||||
case 0x724C: /* PCI_CHIP_R580_724C */
|
||||
case 0x724D: /* PCI_CHIP_R580_724D */
|
||||
case 0x724E: /* PCI_CHIP_R580_724E */
|
||||
case 0x724F: /* PCI_CHIP_R580_724F */
|
||||
case 0x7284: /* PCI_CHIP_R580_7284 */
|
||||
case 0x793F: /* PCI_CHIP_RS600_793F */
|
||||
case 0x7941: /* PCI_CHIP_RS600_7941 */
|
||||
case 0x7942: /* PCI_CHIP_RS600_7942 */
|
||||
case 0x791E: /* PCI_CHIP_RS690_791E */
|
||||
case 0x791F: /* PCI_CHIP_RS690_791F */
|
||||
case 0x796C: /* PCI_CHIP_RS740_796C */
|
||||
case 0x796D: /* PCI_CHIP_RS740_796D */
|
||||
case 0x796E: /* PCI_CHIP_RS740_796E */
|
||||
case 0x796F: /* PCI_CHIP_RS740_796F */
|
||||
return TRUE;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -16,6 +16,7 @@ GLCPP_SOURCES = \
|
||||
glcpp/glcpp.c
|
||||
|
||||
C_SOURCES = \
|
||||
strtod.c \
|
||||
$(LIBGLCPP_SOURCES)
|
||||
|
||||
CXX_SOURCES = \
|
||||
@@ -75,8 +76,10 @@ CXX_SOURCES = \
|
||||
loop_analysis.cpp \
|
||||
loop_controls.cpp \
|
||||
loop_unroll.cpp \
|
||||
lower_discard.cpp \
|
||||
lower_noise.cpp \
|
||||
lower_variable_index_to_cond_assign.cpp \
|
||||
opt_discard_simplification.cpp \
|
||||
opt_redundant_jumps.cpp \
|
||||
s_expression.cpp
|
||||
|
||||
@@ -177,7 +180,7 @@ builtins: builtin_function.cpp builtins/profiles/* builtins/ir/* builtins/tools/
|
||||
cp builtins/tools/builtin_function.cpp .
|
||||
make glsl_compiler
|
||||
@echo Regenerating builtin_function.cpp...
|
||||
./builtins/tools/generate_builtins.py > builtin_function.cpp
|
||||
$(PYTHON2) $(PYTHON_FLAGS) builtins/tools/generate_builtins.py > builtin_function.cpp
|
||||
@echo Rebuilding the real compiler...
|
||||
make glsl_compiler
|
||||
|
||||
|
@@ -72,10 +72,13 @@ sources = [
|
||||
'loop_analysis.cpp',
|
||||
'loop_controls.cpp',
|
||||
'loop_unroll.cpp',
|
||||
'lower_discard.cpp',
|
||||
'lower_noise.cpp',
|
||||
'lower_variable_index_to_cond_assign.cpp',
|
||||
'opt_discard_simplification.cpp',
|
||||
'opt_redundant_jumps.cpp',
|
||||
's_expression.cpp',
|
||||
'strtod.c',
|
||||
]
|
||||
|
||||
glsl = env.ConvenienceLibrary(
|
||||
|
@@ -545,7 +545,7 @@ emit_inline_vector_constructor(const glsl_type *type,
|
||||
/* Mask of fields to be written in the assignment.
|
||||
*/
|
||||
constant_mask |= ((1U << rhs_components) - 1) << base_lhs_component;
|
||||
constant_components++;
|
||||
constant_components += rhs_components;
|
||||
|
||||
base_component += rhs_components;
|
||||
}
|
||||
|
@@ -615,6 +615,94 @@ ast_node::hir(exec_list *instructions,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
mark_whole_array_access(ir_rvalue *access)
|
||||
{
|
||||
ir_dereference_variable *deref = access->as_dereference_variable();
|
||||
|
||||
if (deref) {
|
||||
deref->var->max_array_access = deref->type->length - 1;
|
||||
}
|
||||
}
|
||||
|
||||
static ir_rvalue *
|
||||
do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1)
|
||||
{
|
||||
int join_op;
|
||||
ir_rvalue *cmp = NULL;
|
||||
|
||||
if (operation == ir_binop_all_equal)
|
||||
join_op = ir_binop_logic_and;
|
||||
else
|
||||
join_op = ir_binop_logic_or;
|
||||
|
||||
switch (op0->type->base_type) {
|
||||
case GLSL_TYPE_FLOAT:
|
||||
case GLSL_TYPE_UINT:
|
||||
case GLSL_TYPE_INT:
|
||||
case GLSL_TYPE_BOOL:
|
||||
return new(mem_ctx) ir_expression(operation, op0, op1);
|
||||
|
||||
case GLSL_TYPE_ARRAY: {
|
||||
for (unsigned int i = 0; i < op0->type->length; i++) {
|
||||
ir_rvalue *e0, *e1, *result;
|
||||
|
||||
e0 = new(mem_ctx) ir_dereference_array(op0->clone(mem_ctx, NULL),
|
||||
new(mem_ctx) ir_constant(i));
|
||||
e1 = new(mem_ctx) ir_dereference_array(op1->clone(mem_ctx, NULL),
|
||||
new(mem_ctx) ir_constant(i));
|
||||
result = do_comparison(mem_ctx, operation, e0, e1);
|
||||
|
||||
if (cmp) {
|
||||
cmp = new(mem_ctx) ir_expression(join_op, cmp, result);
|
||||
} else {
|
||||
cmp = result;
|
||||
}
|
||||
}
|
||||
|
||||
mark_whole_array_access(op0);
|
||||
mark_whole_array_access(op1);
|
||||
break;
|
||||
}
|
||||
|
||||
case GLSL_TYPE_STRUCT: {
|
||||
for (unsigned int i = 0; i < op0->type->length; i++) {
|
||||
ir_rvalue *e0, *e1, *result;
|
||||
const char *field_name = op0->type->fields.structure[i].name;
|
||||
|
||||
e0 = new(mem_ctx) ir_dereference_record(op0->clone(mem_ctx, NULL),
|
||||
field_name);
|
||||
e1 = new(mem_ctx) ir_dereference_record(op1->clone(mem_ctx, NULL),
|
||||
field_name);
|
||||
result = do_comparison(mem_ctx, operation, e0, e1);
|
||||
|
||||
if (cmp) {
|
||||
cmp = new(mem_ctx) ir_expression(join_op, cmp, result);
|
||||
} else {
|
||||
cmp = result;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GLSL_TYPE_ERROR:
|
||||
case GLSL_TYPE_VOID:
|
||||
case GLSL_TYPE_SAMPLER:
|
||||
/* I assume a comparison of a struct containing a sampler just
|
||||
* ignores the sampler present in the type.
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(!"Should not get here.");
|
||||
break;
|
||||
}
|
||||
|
||||
if (cmp == NULL)
|
||||
cmp = new(mem_ctx) ir_constant(true);
|
||||
|
||||
return cmp;
|
||||
}
|
||||
|
||||
ir_rvalue *
|
||||
ast_expression::hir(exec_list *instructions,
|
||||
@@ -800,11 +888,10 @@ ast_expression::hir(exec_list *instructions,
|
||||
error_emitted = true;
|
||||
}
|
||||
|
||||
result = new(ctx) ir_expression(operations[this->oper], glsl_type::bool_type,
|
||||
op[0], op[1]);
|
||||
result = do_comparison(ctx, operations[this->oper], op[0], op[1]);
|
||||
type = glsl_type::bool_type;
|
||||
|
||||
assert(result->type == glsl_type::bool_type);
|
||||
assert(error_emitted || (result->type == glsl_type::bool_type));
|
||||
break;
|
||||
|
||||
case ast_bit_and:
|
||||
@@ -1954,10 +2041,37 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
|
||||
/* Never emit code to initialize a uniform.
|
||||
*/
|
||||
if (!this->type->qualifier.uniform)
|
||||
const glsl_type *initializer_type;
|
||||
if (!this->type->qualifier.uniform) {
|
||||
result = do_assignment(&initializer_instructions, state,
|
||||
lhs, rhs,
|
||||
this->get_location());
|
||||
initializer_type = result->type;
|
||||
} else
|
||||
initializer_type = rhs->type;
|
||||
|
||||
/* If the declared variable is an unsized array, it must inherrit
|
||||
* its full type from the initializer. A declaration such as
|
||||
*
|
||||
* uniform float a[] = float[](1.0, 2.0, 3.0, 3.0);
|
||||
*
|
||||
* becomes
|
||||
*
|
||||
* uniform float a[4] = float[](1.0, 2.0, 3.0, 3.0);
|
||||
*
|
||||
* The assignment generated in the if-statement (below) will also
|
||||
* automatically handle this case for non-uniforms.
|
||||
*
|
||||
* If the declared variable is not an array, the types must
|
||||
* already match exactly. As a result, the type assignment
|
||||
* here can be done unconditionally. For non-uniforms the call
|
||||
* to do_assignment can change the type of the initializer (via
|
||||
* the implicit conversion rules). For uniforms the initializer
|
||||
* must be a constant expression, and the type of that expression
|
||||
* was validated above.
|
||||
*/
|
||||
var->type = initializer_type;
|
||||
|
||||
var->read_only = temp;
|
||||
}
|
||||
}
|
||||
@@ -2021,7 +2135,7 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
earlier->type = var->type;
|
||||
delete var;
|
||||
var = NULL;
|
||||
} else if (state->extensions->ARB_fragment_coord_conventions
|
||||
} else if (state->ARB_fragment_coord_conventions_enable
|
||||
&& strcmp(var->name, "gl_FragCoord") == 0
|
||||
&& earlier->type == var->type
|
||||
&& earlier->mode == var->mode) {
|
||||
@@ -2447,8 +2561,7 @@ ast_jump_statement::hir(exec_list *instructions,
|
||||
state->current_function->function_name());
|
||||
}
|
||||
|
||||
ir_expression *const ret = (ir_expression *)
|
||||
opt_return_value->hir(instructions, state);
|
||||
ir_rvalue *const ret = opt_return_value->hir(instructions, state);
|
||||
assert(ret != NULL);
|
||||
|
||||
/* Implicit conversions are not allowed for return values. */
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -273,9 +273,9 @@ const glsl_type glsl_type::builtin_ARB_texture_rectangle_types[] = {
|
||||
const glsl_type glsl_type::builtin_EXT_texture_array_types[] = {
|
||||
glsl_type(GL_SAMPLER_1D_ARRAY,
|
||||
GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_FLOAT, "sampler1DArray"),
|
||||
glsl_type(GL_SAMPLER_1D_ARRAY_SHADOW,
|
||||
GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_FLOAT, "sampler2DArray"),
|
||||
glsl_type(GL_SAMPLER_2D_ARRAY,
|
||||
GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_FLOAT, "sampler2DArray"),
|
||||
glsl_type(GL_SAMPLER_1D_ARRAY_SHADOW,
|
||||
GLSL_SAMPLER_DIM_1D, 1, 1, GLSL_TYPE_FLOAT, "sampler1DArrayShadow"),
|
||||
glsl_type(GL_SAMPLER_2D_ARRAY_SHADOW,
|
||||
GLSL_SAMPLER_DIM_2D, 1, 1, GLSL_TYPE_FLOAT, "sampler2DArrayShadow"),
|
||||
|
@@ -5,40 +5,26 @@
|
||||
(declare (in) float edge1)
|
||||
(declare (in) float x))
|
||||
((declare () float t)
|
||||
|
||||
(assign (constant bool (1)) (x) (var_ref t)
|
||||
(expression float max
|
||||
(expression float min
|
||||
(expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (var_ref t))))))))
|
||||
|
||||
(return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.0)) (expression float * (constant float (2.0)) (var_ref t))))))))
|
||||
(signature vec2
|
||||
(parameters
|
||||
(declare (in) float edge0)
|
||||
(declare (in) float edge1)
|
||||
(declare (in) vec2 x))
|
||||
((declare () vec2 t)
|
||||
(declare () vec2 retval)
|
||||
|
||||
(assign (constant bool (1)) (x) (var_ref t)
|
||||
(expression float max
|
||||
(expression float min
|
||||
(expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(assign (constant bool (1)) (xy) (var_ref t)
|
||||
(expression vec2 max
|
||||
(expression vec2 min
|
||||
(expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))
|
||||
|
||||
(assign (constant bool (1)) (y) (var_ref t)
|
||||
(expression float max
|
||||
(expression float min
|
||||
(expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))
|
||||
(return (var_ref retval))
|
||||
))
|
||||
(return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t))))))))
|
||||
|
||||
(signature vec3
|
||||
(parameters
|
||||
@@ -46,33 +32,13 @@
|
||||
(declare (in) float edge1)
|
||||
(declare (in) vec3 x))
|
||||
((declare () vec3 t)
|
||||
(declare () vec3 retval)
|
||||
|
||||
(assign (constant bool (1)) (x) (var_ref t)
|
||||
(expression float max
|
||||
(expression float min
|
||||
(expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(assign (constant bool (1)) (xyz) (var_ref t)
|
||||
(expression vec3 max
|
||||
(expression vec3 min
|
||||
(expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))
|
||||
|
||||
(assign (constant bool (1)) (y) (var_ref t)
|
||||
(expression float max
|
||||
(expression float min
|
||||
(expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))
|
||||
|
||||
(assign (constant bool (1)) (z) (var_ref t)
|
||||
(expression float max
|
||||
(expression float min
|
||||
(expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(assign (constant bool (1)) (z) (var_ref retval) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))
|
||||
(return (var_ref retval))
|
||||
))
|
||||
(return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t))))))))
|
||||
|
||||
|
||||
(signature vec4
|
||||
@@ -81,73 +47,54 @@
|
||||
(declare (in) float edge1)
|
||||
(declare (in) vec4 x))
|
||||
((declare () vec4 t)
|
||||
(declare () vec4 retval)
|
||||
|
||||
(assign (constant bool (1)) (x) (var_ref t)
|
||||
(expression float max
|
||||
(expression float min
|
||||
(expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(assign (constant bool (1)) (xyzw) (var_ref t)
|
||||
(expression vec4 max
|
||||
(expression vec4 min
|
||||
(expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))
|
||||
|
||||
(assign (constant bool (1)) (y) (var_ref t)
|
||||
(expression float max
|
||||
(expression float min
|
||||
(expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))
|
||||
|
||||
(assign (constant bool (1)) (z) (var_ref t)
|
||||
(expression float max
|
||||
(expression float min
|
||||
(expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(assign (constant bool (1)) (z) (var_ref retval) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))
|
||||
|
||||
(assign (constant bool (1)) (w) (var_ref t)
|
||||
(expression float max
|
||||
(expression float min
|
||||
(expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(assign (constant bool (1)) (w) (var_ref retval) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))
|
||||
(return (var_ref retval))
|
||||
))
|
||||
(return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t))))))))
|
||||
|
||||
(signature vec2
|
||||
(parameters
|
||||
(declare (in) vec2 edge0)
|
||||
(declare (in) vec2 edge1)
|
||||
(declare (in) vec2 x))
|
||||
((return (expression vec2 max
|
||||
((declare () vec2 t)
|
||||
(assign (constant bool (1)) (xy) (var_ref t)
|
||||
(expression vec2 max
|
||||
(expression vec2 min
|
||||
(expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0)))
|
||||
(constant vec2 (1.0 1.0)))
|
||||
(constant vec2 (0.0 0.0))))))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t))))))))
|
||||
|
||||
(signature vec3
|
||||
(parameters
|
||||
(declare (in) vec3 edge0)
|
||||
(declare (in) vec3 edge1)
|
||||
(declare (in) vec3 x))
|
||||
((return (expression vec3 max
|
||||
((declare () vec3 t)
|
||||
(assign (constant bool (1)) (xyz) (var_ref t)
|
||||
(expression vec3 max
|
||||
(expression vec3 min
|
||||
(expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0)))
|
||||
(constant vec3 (1.0 1.0 1.0)))
|
||||
(constant vec3 (0.0 0.0 0.0))))))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t))))))))
|
||||
|
||||
(signature vec4
|
||||
(parameters
|
||||
(declare (in) vec4 edge0)
|
||||
(declare (in) vec4 edge1)
|
||||
(declare (in) vec4 x))
|
||||
((return (expression vec4 max
|
||||
((declare () vec4 t)
|
||||
(assign (constant bool (1)) (xyzw) (var_ref t)
|
||||
(expression vec4 max
|
||||
(expression vec4 min
|
||||
(expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0)))
|
||||
(constant vec4 (1.0 1.0 1.0 1.0)))
|
||||
(constant vec4 (0.0 0.0 0.0 0.0))))))
|
||||
(constant float (1.0)))
|
||||
(constant float (0.0))))
|
||||
(return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t))))))))
|
||||
))
|
||||
|
||||
|
@@ -25,13 +25,25 @@ def get_builtin_definitions():
|
||||
return fs
|
||||
|
||||
def stringify(s):
|
||||
# Work around MSVC's 65535 byte limit by outputting an array of characters
|
||||
# rather than actual string literals.
|
||||
if len(s) >= 65535:
|
||||
#t = "/* Warning: length " + repr(len(s)) + " too large */\n"
|
||||
t = ""
|
||||
for c in re.sub('\s\s+', ' ', s):
|
||||
if c == '\n':
|
||||
t += '\n'
|
||||
else:
|
||||
t += "'" + c + "',"
|
||||
return '{' + t[:-1] + '}'
|
||||
|
||||
t = s.replace('\\', '\\\\').replace('"', '\\"').replace('\n', '\\n"\n "')
|
||||
return ' "' + t + '"\n'
|
||||
|
||||
def write_function_definitions():
|
||||
fs = get_builtin_definitions()
|
||||
for k, v in sorted(fs.iteritems()):
|
||||
print 'static const char *builtin_' + k + ' ='
|
||||
print 'static const char builtin_' + k + '[] ='
|
||||
print stringify(v), ';'
|
||||
|
||||
def run_compiler(args):
|
||||
@@ -64,7 +76,7 @@ def write_profile(filename, profile):
|
||||
# clutter the diff output.
|
||||
proto_ir = re.sub(r'@0x[0-9a-f]+', '', proto_ir);
|
||||
|
||||
print 'static const char *prototypes_for_' + profile + ' ='
|
||||
print 'static const char prototypes_for_' + profile + '[] ='
|
||||
print stringify(proto_ir), ';'
|
||||
|
||||
# Print a table of all the functions (not signatures) referenced.
|
||||
|
@@ -1109,7 +1109,7 @@ case 4:
|
||||
/* rule 4 can match eol */
|
||||
YY_RULE_SETUP
|
||||
#line 85 "glcpp/glcpp-lex.l"
|
||||
{ yylineno++; yycolumn = 0; }
|
||||
{ yylineno++; yycolumn = 0; return NEWLINE; }
|
||||
YY_BREAK
|
||||
case 5:
|
||||
YY_RULE_SETUP
|
||||
@@ -1120,7 +1120,7 @@ case 6:
|
||||
/* rule 6 can match eol */
|
||||
YY_RULE_SETUP
|
||||
#line 87 "glcpp/glcpp-lex.l"
|
||||
{ yylineno++; yycolumn = 0; }
|
||||
{ yylineno++; yycolumn = 0; return NEWLINE; }
|
||||
YY_BREAK
|
||||
case 7:
|
||||
YY_RULE_SETUP
|
||||
|
@@ -82,9 +82,9 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
|
||||
/* Multi-line comments */
|
||||
"/*" { yy_push_state(COMMENT, yyscanner); }
|
||||
<COMMENT>[^*\n]*
|
||||
<COMMENT>[^*\n]*\n { yylineno++; yycolumn = 0; }
|
||||
<COMMENT>[^*\n]*\n { yylineno++; yycolumn = 0; return NEWLINE; }
|
||||
<COMMENT>"*"+[^*/\n]*
|
||||
<COMMENT>"*"+[^*/\n]*\n { yylineno++; yycolumn = 0; }
|
||||
<COMMENT>"*"+[^*/\n]*\n { yylineno++; yycolumn = 0; return NEWLINE; }
|
||||
<COMMENT>"*"+"/" {
|
||||
yy_pop_state(yyscanner);
|
||||
if (yyextra->space_tokens)
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,10 @@
|
||||
/* A Bison parser, made by GNU Bison 2.4.3. */
|
||||
|
||||
/* A Bison parser, made by GNU Bison 2.4.1. */
|
||||
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@@ -320,6 +320,14 @@ control_line:
|
||||
if ($2 == 100)
|
||||
add_builtin_define (parser, "GL_ES", 1);
|
||||
|
||||
/* Currently, all ES2 implementations support highp in the
|
||||
* fragment shader, so we always define this macro in ES2.
|
||||
* If we ever get a driver that doesn't support highp, we'll
|
||||
* need to add a flag to the gl_context and check that here.
|
||||
*/
|
||||
if ($2 >= 130 || $2 == 100)
|
||||
add_builtin_define (parser, "GL_FRAGMENT_PRECISION_HIGH", 1);
|
||||
|
||||
glcpp_printf(parser->output, "#version %" PRIiMAX, $2);
|
||||
}
|
||||
| HASH NEWLINE
|
||||
@@ -464,7 +472,6 @@ conditional_token:
|
||||
conditional_tokens:
|
||||
/* Exactly the same as pp_tokens, but using conditional_token */
|
||||
conditional_token {
|
||||
parser->space_tokens = 1;
|
||||
$$ = _token_list_create (parser);
|
||||
_token_list_append ($$, $1);
|
||||
talloc_unlink (parser, $1);
|
||||
|
@@ -29,9 +29,17 @@
|
||||
#include <errno.h>
|
||||
#include "glcpp.h"
|
||||
#include "main/mtypes.h"
|
||||
#include "main/shaderobj.h"
|
||||
|
||||
extern int yydebug;
|
||||
|
||||
void
|
||||
_mesa_reference_shader(GLcontext *ctx, struct gl_shader **ptr,
|
||||
struct gl_shader *sh)
|
||||
{
|
||||
*ptr = sh;
|
||||
}
|
||||
|
||||
/* Read from fd until EOF and return a string of everything read.
|
||||
*/
|
||||
static char *
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,7 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <ctype.h>
|
||||
#include "strtod.h"
|
||||
#include "ast.h"
|
||||
#include "glsl_parser_extras.h"
|
||||
#include "glsl_parser.h"
|
||||
@@ -243,7 +244,7 @@ layout {
|
||||
\<\<= return LEFT_ASSIGN;
|
||||
>>= return RIGHT_ASSIGN;
|
||||
&= return AND_ASSIGN;
|
||||
^= return XOR_ASSIGN;
|
||||
"^=" return XOR_ASSIGN;
|
||||
\|= return OR_ASSIGN;
|
||||
-= return SUB_ASSIGN;
|
||||
|
||||
@@ -261,23 +262,23 @@ layout {
|
||||
}
|
||||
|
||||
[0-9]+\.[0-9]+([eE][+-]?[0-9]+)?[fF]? {
|
||||
yylval->real = strtod(yytext, NULL);
|
||||
yylval->real = glsl_strtod(yytext, NULL);
|
||||
return FLOATCONSTANT;
|
||||
}
|
||||
\.[0-9]+([eE][+-]?[0-9]+)?[fF]? {
|
||||
yylval->real = strtod(yytext, NULL);
|
||||
yylval->real = glsl_strtod(yytext, NULL);
|
||||
return FLOATCONSTANT;
|
||||
}
|
||||
[0-9]+\.([eE][+-]?[0-9]+)?[fF]? {
|
||||
yylval->real = strtod(yytext, NULL);
|
||||
yylval->real = glsl_strtod(yytext, NULL);
|
||||
return FLOATCONSTANT;
|
||||
}
|
||||
[0-9]+[eE][+-]?[0-9]+[fF]? {
|
||||
yylval->real = strtod(yytext, NULL);
|
||||
yylval->real = glsl_strtod(yytext, NULL);
|
||||
return FLOATCONSTANT;
|
||||
}
|
||||
[0-9]+[fF] {
|
||||
yylval->real = strtod(yytext, NULL);
|
||||
yylval->real = glsl_strtod(yytext, NULL);
|
||||
return FLOATCONSTANT;
|
||||
}
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/* A Bison parser, made by GNU Bison 2.4.3. */
|
||||
/* A Bison parser, made by GNU Bison 2.4.2. */
|
||||
|
||||
/* Skeleton implementation for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -45,7 +45,7 @@
|
||||
#define YYBISON 1
|
||||
|
||||
/* Bison version. */
|
||||
#define YYBISON_VERSION "2.4.3"
|
||||
#define YYBISON_VERSION "2.4.2"
|
||||
|
||||
/* Skeleton name. */
|
||||
#define YYSKELETON_NAME "yacc.c"
|
||||
@@ -2621,7 +2621,7 @@ YYLTYPE yylloc;
|
||||
YYLTYPE *yylsp;
|
||||
|
||||
/* The locations where the error started and ended. */
|
||||
YYLTYPE yyerror_range[3];
|
||||
YYLTYPE yyerror_range[2];
|
||||
|
||||
YYSIZE_T yystacksize;
|
||||
|
||||
@@ -5084,7 +5084,7 @@ yyerrlab:
|
||||
#endif
|
||||
}
|
||||
|
||||
yyerror_range[1] = yylloc;
|
||||
yyerror_range[0] = yylloc;
|
||||
|
||||
if (yyerrstatus == 3)
|
||||
{
|
||||
@@ -5121,7 +5121,7 @@ yyerrorlab:
|
||||
if (/*CONSTCOND*/ 0)
|
||||
goto yyerrorlab;
|
||||
|
||||
yyerror_range[1] = yylsp[1-yylen];
|
||||
yyerror_range[0] = yylsp[1-yylen];
|
||||
/* Do not reclaim the symbols of the rule which action triggered
|
||||
this YYERROR. */
|
||||
YYPOPSTACK (yylen);
|
||||
@@ -5155,7 +5155,7 @@ yyerrlab1:
|
||||
if (yyssp == yyss)
|
||||
YYABORT;
|
||||
|
||||
yyerror_range[1] = *yylsp;
|
||||
yyerror_range[0] = *yylsp;
|
||||
yydestruct ("Error: popping",
|
||||
yystos[yystate], yyvsp, yylsp, state);
|
||||
YYPOPSTACK (1);
|
||||
@@ -5165,10 +5165,10 @@ yyerrlab1:
|
||||
|
||||
*++yyvsp = yylval;
|
||||
|
||||
yyerror_range[2] = yylloc;
|
||||
yyerror_range[1] = yylloc;
|
||||
/* Using YYLLOC is tempting, but would change the location of
|
||||
the lookahead. YYLOC is available though. */
|
||||
YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
|
||||
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
|
||||
*++yylsp = yyloc;
|
||||
|
||||
/* Shift the error token. */
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/* A Bison parser, made by GNU Bison 2.4.3. */
|
||||
/* A Bison parser, made by GNU Bison 2.4.2. */
|
||||
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@@ -702,6 +702,7 @@ do_common_optimization(exec_list *ir, bool linked, unsigned max_unroll_iteration
|
||||
}
|
||||
progress = do_structure_splitting(ir) || progress;
|
||||
progress = do_if_simplification(ir) || progress;
|
||||
progress = do_discard_simplification(ir) || progress;
|
||||
progress = do_copy_propagation(ir) || progress;
|
||||
if (linked)
|
||||
progress = do_dead_code(ir) || progress;
|
||||
|
188
src/glsl/ir.cpp
188
src/glsl/ir.cpp
@@ -176,9 +176,22 @@ ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs,
|
||||
}
|
||||
|
||||
|
||||
ir_expression::ir_expression(int op, const struct glsl_type *type,
|
||||
ir_rvalue *op0)
|
||||
{
|
||||
assert(get_num_operands(ir_expression_operation(op)) == 1);
|
||||
this->ir_type = ir_type_expression;
|
||||
this->type = type;
|
||||
this->operation = ir_expression_operation(op);
|
||||
this->operands[0] = op0;
|
||||
this->operands[1] = NULL;
|
||||
}
|
||||
|
||||
ir_expression::ir_expression(int op, const struct glsl_type *type,
|
||||
ir_rvalue *op0, ir_rvalue *op1)
|
||||
{
|
||||
assert((op1 == NULL) && (get_num_operands(ir_expression_operation(op)) == 1)
|
||||
|| (get_num_operands(ir_expression_operation(op)) == 2));
|
||||
this->ir_type = ir_type_expression;
|
||||
this->type = type;
|
||||
this->operation = ir_expression_operation(op);
|
||||
@@ -186,81 +199,116 @@ ir_expression::ir_expression(int op, const struct glsl_type *type,
|
||||
this->operands[1] = op1;
|
||||
}
|
||||
|
||||
ir_expression::ir_expression(int op, ir_rvalue *op0)
|
||||
{
|
||||
this->ir_type = ir_type_expression;
|
||||
|
||||
this->operation = ir_expression_operation(op);
|
||||
this->operands[0] = op0;
|
||||
this->operands[1] = NULL;
|
||||
|
||||
assert(op <= ir_last_unop);
|
||||
|
||||
switch (this->operation) {
|
||||
case ir_unop_bit_not:
|
||||
case ir_unop_logic_not:
|
||||
case ir_unop_neg:
|
||||
case ir_unop_abs:
|
||||
case ir_unop_sign:
|
||||
case ir_unop_rcp:
|
||||
case ir_unop_rsq:
|
||||
case ir_unop_sqrt:
|
||||
case ir_unop_exp:
|
||||
case ir_unop_log:
|
||||
case ir_unop_exp2:
|
||||
case ir_unop_log2:
|
||||
case ir_unop_trunc:
|
||||
case ir_unop_ceil:
|
||||
case ir_unop_floor:
|
||||
case ir_unop_fract:
|
||||
case ir_unop_cos:
|
||||
case ir_unop_dFdx:
|
||||
case ir_unop_dFdy:
|
||||
this->type = op0->type;
|
||||
break;
|
||||
|
||||
case ir_unop_any:
|
||||
this->type = glsl_type::bool_type;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(!"not reached: missing automatic type setup for ir_expression");
|
||||
this->type = op0->type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
|
||||
{
|
||||
this->ir_type = ir_type_expression;
|
||||
|
||||
this->operation = ir_expression_operation(op);
|
||||
this->operands[0] = op0;
|
||||
this->operands[1] = op1;
|
||||
|
||||
assert(op > ir_last_unop);
|
||||
|
||||
switch (this->operation) {
|
||||
case ir_binop_all_equal:
|
||||
case ir_binop_any_nequal:
|
||||
this->type = glsl_type::bool_type;
|
||||
break;
|
||||
|
||||
case ir_binop_add:
|
||||
case ir_binop_sub:
|
||||
case ir_binop_min:
|
||||
case ir_binop_max:
|
||||
case ir_binop_pow:
|
||||
case ir_binop_mul:
|
||||
if (op0->type->is_scalar()) {
|
||||
this->type = op1->type;
|
||||
} else if (op1->type->is_scalar()) {
|
||||
this->type = op0->type;
|
||||
} else {
|
||||
/* FINISHME: matrix types */
|
||||
assert(!op0->type->is_matrix() && !op1->type->is_matrix());
|
||||
assert(op0->type == op1->type);
|
||||
this->type = op0->type;
|
||||
}
|
||||
break;
|
||||
|
||||
case ir_binop_logic_and:
|
||||
case ir_binop_logic_or:
|
||||
if (op0->type->is_scalar()) {
|
||||
this->type = op1->type;
|
||||
} else if (op1->type->is_scalar()) {
|
||||
this->type = op0->type;
|
||||
}
|
||||
break;
|
||||
|
||||
case ir_binop_dot:
|
||||
this->type = glsl_type::float_type;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(!"not reached: missing automatic type setup for ir_expression");
|
||||
this->type = glsl_type::float_type;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int
|
||||
ir_expression::get_num_operands(ir_expression_operation op)
|
||||
{
|
||||
/* Update ir_print_visitor.cpp when updating this list. */
|
||||
const int num_operands[] = {
|
||||
1, /* ir_unop_bit_not */
|
||||
1, /* ir_unop_logic_not */
|
||||
1, /* ir_unop_neg */
|
||||
1, /* ir_unop_abs */
|
||||
1, /* ir_unop_sign */
|
||||
1, /* ir_unop_rcp */
|
||||
1, /* ir_unop_rsq */
|
||||
1, /* ir_unop_sqrt */
|
||||
1, /* ir_unop_exp */
|
||||
1, /* ir_unop_log */
|
||||
1, /* ir_unop_exp2 */
|
||||
1, /* ir_unop_log2 */
|
||||
1, /* ir_unop_f2i */
|
||||
1, /* ir_unop_i2f */
|
||||
1, /* ir_unop_f2b */
|
||||
1, /* ir_unop_b2f */
|
||||
1, /* ir_unop_i2b */
|
||||
1, /* ir_unop_b2i */
|
||||
1, /* ir_unop_u2f */
|
||||
1, /* ir_unop_any */
|
||||
assert(op <= ir_last_opcode);
|
||||
|
||||
1, /* ir_unop_trunc */
|
||||
1, /* ir_unop_ceil */
|
||||
1, /* ir_unop_floor */
|
||||
1, /* ir_unop_fract */
|
||||
if (op <= ir_last_unop)
|
||||
return 1;
|
||||
|
||||
1, /* ir_unop_sin */
|
||||
1, /* ir_unop_cos */
|
||||
if (op <= ir_last_binop)
|
||||
return 2;
|
||||
|
||||
1, /* ir_unop_dFdx */
|
||||
1, /* ir_unop_dFdy */
|
||||
|
||||
1, /* ir_unop_noise */
|
||||
|
||||
2, /* ir_binop_add */
|
||||
2, /* ir_binop_sub */
|
||||
2, /* ir_binop_mul */
|
||||
2, /* ir_binop_div */
|
||||
2, /* ir_binop_mod */
|
||||
|
||||
2, /* ir_binop_less */
|
||||
2, /* ir_binop_greater */
|
||||
2, /* ir_binop_lequal */
|
||||
2, /* ir_binop_gequal */
|
||||
2, /* ir_binop_equal */
|
||||
2, /* ir_binop_nequal */
|
||||
2, /* ir_binop_all_equal */
|
||||
2, /* ir_binop_any_nequal */
|
||||
|
||||
2, /* ir_binop_lshift */
|
||||
2, /* ir_binop_rshift */
|
||||
2, /* ir_binop_bit_and */
|
||||
2, /* ir_binop_bit_xor */
|
||||
2, /* ir_binop_bit_or */
|
||||
|
||||
2, /* ir_binop_logic_and */
|
||||
2, /* ir_binop_logic_xor */
|
||||
2, /* ir_binop_logic_or */
|
||||
|
||||
2, /* ir_binop_dot */
|
||||
2, /* ir_binop_cross */
|
||||
2, /* ir_binop_min */
|
||||
2, /* ir_binop_max */
|
||||
|
||||
2, /* ir_binop_pow */
|
||||
};
|
||||
|
||||
assert(sizeof(num_operands) / sizeof(num_operands[0]) == ir_binop_pow + 1);
|
||||
|
||||
return num_operands[op];
|
||||
assert(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char *const operator_strs[] = {
|
||||
@@ -687,7 +735,7 @@ ir_constant::has_value(const ir_constant *c) const
|
||||
|
||||
if (this->type->is_array()) {
|
||||
for (unsigned i = 0; i < this->type->length; i++) {
|
||||
if (this->array_elements[i]->has_value(c->array_elements[i]))
|
||||
if (!this->array_elements[i]->has_value(c->array_elements[i]))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@@ -125,6 +125,7 @@ public:
|
||||
virtual class ir_if * as_if() { return NULL; }
|
||||
virtual class ir_swizzle * as_swizzle() { return NULL; }
|
||||
virtual class ir_constant * as_constant() { return NULL; }
|
||||
virtual class ir_discard * as_discard() { return NULL; }
|
||||
/*@}*/
|
||||
|
||||
protected:
|
||||
@@ -711,6 +712,11 @@ enum ir_expression_operation {
|
||||
|
||||
ir_unop_noise,
|
||||
|
||||
/**
|
||||
* A sentinel marking the last of the unary operations.
|
||||
*/
|
||||
ir_last_unop = ir_unop_noise,
|
||||
|
||||
ir_binop_add,
|
||||
ir_binop_sub,
|
||||
ir_binop_mul,
|
||||
@@ -769,13 +775,33 @@ enum ir_expression_operation {
|
||||
ir_binop_min,
|
||||
ir_binop_max,
|
||||
|
||||
ir_binop_pow
|
||||
ir_binop_pow,
|
||||
|
||||
/**
|
||||
* A sentinel marking the last of the binary operations.
|
||||
*/
|
||||
ir_last_binop = ir_binop_pow,
|
||||
|
||||
/**
|
||||
* A sentinel marking the last of all operations.
|
||||
*/
|
||||
ir_last_opcode = ir_last_binop
|
||||
};
|
||||
|
||||
class ir_expression : public ir_rvalue {
|
||||
public:
|
||||
/**
|
||||
* Constructor for unary operation expressions
|
||||
*/
|
||||
ir_expression(int op, const struct glsl_type *type, ir_rvalue *);
|
||||
ir_expression(int op, ir_rvalue *);
|
||||
|
||||
/**
|
||||
* Constructor for binary operation expressions
|
||||
*/
|
||||
ir_expression(int op, const struct glsl_type *type,
|
||||
ir_rvalue *, ir_rvalue *);
|
||||
ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1);
|
||||
|
||||
virtual ir_expression *as_expression()
|
||||
{
|
||||
@@ -1044,6 +1070,11 @@ public:
|
||||
|
||||
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
|
||||
|
||||
virtual ir_discard *as_discard()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
ir_rvalue *condition;
|
||||
};
|
||||
/*@}*/
|
||||
|
@@ -187,8 +187,8 @@ ir_algebraic_visitor::reassociate_constant(ir_expression *ir1, int const_index,
|
||||
|
||||
/* Don't want to even think about matrices. */
|
||||
if (ir1->operands[0]->type->is_matrix() ||
|
||||
ir1->operands[0]->type->is_matrix() ||
|
||||
ir2->operands[1]->type->is_matrix() ||
|
||||
ir1->operands[1]->type->is_matrix() ||
|
||||
ir2->operands[0]->type->is_matrix() ||
|
||||
ir2->operands[1]->type->is_matrix())
|
||||
return false;
|
||||
|
||||
|
@@ -54,6 +54,9 @@ dot(ir_constant *op0, ir_constant *op1)
|
||||
ir_constant *
|
||||
ir_expression::constant_expression_value()
|
||||
{
|
||||
if (this->type->is_error())
|
||||
return NULL;
|
||||
|
||||
ir_constant *op[2] = { NULL, NULL };
|
||||
ir_constant_data data;
|
||||
|
||||
@@ -563,63 +566,75 @@ ir_expression::constant_expression_value()
|
||||
break;
|
||||
|
||||
case ir_binop_less:
|
||||
switch (op[0]->type->base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
data.b[0] = op[0]->value.u[0] < op[1]->value.u[0];
|
||||
break;
|
||||
case GLSL_TYPE_INT:
|
||||
data.b[0] = op[0]->value.i[0] < op[1]->value.i[0];
|
||||
break;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
data.b[0] = op[0]->value.f[0] < op[1]->value.f[0];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
assert(op[0]->type == op[1]->type);
|
||||
for (unsigned c = 0; c < op[0]->type->components(); c++) {
|
||||
switch (op[0]->type->base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
data.b[0] = op[0]->value.u[0] < op[1]->value.u[0];
|
||||
break;
|
||||
case GLSL_TYPE_INT:
|
||||
data.b[0] = op[0]->value.i[0] < op[1]->value.i[0];
|
||||
break;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
data.b[0] = op[0]->value.f[0] < op[1]->value.f[0];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ir_binop_greater:
|
||||
switch (op[0]->type->base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
data.b[0] = op[0]->value.u[0] > op[1]->value.u[0];
|
||||
break;
|
||||
case GLSL_TYPE_INT:
|
||||
data.b[0] = op[0]->value.i[0] > op[1]->value.i[0];
|
||||
break;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
data.b[0] = op[0]->value.f[0] > op[1]->value.f[0];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
assert(op[0]->type == op[1]->type);
|
||||
for (unsigned c = 0; c < op[0]->type->components(); c++) {
|
||||
switch (op[0]->type->base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
data.b[c] = op[0]->value.u[c] > op[1]->value.u[c];
|
||||
break;
|
||||
case GLSL_TYPE_INT:
|
||||
data.b[c] = op[0]->value.i[c] > op[1]->value.i[c];
|
||||
break;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
data.b[c] = op[0]->value.f[c] > op[1]->value.f[c];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ir_binop_lequal:
|
||||
switch (op[0]->type->base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
data.b[0] = op[0]->value.u[0] <= op[1]->value.u[0];
|
||||
break;
|
||||
case GLSL_TYPE_INT:
|
||||
data.b[0] = op[0]->value.i[0] <= op[1]->value.i[0];
|
||||
break;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
data.b[0] = op[0]->value.f[0] <= op[1]->value.f[0];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
assert(op[0]->type == op[1]->type);
|
||||
for (unsigned c = 0; c < op[0]->type->components(); c++) {
|
||||
switch (op[0]->type->base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
data.b[0] = op[0]->value.u[0] <= op[1]->value.u[0];
|
||||
break;
|
||||
case GLSL_TYPE_INT:
|
||||
data.b[0] = op[0]->value.i[0] <= op[1]->value.i[0];
|
||||
break;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
data.b[0] = op[0]->value.f[0] <= op[1]->value.f[0];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ir_binop_gequal:
|
||||
switch (op[0]->type->base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
data.b[0] = op[0]->value.u[0] >= op[1]->value.u[0];
|
||||
break;
|
||||
case GLSL_TYPE_INT:
|
||||
data.b[0] = op[0]->value.i[0] >= op[1]->value.i[0];
|
||||
break;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
data.b[0] = op[0]->value.f[0] >= op[1]->value.f[0];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
assert(op[0]->type == op[1]->type);
|
||||
for (unsigned c = 0; c < op[0]->type->components(); c++) {
|
||||
switch (op[0]->type->base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
data.b[0] = op[0]->value.u[0] >= op[1]->value.u[0];
|
||||
break;
|
||||
case GLSL_TYPE_INT:
|
||||
data.b[0] = op[0]->value.i[0] >= op[1]->value.i[0];
|
||||
break;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
data.b[0] = op[0]->value.f[0] >= op[1]->value.f[0];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ir_binop_equal:
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Constantright © 2010 Intel Corporation
|
||||
* Copyright © 2010 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* constant of this software and associated documentation files (the "Software"),
|
||||
|
@@ -125,6 +125,7 @@ do_dead_functions(exec_list *instructions)
|
||||
|
||||
if (!entry->used) {
|
||||
entry->signature->remove();
|
||||
delete entry->signature;
|
||||
progress = true;
|
||||
}
|
||||
delete(entry);
|
||||
@@ -143,6 +144,7 @@ do_dead_functions(exec_list *instructions)
|
||||
* symbol table should be OK.
|
||||
*/
|
||||
func->remove();
|
||||
delete func;
|
||||
progress = true;
|
||||
}
|
||||
}
|
||||
|
@@ -60,6 +60,8 @@ can_inline(ir_call *call)
|
||||
{
|
||||
ir_function_can_inline_visitor v;
|
||||
const ir_function_signature *callee = call->get_callee();
|
||||
if (!callee->is_defined)
|
||||
return false;
|
||||
|
||||
v.run((exec_list *) &callee->body);
|
||||
|
||||
|
@@ -36,7 +36,6 @@ enum jump_strength
|
||||
strength_continue,
|
||||
strength_break,
|
||||
strength_return,
|
||||
strength_discard
|
||||
};
|
||||
|
||||
struct block_record
|
||||
@@ -202,8 +201,6 @@ struct ir_lower_jumps_visitor : public ir_control_flow_visitor {
|
||||
|
||||
virtual void visit(class ir_discard * ir)
|
||||
{
|
||||
truncate_after_instruction(ir);
|
||||
this->block.min_strength = strength_discard;
|
||||
}
|
||||
|
||||
enum jump_strength get_jump_strength(ir_instruction* ir)
|
||||
@@ -217,8 +214,6 @@ struct ir_lower_jumps_visitor : public ir_control_flow_visitor {
|
||||
return strength_continue;
|
||||
} else if(ir->ir_type == ir_type_return)
|
||||
return strength_return;
|
||||
else if(ir->ir_type == ir_type_discard)
|
||||
return strength_discard;
|
||||
else
|
||||
return strength_none;
|
||||
}
|
||||
@@ -253,9 +248,6 @@ struct ir_lower_jumps_visitor : public ir_control_flow_visitor {
|
||||
else
|
||||
lower = lower_sub_return;
|
||||
break;
|
||||
case strength_discard:
|
||||
lower = false; /* probably nothing needs this lowered */
|
||||
break;
|
||||
}
|
||||
return lower;
|
||||
}
|
||||
@@ -313,9 +305,8 @@ retry: /* we get here if we put code after the if inside a branch */
|
||||
/* FINISHME: unify returns with identical expressions */
|
||||
else if(jump_strengths[0] == strength_return && this->function.signature->return_type->is_void())
|
||||
ir->insert_after(new(ir) ir_return(NULL));
|
||||
/* FINISHME: unify discards */
|
||||
else
|
||||
unify = false;
|
||||
else
|
||||
unify = false;
|
||||
|
||||
if(unify) {
|
||||
jumps[0]->remove();
|
||||
@@ -490,7 +481,11 @@ lower_continue:
|
||||
if(this->loop.may_set_return_flag) {
|
||||
assert(this->function.return_flag);
|
||||
ir_if* return_if = new(ir) ir_if(new(ir) ir_dereference_variable(this->function.return_flag));
|
||||
return_if->then_instructions.push_tail(new(ir) ir_loop_jump(saved_loop.loop ? ir_loop_jump::jump_break : ir_loop_jump::jump_continue));
|
||||
saved_loop.may_set_return_flag = true;
|
||||
if(saved_loop.loop)
|
||||
return_if->then_instructions.push_tail(new(ir) ir_loop_jump(ir_loop_jump::jump_break));
|
||||
else
|
||||
move_outer_block_inside(ir, &return_if->else_instructions);
|
||||
ir->insert_after(return_if);
|
||||
}
|
||||
|
||||
|
@@ -45,6 +45,7 @@ bool do_explog_to_explog2(exec_list *instructions);
|
||||
bool do_function_inlining(exec_list *instructions);
|
||||
bool do_lower_jumps(exec_list *instructions, bool pull_out_jumps = true, bool lower_sub_return = true, bool lower_main_return = false, bool lower_continue = false, bool lower_break = false);
|
||||
bool do_if_simplification(exec_list *instructions);
|
||||
bool do_discard_simplification(exec_list *instructions);
|
||||
bool do_if_to_cond_assign(exec_list *instructions);
|
||||
bool do_mat_op_to_vec(exec_list *instructions);
|
||||
bool do_mod_to_fract(exec_list *instructions);
|
||||
@@ -55,6 +56,7 @@ bool do_swizzle_swizzle(exec_list *instructions);
|
||||
bool do_tree_grafting(exec_list *instructions);
|
||||
bool do_vec_index_to_cond_assign(exec_list *instructions);
|
||||
bool do_vec_index_to_swizzle(exec_list *instructions);
|
||||
bool lower_discard(exec_list *instructions);
|
||||
bool lower_noise(exec_list *instructions);
|
||||
bool lower_variable_index_to_cond_assign(exec_list *instructions,
|
||||
bool lower_input, bool lower_output, bool lower_temp, bool lower_uniform);
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
};
|
||||
|
||||
static void
|
||||
mark(struct gl_program *prog, ir_variable *var, int index)
|
||||
mark(struct gl_program *prog, ir_variable *var, int offset, int len)
|
||||
{
|
||||
/* As of GLSL 1.20, varyings can only be floats, floating-point
|
||||
* vectors or matrices, or arrays of them. For Mesa programs using
|
||||
@@ -75,25 +75,12 @@ mark(struct gl_program *prog, ir_variable *var, int index)
|
||||
* something doing a more clever packing would use something other
|
||||
* than InputsRead/OutputsWritten.
|
||||
*/
|
||||
const glsl_type *element_type;
|
||||
int element_size;
|
||||
|
||||
if (var->type->is_array())
|
||||
element_type = var->type->fields.array;
|
||||
else
|
||||
element_type = var->type;
|
||||
|
||||
if (element_type->is_matrix())
|
||||
element_size = element_type->matrix_columns;
|
||||
else
|
||||
element_size = 1;
|
||||
|
||||
index *= element_size;
|
||||
for (int i = 0; i < element_size; i++) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (var->mode == ir_var_in)
|
||||
prog->InputsRead |= BITFIELD64_BIT(var->location + index + i);
|
||||
prog->InputsRead |= BITFIELD64_BIT(var->location + offset + i);
|
||||
else
|
||||
prog->OutputsWritten |= BITFIELD64_BIT(var->location + index + i);
|
||||
prog->OutputsWritten |= BITFIELD64_BIT(var->location + offset + i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,10 +93,11 @@ ir_set_program_inouts_visitor::visit(ir_dereference_variable *ir)
|
||||
|
||||
if (ir->type->is_array()) {
|
||||
for (unsigned int i = 0; i < ir->type->length; i++) {
|
||||
mark(this->prog, ir->var, i);
|
||||
mark(this->prog, ir->var, i,
|
||||
ir->type->length * ir->type->fields.array->matrix_columns);
|
||||
}
|
||||
} else {
|
||||
mark(this->prog, ir->var, 0);
|
||||
mark(this->prog, ir->var, 0, ir->type->matrix_columns);
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
@@ -128,7 +116,14 @@ ir_set_program_inouts_visitor::visit_enter(ir_dereference_array *ir)
|
||||
var = (ir_variable *)hash_table_find(this->ht, deref_var->var);
|
||||
|
||||
if (index && var) {
|
||||
mark(this->prog, var, index->value.i[0]);
|
||||
int width = 1;
|
||||
|
||||
if (deref_var->type->is_array() &&
|
||||
deref_var->type->fields.array->is_matrix()) {
|
||||
width = deref_var->type->fields.array->matrix_columns;
|
||||
}
|
||||
|
||||
mark(this->prog, var, index->value.i[0] * width, width);
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
|
||||
|
@@ -80,6 +80,10 @@ extern "C" {
|
||||
#include "linker.h"
|
||||
#include "ir_optimization.h"
|
||||
|
||||
extern "C" {
|
||||
#include "main/shaderobj.h"
|
||||
}
|
||||
|
||||
/**
|
||||
* Visitor that determines whether or not a variable is ever written.
|
||||
*/
|
||||
@@ -321,6 +325,9 @@ cross_validate_globals(struct gl_shader_program *prog,
|
||||
*/
|
||||
glsl_symbol_table variables;
|
||||
for (unsigned i = 0; i < num_shaders; i++) {
|
||||
if (shader_list[i] == NULL)
|
||||
continue;
|
||||
|
||||
foreach_list(node, shader_list[i]->ir) {
|
||||
ir_variable *const var = ((ir_instruction *) node)->as_variable();
|
||||
|
||||
@@ -353,8 +360,12 @@ cross_validate_globals(struct gl_shader_program *prog,
|
||||
&& (var->type->fields.array == existing->type->fields.array)
|
||||
&& ((var->type->length == 0)
|
||||
|| (existing->type->length == 0))) {
|
||||
if (existing->type->length == 0)
|
||||
if (existing->type->length == 0) {
|
||||
existing->type = var->type;
|
||||
existing->max_array_access =
|
||||
MAX2(existing->max_array_access,
|
||||
var->max_array_access);
|
||||
}
|
||||
} else {
|
||||
linker_error_printf(prog, "%s `%s' declared as type "
|
||||
"`%s' and type `%s'\n",
|
||||
@@ -391,6 +402,13 @@ cross_validate_globals(struct gl_shader_program *prog,
|
||||
existing->constant_value =
|
||||
var->constant_value->clone(talloc_parent(existing), NULL);
|
||||
}
|
||||
|
||||
if (existing->invariant != var->invariant) {
|
||||
linker_error_printf(prog, "declarations for %s `%s' have "
|
||||
"mismatching invariant qualifiers\n",
|
||||
mode_string(var), var->name);
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
variables.add_variable(var->name, var);
|
||||
}
|
||||
@@ -407,7 +425,7 @@ bool
|
||||
cross_validate_uniforms(struct gl_shader_program *prog)
|
||||
{
|
||||
return cross_validate_globals(prog, prog->_LinkedShaders,
|
||||
prog->_NumLinkedShaders, true);
|
||||
MESA_SHADER_TYPES, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -456,14 +474,35 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
|
||||
/* Check that the types match between stages.
|
||||
*/
|
||||
if (input->type != output->type) {
|
||||
linker_error_printf(prog,
|
||||
"%s shader output `%s' declared as "
|
||||
"type `%s', but %s shader input declared "
|
||||
"as type `%s'\n",
|
||||
producer_stage, output->name,
|
||||
output->type->name,
|
||||
consumer_stage, input->type->name);
|
||||
return false;
|
||||
/* There is a bit of a special case for gl_TexCoord. This
|
||||
* built-in is unsized by default. Appliations that variable
|
||||
* access it must redeclare it with a size. There is some
|
||||
* language in the GLSL spec that implies the fragment shader
|
||||
* and vertex shader do not have to agree on this size. Other
|
||||
* driver behave this way, and one or two applications seem to
|
||||
* rely on it.
|
||||
*
|
||||
* Neither declaration needs to be modified here because the array
|
||||
* sizes are fixed later when update_array_sizes is called.
|
||||
*
|
||||
* From page 48 (page 54 of the PDF) of the GLSL 1.10 spec:
|
||||
*
|
||||
* "Unlike user-defined varying variables, the built-in
|
||||
* varying variables don't have a strict one-to-one
|
||||
* correspondence between the vertex language and the
|
||||
* fragment language."
|
||||
*/
|
||||
if (!output->type->is_array()
|
||||
|| (strncmp("gl_", output->name, 3) != 0)) {
|
||||
linker_error_printf(prog,
|
||||
"%s shader output `%s' declared as "
|
||||
"type `%s', but %s shader input declared "
|
||||
"as type `%s'\n",
|
||||
producer_stage, output->name,
|
||||
output->type->name,
|
||||
consumer_stage, input->type->name);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check that all of the qualifiers match between stages.
|
||||
@@ -706,7 +745,8 @@ get_main_function_signature(gl_shader *sh)
|
||||
* shader is returned.
|
||||
*/
|
||||
static struct gl_shader *
|
||||
link_intrastage_shaders(GLcontext *ctx,
|
||||
link_intrastage_shaders(void *mem_ctx,
|
||||
GLcontext *ctx,
|
||||
struct gl_shader_program *prog,
|
||||
struct gl_shader **shader_list,
|
||||
unsigned num_shaders)
|
||||
@@ -780,9 +820,9 @@ link_intrastage_shaders(GLcontext *ctx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gl_shader *const linked = ctx->Driver.NewShader(NULL, 0, main->Type);
|
||||
gl_shader *linked = ctx->Driver.NewShader(NULL, 0, main->Type);
|
||||
linked->ir = new(linked) exec_list;
|
||||
clone_ir_list(linked, linked->ir, main->ir);
|
||||
clone_ir_list(mem_ctx, linked->ir, main->ir);
|
||||
|
||||
populate_symbol_table(linked);
|
||||
|
||||
@@ -827,10 +867,40 @@ link_intrastage_shaders(GLcontext *ctx,
|
||||
|
||||
assert(idx == num_linking_shaders);
|
||||
|
||||
link_function_calls(prog, linked, linking_shaders, num_linking_shaders);
|
||||
if (!link_function_calls(prog, linked, linking_shaders,
|
||||
num_linking_shaders)) {
|
||||
ctx->Driver.DeleteShader(ctx, linked);
|
||||
linked = NULL;
|
||||
}
|
||||
|
||||
free(linking_shaders);
|
||||
|
||||
/* Make a pass over all global variables to ensure that arrays with
|
||||
* unspecified sizes have a size specified. The size is inferred from the
|
||||
* max_array_access field.
|
||||
*/
|
||||
if (linked != NULL) {
|
||||
foreach_list(node, linked->ir) {
|
||||
ir_variable *const var = ((ir_instruction *) node)->as_variable();
|
||||
|
||||
if (var == NULL)
|
||||
continue;
|
||||
|
||||
if ((var->mode != ir_var_auto) && (var->mode != ir_var_temporary))
|
||||
continue;
|
||||
|
||||
if (!var->type->is_array() || (var->type->length != 0))
|
||||
continue;
|
||||
|
||||
const glsl_type *type =
|
||||
glsl_type::get_array_instance(var->type->fields.array,
|
||||
var->max_array_access);
|
||||
|
||||
assert(type != NULL);
|
||||
var->type = type;
|
||||
}
|
||||
}
|
||||
|
||||
return linked;
|
||||
}
|
||||
|
||||
@@ -859,7 +929,10 @@ struct uniform_node {
|
||||
static void
|
||||
update_array_sizes(struct gl_shader_program *prog)
|
||||
{
|
||||
for (unsigned i = 0; i < prog->_NumLinkedShaders; i++) {
|
||||
for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
|
||||
if (prog->_LinkedShaders[i] == NULL)
|
||||
continue;
|
||||
|
||||
foreach_list(node, prog->_LinkedShaders[i]->ir) {
|
||||
ir_variable *const var = ((ir_instruction *) node)->as_variable();
|
||||
|
||||
@@ -870,7 +943,10 @@ update_array_sizes(struct gl_shader_program *prog)
|
||||
continue;
|
||||
|
||||
unsigned int size = var->max_array_access;
|
||||
for (unsigned j = 0; j < prog->_NumLinkedShaders; j++) {
|
||||
for (unsigned j = 0; j < MESA_SHADER_TYPES; j++) {
|
||||
if (prog->_LinkedShaders[j] == NULL)
|
||||
continue;
|
||||
|
||||
foreach_list(node2, prog->_LinkedShaders[j]->ir) {
|
||||
ir_variable *other_var = ((ir_instruction *) node2)->as_variable();
|
||||
if (!other_var)
|
||||
@@ -982,7 +1058,10 @@ assign_uniform_locations(struct gl_shader_program *prog)
|
||||
hash_table_string_compare);
|
||||
void *mem_ctx = talloc_new(NULL);
|
||||
|
||||
for (unsigned i = 0; i < prog->_NumLinkedShaders; i++) {
|
||||
for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
|
||||
if (prog->_LinkedShaders[i] == NULL)
|
||||
continue;
|
||||
|
||||
unsigned next_position = 0;
|
||||
|
||||
foreach_list(node, prog->_LinkedShaders[i]->ir) {
|
||||
@@ -1239,19 +1318,20 @@ assign_attribute_locations(gl_shader_program *prog, unsigned max_attribute_index
|
||||
|
||||
|
||||
/**
|
||||
* Demote shader outputs that are not read to being just plain global variables
|
||||
* Demote shader inputs and outputs that are not used in other stages
|
||||
*/
|
||||
void
|
||||
demote_unread_shader_outputs(gl_shader *sh)
|
||||
demote_shader_inputs_and_outputs(gl_shader *sh, enum ir_variable_mode mode)
|
||||
{
|
||||
foreach_list(node, sh->ir) {
|
||||
ir_variable *const var = ((ir_instruction *) node)->as_variable();
|
||||
|
||||
if ((var == NULL) || (var->mode != ir_var_out))
|
||||
if ((var == NULL) || (var->mode != int(mode)))
|
||||
continue;
|
||||
|
||||
/* An 'out' variable is only really a shader output if its value is read
|
||||
* by the following stage.
|
||||
/* A shader 'in' or 'out' variable is only really an input or output if
|
||||
* its value is used by other shader stages. This will cause the variable
|
||||
* to have a location assigned.
|
||||
*/
|
||||
if (var->location == -1) {
|
||||
var->mode = ir_var_auto;
|
||||
@@ -1317,8 +1397,6 @@ assign_varying_locations(struct gl_shader_program *prog,
|
||||
}
|
||||
}
|
||||
|
||||
demote_unread_shader_outputs(producer);
|
||||
|
||||
foreach_list(node, consumer->ir) {
|
||||
ir_variable *const var = ((ir_instruction *) node)->as_variable();
|
||||
|
||||
@@ -1357,6 +1435,8 @@ assign_varying_locations(struct gl_shader_program *prog,
|
||||
void
|
||||
link_shaders(GLcontext *ctx, struct gl_shader_program *prog)
|
||||
{
|
||||
void *mem_ctx = talloc_init("temporary linker context");
|
||||
|
||||
prog->LinkStatus = false;
|
||||
prog->Validated = false;
|
||||
prog->_Used = false;
|
||||
@@ -1414,16 +1494,19 @@ link_shaders(GLcontext *ctx, struct gl_shader_program *prog)
|
||||
|
||||
prog->Version = max_version;
|
||||
|
||||
for (unsigned int i = 0; i < prog->_NumLinkedShaders; i++) {
|
||||
ctx->Driver.DeleteShader(ctx, prog->_LinkedShaders[i]);
|
||||
for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) {
|
||||
if (prog->_LinkedShaders[i] != NULL)
|
||||
ctx->Driver.DeleteShader(ctx, prog->_LinkedShaders[i]);
|
||||
|
||||
prog->_LinkedShaders[i] = NULL;
|
||||
}
|
||||
|
||||
/* Link all shaders for a particular stage and validate the result.
|
||||
*/
|
||||
prog->_NumLinkedShaders = 0;
|
||||
if (num_vert_shaders > 0) {
|
||||
gl_shader *const sh =
|
||||
link_intrastage_shaders(ctx, prog, vert_shader_list, num_vert_shaders);
|
||||
link_intrastage_shaders(mem_ctx, ctx, prog, vert_shader_list,
|
||||
num_vert_shaders);
|
||||
|
||||
if (sh == NULL)
|
||||
goto done;
|
||||
@@ -1431,13 +1514,14 @@ link_shaders(GLcontext *ctx, struct gl_shader_program *prog)
|
||||
if (!validate_vertex_shader_executable(prog, sh))
|
||||
goto done;
|
||||
|
||||
prog->_LinkedShaders[prog->_NumLinkedShaders] = sh;
|
||||
prog->_NumLinkedShaders++;
|
||||
_mesa_reference_shader(ctx, &prog->_LinkedShaders[MESA_SHADER_VERTEX],
|
||||
sh);
|
||||
}
|
||||
|
||||
if (num_frag_shaders > 0) {
|
||||
gl_shader *const sh =
|
||||
link_intrastage_shaders(ctx, prog, frag_shader_list, num_frag_shaders);
|
||||
link_intrastage_shaders(mem_ctx, ctx, prog, frag_shader_list,
|
||||
num_frag_shaders);
|
||||
|
||||
if (sh == NULL)
|
||||
goto done;
|
||||
@@ -1445,8 +1529,8 @@ link_shaders(GLcontext *ctx, struct gl_shader_program *prog)
|
||||
if (!validate_fragment_shader_executable(prog, sh))
|
||||
goto done;
|
||||
|
||||
prog->_LinkedShaders[prog->_NumLinkedShaders] = sh;
|
||||
prog->_NumLinkedShaders++;
|
||||
_mesa_reference_shader(ctx, &prog->_LinkedShaders[MESA_SHADER_FRAGMENT],
|
||||
sh);
|
||||
}
|
||||
|
||||
/* Here begins the inter-stage linking phase. Some initial validation is
|
||||
@@ -1454,14 +1538,26 @@ link_shaders(GLcontext *ctx, struct gl_shader_program *prog)
|
||||
* varyings.
|
||||
*/
|
||||
if (cross_validate_uniforms(prog)) {
|
||||
unsigned prev;
|
||||
|
||||
for (prev = 0; prev < MESA_SHADER_TYPES; prev++) {
|
||||
if (prog->_LinkedShaders[prev] != NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Validate the inputs of each stage with the output of the preceeding
|
||||
* stage.
|
||||
*/
|
||||
for (unsigned i = 1; i < prog->_NumLinkedShaders; i++) {
|
||||
for (unsigned i = prev + 1; i < MESA_SHADER_TYPES; i++) {
|
||||
if (prog->_LinkedShaders[i] == NULL)
|
||||
continue;
|
||||
|
||||
if (!cross_validate_outputs_to_inputs(prog,
|
||||
prog->_LinkedShaders[i - 1],
|
||||
prog->_LinkedShaders[prev],
|
||||
prog->_LinkedShaders[i]))
|
||||
goto done;
|
||||
|
||||
prev = i;
|
||||
}
|
||||
|
||||
prog->LinkStatus = true;
|
||||
@@ -1471,7 +1567,10 @@ link_shaders(GLcontext *ctx, struct gl_shader_program *prog)
|
||||
* uniforms, and varyings. Later optimization could possibly make
|
||||
* some of that unused.
|
||||
*/
|
||||
for (unsigned i = 0; i < prog->_NumLinkedShaders; i++) {
|
||||
for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
|
||||
if (prog->_LinkedShaders[i] == NULL)
|
||||
continue;
|
||||
|
||||
while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, 32))
|
||||
;
|
||||
}
|
||||
@@ -1480,7 +1579,7 @@ link_shaders(GLcontext *ctx, struct gl_shader_program *prog)
|
||||
|
||||
assign_uniform_locations(prog);
|
||||
|
||||
if (prog->_NumLinkedShaders && prog->_LinkedShaders[0]->Type == GL_VERTEX_SHADER) {
|
||||
if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) {
|
||||
/* FINISHME: The value of the max_attribute_index parameter is
|
||||
* FINISHME: implementation dependent based on the value of
|
||||
* FINISHME: GL_MAX_VERTEX_ATTRIBS. GL_MAX_VERTEX_ATTRIBS must be
|
||||
@@ -1488,18 +1587,55 @@ link_shaders(GLcontext *ctx, struct gl_shader_program *prog)
|
||||
*/
|
||||
if (!assign_attribute_locations(prog, 16))
|
||||
goto done;
|
||||
|
||||
if (prog->_NumLinkedShaders == 1)
|
||||
demote_unread_shader_outputs(prog->_LinkedShaders[0]);
|
||||
}
|
||||
|
||||
for (unsigned i = 1; i < prog->_NumLinkedShaders; i++)
|
||||
unsigned prev;
|
||||
for (prev = 0; prev < MESA_SHADER_TYPES; prev++) {
|
||||
if (prog->_LinkedShaders[prev] != NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
for (unsigned i = prev + 1; i < MESA_SHADER_TYPES; i++) {
|
||||
if (prog->_LinkedShaders[i] == NULL)
|
||||
continue;
|
||||
|
||||
assign_varying_locations(prog,
|
||||
prog->_LinkedShaders[i - 1],
|
||||
prog->_LinkedShaders[prev],
|
||||
prog->_LinkedShaders[i]);
|
||||
prev = i;
|
||||
}
|
||||
|
||||
if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) {
|
||||
demote_shader_inputs_and_outputs(prog->_LinkedShaders[MESA_SHADER_VERTEX],
|
||||
ir_var_out);
|
||||
}
|
||||
|
||||
if (prog->_LinkedShaders[MESA_SHADER_GEOMETRY] != NULL) {
|
||||
gl_shader *const sh = prog->_LinkedShaders[MESA_SHADER_GEOMETRY];
|
||||
|
||||
demote_shader_inputs_and_outputs(sh, ir_var_in);
|
||||
demote_shader_inputs_and_outputs(sh, ir_var_inout);
|
||||
demote_shader_inputs_and_outputs(sh, ir_var_out);
|
||||
}
|
||||
|
||||
if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) {
|
||||
gl_shader *const sh = prog->_LinkedShaders[MESA_SHADER_FRAGMENT];
|
||||
|
||||
demote_shader_inputs_and_outputs(sh, ir_var_in);
|
||||
}
|
||||
|
||||
/* FINISHME: Assign fragment shader output locations. */
|
||||
|
||||
done:
|
||||
free(vert_shader_list);
|
||||
|
||||
for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
|
||||
if (prog->_LinkedShaders[i] == NULL)
|
||||
continue;
|
||||
|
||||
/* Retain any live IR, but trash the rest. */
|
||||
reparent_ir(prog->_LinkedShaders[i]->ir, prog->_LinkedShaders[i]->ir);
|
||||
}
|
||||
|
||||
talloc_free(mem_ctx);
|
||||
}
|
||||
|
@@ -44,6 +44,7 @@ loop_state::loop_state()
|
||||
loop_state::~loop_state()
|
||||
{
|
||||
hash_table_dtor(this->ht);
|
||||
talloc_free(this->mem_ctx);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -85,6 +85,9 @@ int
|
||||
calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment,
|
||||
enum ir_expression_operation op)
|
||||
{
|
||||
if (from == NULL || to == NULL || increment == NULL)
|
||||
return -1;
|
||||
|
||||
void *mem_ctx = talloc_init("%s", __func__);
|
||||
|
||||
ir_expression *const sub =
|
||||
|
@@ -43,6 +43,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
static bool
|
||||
is_break(ir_instruction *ir)
|
||||
{
|
||||
return ir != NULL && ir->ir_type == ir_type_loop_jump
|
||||
&& ((ir_loop_jump *) ir)->is_break();
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
loop_unroll_visitor::visit_leave(ir_loop *ir)
|
||||
{
|
||||
@@ -73,44 +81,74 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
|
||||
if (ls->num_loop_jumps > 1)
|
||||
return visit_continue;
|
||||
else if (ls->num_loop_jumps) {
|
||||
/* recognize loops in the form produced by ir_lower_jumps */
|
||||
ir_instruction *last_ir =
|
||||
((ir_instruction*)ir->body_instructions.get_tail());
|
||||
|
||||
ir_instruction *last_ir = (ir_instruction *) ir->body_instructions.get_tail();
|
||||
assert(last_ir != NULL);
|
||||
|
||||
ir_if *last_if = last_ir->as_if();
|
||||
if (last_if) {
|
||||
bool continue_from_then_branch;
|
||||
if (is_break(last_ir)) {
|
||||
/* If the only loop-jump is a break at the end of the loop, the loop
|
||||
* will execute exactly once. Remove the break, set the iteration
|
||||
* count, and fall through to the normal unroller.
|
||||
*/
|
||||
last_ir->remove();
|
||||
iterations = 1;
|
||||
|
||||
/* Determine which if-statement branch, if any, ends with a break.
|
||||
* The branch that did *not* have the break will get a temporary
|
||||
* continue inserted in each iteration of the loop unroll.
|
||||
*
|
||||
* Note that since ls->num_loop_jumps is <= 1, it is impossible for
|
||||
* both branches to end with a break.
|
||||
*/
|
||||
ir_instruction *last =
|
||||
(ir_instruction *) last_if->then_instructions.get_tail();
|
||||
this->progress = true;
|
||||
} else {
|
||||
ir_if *ir_if = NULL;
|
||||
ir_instruction *break_ir = NULL;
|
||||
bool continue_from_then_branch = false;
|
||||
|
||||
if (last && last->ir_type == ir_type_loop_jump
|
||||
&& ((ir_loop_jump*) last)->is_break()) {
|
||||
continue_from_then_branch = false;
|
||||
} else {
|
||||
last = (ir_instruction *) last_if->then_instructions.get_tail();
|
||||
foreach_list(node, &ir->body_instructions) {
|
||||
/* recognize loops in the form produced by ir_lower_jumps */
|
||||
ir_instruction *cur_ir = (ir_instruction *) node;
|
||||
|
||||
if (last && last->ir_type == ir_type_loop_jump
|
||||
&& ((ir_loop_jump*) last)->is_break())
|
||||
continue_from_then_branch = true;
|
||||
else
|
||||
/* Bail out if neither if-statement branch ends with a break.
|
||||
ir_if = cur_ir->as_if();
|
||||
if (ir_if != NULL) {
|
||||
/* Determine which if-statement branch, if any, ends with a
|
||||
* break. The branch that did *not* have the break will get a
|
||||
* temporary continue inserted in each iteration of the loop
|
||||
* unroll.
|
||||
*
|
||||
* Note that since ls->num_loop_jumps is <= 1, it is impossible
|
||||
* for both branches to end with a break.
|
||||
*/
|
||||
return visit_continue;
|
||||
}
|
||||
ir_instruction *ir_if_last =
|
||||
(ir_instruction *) ir_if->then_instructions.get_tail();
|
||||
|
||||
/* Remove the break from the if-statement.
|
||||
*/
|
||||
last->remove();
|
||||
if (is_break(ir_if_last)) {
|
||||
continue_from_then_branch = false;
|
||||
break_ir = ir_if_last;
|
||||
break;
|
||||
} else {
|
||||
ir_if_last =
|
||||
(ir_instruction *) ir_if->else_instructions.get_tail();
|
||||
|
||||
if (is_break(ir_if_last)) {
|
||||
break_ir = ir_if_last;
|
||||
continue_from_then_branch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (break_ir == NULL)
|
||||
return visit_continue;
|
||||
|
||||
/* move instructions after then if in the continue branch */
|
||||
while (!ir_if->get_next()->is_tail_sentinel()) {
|
||||
ir_instruction *move_ir = (ir_instruction *) ir_if->get_next();
|
||||
|
||||
move_ir->remove();
|
||||
if (continue_from_then_branch)
|
||||
ir_if->then_instructions.push_tail(move_ir);
|
||||
else
|
||||
ir_if->else_instructions.push_tail(move_ir);
|
||||
}
|
||||
|
||||
/* Remove the break from the if-statement.
|
||||
*/
|
||||
break_ir->remove();
|
||||
|
||||
void *const mem_ctx = talloc_parent(ir);
|
||||
ir_instruction *ir_to_replace = ir;
|
||||
@@ -121,8 +159,8 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
|
||||
copy_list.make_empty();
|
||||
clone_ir_list(mem_ctx, ©_list, &ir->body_instructions);
|
||||
|
||||
last_if = ((ir_instruction*)copy_list.get_tail())->as_if();
|
||||
assert(last_if);
|
||||
ir_if = ((ir_instruction *) copy_list.get_tail())->as_if();
|
||||
assert(ir_if != NULL);
|
||||
|
||||
ir_to_replace->insert_before(©_list);
|
||||
ir_to_replace->remove();
|
||||
@@ -132,7 +170,7 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
|
||||
new(mem_ctx) ir_loop_jump(ir_loop_jump::jump_continue);
|
||||
|
||||
exec_list *const list = (continue_from_then_branch)
|
||||
? &last_if->then_instructions : &last_if->else_instructions;
|
||||
? &ir_if->then_instructions : &ir_if->else_instructions;
|
||||
|
||||
list->push_tail(ir_to_replace);
|
||||
}
|
||||
@@ -141,18 +179,7 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
|
||||
|
||||
this->progress = true;
|
||||
return visit_continue;
|
||||
} else if (last_ir->ir_type == ir_type_loop_jump
|
||||
&& ((ir_loop_jump *)last_ir)->is_break()) {
|
||||
/* If the only loop-jump is a break at the end of the loop, the loop
|
||||
* will execute exactly once. Remove the break, set the iteration
|
||||
* count, and fall through to the normal unroller.
|
||||
*/
|
||||
last_ir->remove();
|
||||
iterations = 1;
|
||||
|
||||
this->progress = true;
|
||||
} else
|
||||
return visit_continue;
|
||||
}
|
||||
}
|
||||
|
||||
void *const mem_ctx = talloc_parent(ir);
|
||||
|
198
src/glsl/lower_discard.cpp
Normal file
198
src/glsl/lower_discard.cpp
Normal file
@@ -0,0 +1,198 @@
|
||||
/*
|
||||
* Copyright © 2010 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file lower_discard.cpp
|
||||
*
|
||||
* This pass moves discards out of if-statements.
|
||||
*
|
||||
* Case 1: The "then" branch contains a conditional discard:
|
||||
* ---------------------------------------------------------
|
||||
*
|
||||
* if (cond1) {
|
||||
* s1;
|
||||
* discard cond2;
|
||||
* s2;
|
||||
* } else {
|
||||
* s3;
|
||||
* }
|
||||
*
|
||||
* becomes:
|
||||
*
|
||||
* temp = false;
|
||||
* if (cond1) {
|
||||
* s1;
|
||||
* temp = cond2;
|
||||
* s2;
|
||||
* } else {
|
||||
* s3;
|
||||
* }
|
||||
* discard temp;
|
||||
*
|
||||
* Case 2: The "else" branch contains a conditional discard:
|
||||
* ---------------------------------------------------------
|
||||
*
|
||||
* if (cond1) {
|
||||
* s1;
|
||||
* } else {
|
||||
* s2;
|
||||
* discard cond2;
|
||||
* s3;
|
||||
* }
|
||||
*
|
||||
* becomes:
|
||||
*
|
||||
* temp = false;
|
||||
* if (cond1) {
|
||||
* s1;
|
||||
* } else {
|
||||
* s2;
|
||||
* temp = cond2;
|
||||
* s3;
|
||||
* }
|
||||
* discard temp;
|
||||
*
|
||||
* Case 3: Both branches contain a conditional discard:
|
||||
* ----------------------------------------------------
|
||||
*
|
||||
* if (cond1) {
|
||||
* s1;
|
||||
* discard cond2;
|
||||
* s2;
|
||||
* } else {
|
||||
* s3;
|
||||
* discard cond3;
|
||||
* s4;
|
||||
* }
|
||||
*
|
||||
* becomes:
|
||||
*
|
||||
* temp = false;
|
||||
* if (cond1) {
|
||||
* s1;
|
||||
* temp = cond2;
|
||||
* s2;
|
||||
* } else {
|
||||
* s3;
|
||||
* temp = cond3;
|
||||
* s4;
|
||||
* }
|
||||
* discard temp;
|
||||
*
|
||||
* If there are multiple conditional discards, we need only deal with one of
|
||||
* them. Repeatedly applying this pass will take care of the others.
|
||||
*
|
||||
* Unconditional discards are treated as having a condition of "true".
|
||||
*/
|
||||
|
||||
#include "glsl_types.h"
|
||||
#include "ir.h"
|
||||
|
||||
class lower_discard_visitor : public ir_hierarchical_visitor {
|
||||
public:
|
||||
lower_discard_visitor()
|
||||
{
|
||||
this->progress = false;
|
||||
}
|
||||
|
||||
ir_visitor_status visit_leave(ir_if *);
|
||||
|
||||
bool progress;
|
||||
};
|
||||
|
||||
|
||||
bool
|
||||
lower_discard(exec_list *instructions)
|
||||
{
|
||||
lower_discard_visitor v;
|
||||
|
||||
visit_list_elements(&v, instructions);
|
||||
|
||||
return v.progress;
|
||||
}
|
||||
|
||||
|
||||
static ir_discard *
|
||||
find_discard(exec_list &instructions)
|
||||
{
|
||||
foreach_list(n, &instructions) {
|
||||
ir_discard *ir = ((ir_instruction *) n)->as_discard();
|
||||
if (ir != NULL)
|
||||
return ir;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
replace_discard(void *mem_ctx, ir_variable *var, ir_discard *ir)
|
||||
{
|
||||
ir_rvalue *condition = ir->condition;
|
||||
|
||||
/* For unconditional discards, use "true" as the condition. */
|
||||
if (condition == NULL)
|
||||
condition = new(mem_ctx) ir_constant(true);
|
||||
|
||||
ir_assignment *assignment =
|
||||
new(mem_ctx) ir_assignment(new(mem_ctx) ir_dereference_variable(var),
|
||||
condition, NULL);
|
||||
|
||||
ir->replace_with(assignment);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
lower_discard_visitor::visit_leave(ir_if *ir)
|
||||
{
|
||||
ir_discard *then_discard = find_discard(ir->then_instructions);
|
||||
ir_discard *else_discard = find_discard(ir->else_instructions);
|
||||
|
||||
if (then_discard == NULL && else_discard == NULL)
|
||||
return visit_continue;
|
||||
|
||||
void *mem_ctx = talloc_parent(ir);
|
||||
|
||||
ir_variable *temp = new(mem_ctx) ir_variable(glsl_type::bool_type,
|
||||
"discard_cond_temp",
|
||||
ir_var_temporary);
|
||||
ir_assignment *temp_initializer =
|
||||
new(mem_ctx) ir_assignment(new(mem_ctx) ir_dereference_variable(temp),
|
||||
new(mem_ctx) ir_constant(false), NULL);
|
||||
|
||||
ir->insert_before(temp);
|
||||
ir->insert_before(temp_initializer);
|
||||
|
||||
if (then_discard != NULL)
|
||||
replace_discard(mem_ctx, temp, then_discard);
|
||||
|
||||
if (else_discard != NULL)
|
||||
replace_discard(mem_ctx, temp, else_discard);
|
||||
|
||||
ir_discard *discard = then_discard != NULL ? then_discard : else_discard;
|
||||
discard->condition = new(mem_ctx) ir_dereference_variable(temp);
|
||||
ir->insert_after(discard);
|
||||
|
||||
this->progress = true;
|
||||
|
||||
return visit_continue;
|
||||
}
|
@@ -40,8 +40,19 @@
|
||||
extern "C" struct gl_shader *
|
||||
_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
|
||||
|
||||
extern "C" void
|
||||
_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
|
||||
struct gl_shader *sh);
|
||||
|
||||
/* Copied from shader_api.c for the stand-alone compiler.
|
||||
*/
|
||||
void
|
||||
_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
|
||||
struct gl_shader *sh)
|
||||
{
|
||||
*ptr = sh;
|
||||
}
|
||||
|
||||
struct gl_shader *
|
||||
_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type)
|
||||
{
|
||||
@@ -197,26 +208,7 @@ compile_shader(GLcontext *ctx, struct gl_shader *shader)
|
||||
if (!state->error && !shader->ir->is_empty()) {
|
||||
bool progress;
|
||||
do {
|
||||
progress = false;
|
||||
|
||||
progress = do_function_inlining(shader->ir) || progress;
|
||||
progress = do_if_simplification(shader->ir) || progress;
|
||||
progress = do_copy_propagation(shader->ir) || progress;
|
||||
progress = do_dead_code_local(shader->ir) || progress;
|
||||
progress = do_dead_code_unlinked(shader->ir) || progress;
|
||||
progress = do_tree_grafting(shader->ir) || progress;
|
||||
progress = do_constant_propagation(shader->ir) || progress;
|
||||
progress = do_constant_variable_unlinked(shader->ir) || progress;
|
||||
progress = do_constant_folding(shader->ir) || progress;
|
||||
progress = do_algebraic(shader->ir) || progress;
|
||||
progress = do_vec_index_to_swizzle(shader->ir) || progress;
|
||||
progress = do_vec_index_to_cond_assign(shader->ir) || progress;
|
||||
progress = do_swizzle_swizzle(shader->ir) || progress;
|
||||
|
||||
loop_state *ls = analyze_loop_variables(shader->ir);
|
||||
progress = set_loop_controls(shader->ir, ls) || progress;
|
||||
progress = unroll_loops(shader->ir, ls, 32) || progress;
|
||||
delete ls;
|
||||
progress = do_common_optimization(shader->ir, false, 32);
|
||||
} while (progress);
|
||||
|
||||
validate_ir_tree(shader->ir);
|
||||
@@ -319,7 +311,7 @@ main(int argc, char **argv)
|
||||
printf("Info log for linking:\n%s\n", whole_program->InfoLog);
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < whole_program->_NumLinkedShaders; i++)
|
||||
for (unsigned i = 0; i < MESA_SHADER_TYPES; i++)
|
||||
talloc_free(whole_program->_LinkedShaders[i]);
|
||||
|
||||
talloc_free(whole_program);
|
||||
|
180
src/glsl/opt_discard_simplification.cpp
Normal file
180
src/glsl/opt_discard_simplification.cpp
Normal file
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
* Copyright © 2010 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file opt_discard_simplification.cpp
|
||||
*
|
||||
* This pass simplifies if-statements and loops containing unconditional
|
||||
* discards.
|
||||
*
|
||||
* Case 1: Both branches contain unconditional discards:
|
||||
* -----------------------------------------------------
|
||||
*
|
||||
* if (cond) {
|
||||
* s1;
|
||||
* discard;
|
||||
* s2;
|
||||
* } else {
|
||||
* s3;
|
||||
* discard;
|
||||
* s4;
|
||||
* }
|
||||
*
|
||||
* becomes:
|
||||
*
|
||||
* discard
|
||||
*
|
||||
* Case 2: The "then" clause contains an unconditional discard:
|
||||
* ------------------------------------------------------------
|
||||
*
|
||||
* if (cond) {
|
||||
* s1;
|
||||
* discard;
|
||||
* s2;
|
||||
* } else {
|
||||
* s3;
|
||||
* }
|
||||
*
|
||||
* becomes:
|
||||
*
|
||||
* if (cond) {
|
||||
* discard;
|
||||
* } else {
|
||||
* s3;
|
||||
* }
|
||||
*
|
||||
* Case 3: The "else" clause contains an unconditional discard:
|
||||
* ------------------------------------------------------------
|
||||
*
|
||||
* if (cond) {
|
||||
* s1;
|
||||
* } else {
|
||||
* s2;
|
||||
* discard;
|
||||
* s3;
|
||||
* }
|
||||
*
|
||||
* becomes:
|
||||
*
|
||||
* if (cond) {
|
||||
* s1;
|
||||
* } else {
|
||||
* discard;
|
||||
* }
|
||||
*/
|
||||
|
||||
#include "glsl_types.h"
|
||||
#include "ir.h"
|
||||
|
||||
class discard_simplifier : public ir_hierarchical_visitor {
|
||||
public:
|
||||
discard_simplifier()
|
||||
{
|
||||
this->progress = false;
|
||||
}
|
||||
|
||||
ir_visitor_status visit_enter(ir_if *);
|
||||
ir_visitor_status visit_enter(ir_loop *);
|
||||
|
||||
bool progress;
|
||||
};
|
||||
|
||||
static ir_discard *
|
||||
find_unconditional_discard(exec_list &instructions)
|
||||
{
|
||||
foreach_list(n, &instructions) {
|
||||
ir_discard *ir = ((ir_instruction *) n)->as_discard();
|
||||
if (ir != NULL && ir->condition == NULL)
|
||||
return ir;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool
|
||||
is_only_instruction(ir_discard *discard)
|
||||
{
|
||||
return (discard->prev->is_head_sentinel() &&
|
||||
discard->next->is_tail_sentinel());
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
discard_simplifier::visit_enter(ir_if *ir)
|
||||
{
|
||||
ir_discard *then_discard = find_unconditional_discard(ir->then_instructions);
|
||||
ir_discard *else_discard = find_unconditional_discard(ir->else_instructions);
|
||||
|
||||
if (then_discard == NULL && else_discard == NULL)
|
||||
return visit_continue;
|
||||
|
||||
/* If both branches result in discard, replace whole if with discard. */
|
||||
if (then_discard != NULL && else_discard != NULL) {
|
||||
this->progress = true;
|
||||
ir->replace_with(then_discard);
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
|
||||
/* Otherwise, one branch has a discard. */
|
||||
if (then_discard != NULL && !is_only_instruction(then_discard)) {
|
||||
this->progress = true;
|
||||
ir->then_instructions.make_empty();
|
||||
ir->then_instructions.push_tail(then_discard);
|
||||
} else if (else_discard != NULL && !is_only_instruction(else_discard)) {
|
||||
this->progress = true;
|
||||
ir->else_instructions.make_empty();
|
||||
ir->else_instructions.push_tail(else_discard);
|
||||
}
|
||||
|
||||
visit_list_elements(this, &ir->then_instructions);
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
discard_simplifier::visit_enter(ir_loop *ir)
|
||||
{
|
||||
ir_discard *discard = find_unconditional_discard(ir->body_instructions);
|
||||
|
||||
if (discard) {
|
||||
ir->replace_with(discard);
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
bool
|
||||
do_discard_simplification(exec_list *instructions)
|
||||
{
|
||||
/* Look for a top-level unconditional discard */
|
||||
ir_discard *discard = find_unconditional_discard(*instructions);
|
||||
if (discard != NULL) {
|
||||
instructions->make_empty();
|
||||
instructions->push_tail(discard);
|
||||
return true;
|
||||
}
|
||||
|
||||
discard_simplifier v;
|
||||
|
||||
visit_list_elements(&v, instructions);
|
||||
|
||||
return v.progress;
|
||||
}
|
@@ -62,7 +62,7 @@ read_atom(void *ctx, const char *& src)
|
||||
|
||||
// Check if the atom is a number.
|
||||
char *float_end = NULL;
|
||||
double f = strtod(src, &float_end);
|
||||
double f = glsl_strtod(src, &float_end);
|
||||
if (float_end != src) {
|
||||
char *int_end = NULL;
|
||||
int i = strtol(src, &int_end, 10);
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#ifndef S_EXPRESSION_H
|
||||
#define S_EXPRESSION_H
|
||||
|
||||
#include "strtod.h"
|
||||
#include "list.h"
|
||||
|
||||
#define SX_AS_(t,x) ((x) && ((s_expression*) x)->is_##t()) ? ((s_##t*) (x)) \
|
||||
|
56
src/glsl/strtod.c
Normal file
56
src/glsl/strtod.c
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright 2010 VMware, Inc.
|
||||
* 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 VMWARE 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 <stdlib.h>
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
#include <locale.h>
|
||||
#ifdef __APPLE__
|
||||
#include <xlocale.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "strtod.h"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Wrapper around strtod which uses the "C" locale so the decimal
|
||||
* point is always '.'
|
||||
*/
|
||||
double
|
||||
glsl_strtod(const char *s, char **end)
|
||||
{
|
||||
#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
|
||||
static locale_t loc = NULL;
|
||||
if (!loc) {
|
||||
loc = newlocale(LC_CTYPE_MASK, "C", NULL);
|
||||
}
|
||||
return strtod_l(s, end, loc);
|
||||
#else
|
||||
return strtod(s, end);
|
||||
#endif
|
||||
}
|
43
src/glsl/strtod.h
Normal file
43
src/glsl/strtod.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright 2010 VMware, Inc.
|
||||
* 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 VMWARE 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.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef STRTOD_H
|
||||
#define STRTOD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern double
|
||||
glsl_strtod(const char *s, char **end);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user