Compare commits
206 Commits
mesa-8.0.1
...
mesa-8.0.4
Author | SHA1 | Date | |
---|---|---|---|
|
c1f4867c89 | ||
|
7c2225b026 | ||
|
827c99e1a0 | ||
|
0d38468098 | ||
|
fc3d2c4623 | ||
|
fe5541f64c | ||
|
1ce1a4526f | ||
|
e0e1ca353b | ||
|
04f7c32f78 | ||
|
da8d65fde4 | ||
|
57a273d89b | ||
|
099bc3aaea | ||
|
3539914e49 | ||
|
de8bb6a59b | ||
|
646ac02462 | ||
|
dad7547b98 | ||
|
2bf8f39cc8 | ||
|
5c65bcd259 | ||
|
c60a83adc2 | ||
|
db555c5d59 | ||
|
f1423b1c20 | ||
|
21d77c51c1 | ||
|
fc7d43ee9a | ||
|
ed8fcc0c82 | ||
|
ed1da7e503 | ||
|
74f21adbb7 | ||
|
09c746f2dc | ||
|
ab33bc8c7b | ||
|
1edeb2cec1 | ||
|
afaf5b59e4 | ||
|
1fc9b5a213 | ||
|
9b38691927 | ||
|
6f1218385a | ||
|
5c2f9828e0 | ||
|
a03d5e6a88 | ||
|
5fde348eb8 | ||
|
a8fed44e9e | ||
|
0f7dffae69 | ||
|
7a34e98b61 | ||
|
39a0b79c6f | ||
|
5c8f5e9af0 | ||
|
a72fdfed7b | ||
|
ba45b6deea | ||
|
04c35a5dff | ||
|
3bcddd5e89 | ||
|
313d48a110 | ||
|
076805c9c2 | ||
|
d715d3f4a8 | ||
|
af47c324aa | ||
|
1af70e475f | ||
|
1f4f86e951 | ||
|
6dd1270008 | ||
|
29c67f9203 | ||
|
29c4e92b2c | ||
|
26f7f8076d | ||
|
dc8134fe98 | ||
|
a211a140a6 | ||
|
7fd94900e0 | ||
|
e902faa18a | ||
|
cb70af5c94 | ||
|
3d657b14b4 | ||
|
84e74ca275 | ||
|
44f550ef90 | ||
|
1659d87afe | ||
|
60dffb92de | ||
|
b5b65af5fa | ||
|
e0e8f1efad | ||
|
91874c3252 | ||
|
2d105870c9 | ||
|
912acd045c | ||
|
1f90817e3c | ||
|
1974502223 | ||
|
0bf439e5da | ||
|
d28e968edb | ||
|
9f67d73830 | ||
|
84f537e72b | ||
|
3eaa27789d | ||
|
6e8c30304e | ||
|
3e5f17b5f9 | ||
|
6b9363a316 | ||
|
4d9ff6af59 | ||
|
110111bc5b | ||
|
2aaaa18853 | ||
|
7e824b728b | ||
|
fc65fc5035 | ||
|
c9088b5251 | ||
|
8537544be9 | ||
|
b4693383bf | ||
|
5eb2e5bdc7 | ||
|
ca8be6fe2b | ||
|
aa17a8b81e | ||
|
b304eca8df | ||
|
97bff96352 | ||
|
9405567c28 | ||
|
e69758260b | ||
|
869c34527a | ||
|
7e7f099108 | ||
|
cc2413c889 | ||
|
1ebdf22224 | ||
|
a3f6e8f431 | ||
|
5696077656 | ||
|
815d6e3f2f | ||
|
c9aa4607c5 | ||
|
a164f23d09 | ||
|
31aaf56f28 | ||
|
9bbd435900 | ||
|
fe64ad0cba | ||
|
ae02489a6d | ||
|
00a182d66e | ||
|
88cbc43d1f | ||
|
d342246e2b | ||
|
51e1111bd6 | ||
|
b85c5d9344 | ||
|
eb2eb97baf | ||
|
7032a56c85 | ||
|
3aaf3c85e4 | ||
|
0a24f0868f | ||
|
a325146f11 | ||
|
64c69a5b86 | ||
|
8a7cb5d21c | ||
|
865ad64e06 | ||
|
0b2ffc647d | ||
|
0d1049ff26 | ||
|
78b66adc1a | ||
|
d7b1a7bfb1 | ||
|
4d5b40a5a2 | ||
|
1e987b6e7a | ||
|
3158636f4c | ||
|
a341475398 | ||
|
d953370670 | ||
|
8e8c974fff | ||
|
a0f010db1c | ||
|
9de17f5f4d | ||
|
abd1431707 | ||
|
c2fdcc1e12 | ||
|
f1b6c69137 | ||
|
e72cbdf395 | ||
|
bf7407f631 | ||
|
9724c8d13c | ||
|
7e624edba4 | ||
|
03354a3c4a | ||
|
0a25c4c384 | ||
|
fa68a8bae3 | ||
|
064c324d8d | ||
|
8700db8c87 | ||
|
53f88f8606 | ||
|
0558ac1fd7 | ||
|
649a8952df | ||
|
f36e638c76 | ||
|
f818673acb | ||
|
8010ff17ae | ||
|
93e94cbb48 | ||
|
4e172532d1 | ||
|
e995b41a16 | ||
|
fca35d2e5e | ||
|
4dd228a0a9 | ||
|
108d544cae | ||
|
546abd2503 | ||
|
bcc5caf642 | ||
|
69d8a25d42 | ||
|
6095a17534 | ||
|
bb30e76328 | ||
|
49ed43b6de | ||
|
9f150ffe8e | ||
|
edeb3976d4 | ||
|
a30790a9a3 | ||
|
3d436f6c37 | ||
|
8d40c2f5e2 | ||
|
d146c50358 | ||
|
1709144338 | ||
|
54f7391664 | ||
|
89e796aef5 | ||
|
0bf0ba44de | ||
|
5f7204c3bb | ||
|
dc20396a14 | ||
|
770f785a6f | ||
|
4b52be53a4 | ||
|
e26aa8c660 | ||
|
2f5182cfcf | ||
|
7fe667a18d | ||
|
3d036f3f0a | ||
|
b056fc0741 | ||
|
adcb180671 | ||
|
d982036c3a | ||
|
63c8f7142c | ||
|
485d1c491a | ||
|
7b1fbc6889 | ||
|
7f8ac0e70f | ||
|
5cfc7d1167 | ||
|
fae3a31bbb | ||
|
b9f8cb9e0b | ||
|
aabbf5adac | ||
|
83728cf4ce | ||
|
8836517250 | ||
|
bc9d4ae6c7 | ||
|
437ed1faaf | ||
|
fa9efdbab8 | ||
|
151d32dd45 | ||
|
1fae49b0f5 | ||
|
9664fb70dc | ||
|
a30809878f | ||
|
9f44387e48 | ||
|
16cc79f975 | ||
|
82043eb72d | ||
|
2845a0be81 | ||
|
d38a295289 |
8
Makefile
8
Makefile
@@ -184,7 +184,7 @@ ultrix-gcc:
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
PACKAGE_VERSION=8.0.1
|
||||
PACKAGE_VERSION=8.0.4
|
||||
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
|
||||
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
|
||||
|
||||
@@ -199,6 +199,12 @@ EXTRA_FILES = \
|
||||
src/glsl/glcpp/glcpp-lex.c \
|
||||
src/glsl/glcpp/glcpp-parse.c \
|
||||
src/glsl/glcpp/glcpp-parse.h \
|
||||
src/mesa/main/api_exec_es1.c \
|
||||
src/mesa/main/api_exec_es1_dispatch.h \
|
||||
src/mesa/main/api_exec_es1_remap_helper.h \
|
||||
src/mesa/main/api_exec_es2.c \
|
||||
src/mesa/main/api_exec_es2_dispatch.h \
|
||||
src/mesa/main/api_exec_es2_remap_helper.h \
|
||||
src/mesa/program/lex.yy.c \
|
||||
src/mesa/program/program_parse.tab.c \
|
||||
src/mesa/program/program_parse.tab.h
|
||||
|
@@ -334,7 +334,9 @@ case $ARCH in
|
||||
# environment. If so, pass -m32 flag to linker.
|
||||
set ${OBJECTS}
|
||||
ABI32=`file $1 | grep 32-bit`
|
||||
if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
|
||||
ARM=`file $1 | grep ARM`
|
||||
# Do not add "-m32" option for arm.
|
||||
if [ -z "$ARM" -a "${ABI32}" -a `uname -m` = "x86_64" ] ; then
|
||||
OPTS="-m32 ${OPTS}"
|
||||
fi
|
||||
|
||||
@@ -391,7 +393,9 @@ case $ARCH in
|
||||
# environment. If so, pass -m32 flag to linker.
|
||||
set ${OBJECTS}
|
||||
ABI32=`file $1 | grep 32-bit`
|
||||
if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
|
||||
ARM=`file $1 | grep ARM`
|
||||
# Do not add "-m32" option for arm.
|
||||
if [ -z "$ARM" -a "${ABI32}" -a `uname -m` = "x86_64" ] ; then
|
||||
OPTS="-m32 ${OPTS}"
|
||||
fi
|
||||
if [ "${ALTOPTS}" ] ; then
|
||||
|
@@ -9,8 +9,8 @@ INSTALL_DIR = /usr/X11
|
||||
X11_DIR = $(INSTALL_DIR)
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
CC = $(shell xcrun -find cc)
|
||||
CXX = $(shell xcrun -find c++)
|
||||
PIC_FLAGS = -fPIC
|
||||
DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
|
||||
-DGLX_ALIAS_UNSUPPORTED \
|
||||
@@ -24,11 +24,14 @@ DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
|
||||
# -DIN_DRI_DRIVER
|
||||
|
||||
ARCH_FLAGS += $(RC_CFLAGS)
|
||||
INCLUDE_FLAGS = -I$(INSTALL_DIR)/include -I$(X11_DIR)/include
|
||||
OPT_FLAGS = -g3 -gdwarf-2 -Os -ffast-math -fno-strict-aliasing
|
||||
WARN_FLAGS = -Wall -Wmissing-prototypes
|
||||
|
||||
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -fvisibility=hidden \
|
||||
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
|
||||
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing -fvisibility=hidden \
|
||||
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
|
||||
CFLAGS = -std=c99 -fvisibility=hidden \
|
||||
$(OPT_FLAGS) $(WARN_FLAGS) $(INCLUDE_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) $(EXTRA_CFLAGS)
|
||||
CXXFLAGS = -fvisibility=hidden \
|
||||
$(OPT_FLAGS) $(WARN_FLAGS) $(INCLUDE_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) $(EXTRA_CFLAGS)
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = lib$(GL_LIB).dylib
|
||||
@@ -44,10 +47,10 @@ GLW_LIB_GLOB = lib$(GLW_LIB).*dylib
|
||||
OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib
|
||||
VG_LIB_GLOB = lib$(VG_LIB).*dylib
|
||||
|
||||
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
|
||||
OSMESA_LIB_DEPS =
|
||||
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
|
||||
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
|
||||
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11-xcb -lxcb -lX11 -lXext $(EXTRA_LDFLAGS)
|
||||
OSMESA_LIB_DEPS = $(EXTRA_LDFLAGS)
|
||||
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LDFLAGS)
|
||||
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt $(EXTRA_LDFLAGS)
|
||||
|
||||
SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu
|
||||
GLU_DIRS = sgi
|
||||
|
7
configs/darwin-fat-intel
Normal file
7
configs/darwin-fat-intel
Normal file
@@ -0,0 +1,7 @@
|
||||
# Configuration for Darwin / MacOS X, making 32bit and 64bit fat dynamic libs for intel
|
||||
|
||||
RC_CFLAGS=-arch i386 -arch x86_64
|
||||
|
||||
include $(TOP)/configs/darwin
|
||||
|
||||
CONFIG_NAME = darwin-fat-intel
|
@@ -10,7 +10,7 @@ CONFIG_NAME = default
|
||||
# Version info
|
||||
MESA_MAJOR=8
|
||||
MESA_MINOR=0
|
||||
MESA_TINY=0
|
||||
MESA_TINY=4
|
||||
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
|
||||
|
||||
# external projects. This should be useless now that we use libdrm.
|
||||
|
@@ -168,9 +168,6 @@ esac
|
||||
dnl Add flags for gcc and g++
|
||||
if test "x$GCC" = xyes; then
|
||||
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99"
|
||||
if test "x$CLANG" = "xno"; then
|
||||
CFLAGS="$CFLAGS -ffast-math"
|
||||
fi
|
||||
|
||||
# Enable -fvisibility=hidden if using a gcc that supports it
|
||||
save_CFLAGS="$CFLAGS"
|
||||
|
@@ -11,6 +11,22 @@
|
||||
<H1>News</H1>
|
||||
|
||||
|
||||
<h2>March 21, 2012</h2>
|
||||
|
||||
<p>
|
||||
<a href="relnotes-8.0.2.html">Mesa 8.0.2</a> is released.
|
||||
This is a bug fix release.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>February 16, 2012</h2>
|
||||
|
||||
<p>
|
||||
<a href="relnotes-8.0.1.html">Mesa 8.0.1</a> is released.
|
||||
This is a bug fix release.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>February 9, 2012</h2>
|
||||
|
||||
<p>
|
||||
|
@@ -28,7 +28,9 @@ for DRI hardware acceleration.
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
tdb
|
||||
4855c2d93bd2ebd43f384bdcc92c9a27 MesaLib-8.0.1.tar.gz
|
||||
24eeebf66971809d8f40775a379b36c9 MesaLib-8.0.1.tar.bz2
|
||||
54e745d14dac5717f7f65b4e2d5c1df2 MesaLib-8.0.1.zip
|
||||
</pre>
|
||||
|
||||
<h2>New features</h2>
|
||||
|
160
docs/relnotes-8.0.2.html
Normal file
160
docs/relnotes-8.0.2.html
Normal file
@@ -0,0 +1,160 @@
|
||||
<HTML>
|
||||
|
||||
<head>
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
</head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 8.0.2 Release Notes / March 21, 2012</H1>
|
||||
|
||||
<p>
|
||||
Mesa 8.0.2 is a bug fix release which fixes bugs found since the 8.0.1 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 8.0.2 implements the OpenGL 3.0 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 3.0.
|
||||
</p>
|
||||
<p>
|
||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||
for DRI hardware acceleration.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
70eb3dc74fbfcd72f6776268ee1db52e MesaLib-8.0.2.tar.gz
|
||||
a368104e5700707048dc3e8691a9a7a1 MesaLib-8.0.2.tar.bz2
|
||||
d5e5cdb85d2afdbcd1c0623d3ed1c54d MesaLib-8.0.2.zip
|
||||
</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=38720">Bug 38720</a> - [SNB] Trine triggers a GPU hang</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=40059">Bug 40059</a> - [SNB] hang in "Amnesia: The Dark Descent" demo</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45216">Bug 45216</a> - [SNB] GPU hang in OilRush</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=46631">Bug 46631</a> - It's really hard to hit the fast path for the fallback glReadPixels code</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=46679">Bug 46679</a> - glReadPixels on a luminance texture returns the wrong values</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=46311">Bug 46311</a> - Missing support of point size in Mesa core</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=46665">Bug 46665</a> - [PNV] webgl conformance case max texture fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45975">Bug 45975</a> - [Gen4 + ILK] render with pointcoord will fail to render</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=46666">Bug 46666</a> - [PNV] webgl conformance case NPOT case fails with TEXTURE_MIN_FILTER set to LINEAR</li>
|
||||
|
||||
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </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-8.0.1..mesa-8.0.2
|
||||
</pre>
|
||||
|
||||
<p>Brian Paul (7):
|
||||
<ul>
|
||||
<li>svga: add null vs pointer check in update_need_pipeline()</li>
|
||||
<li>util: add mutex lock in u_debug_memory.c code</li>
|
||||
<li>mesa: add _mesa_rebase_rgba_float/uint() functions</li>
|
||||
<li>mesa: use _mesa_rebase_rgba_float/uint() in glReadPixels code</li>
|
||||
<li>mesa: use _mesa_rebase_rgba_float/uint() in glGetTexImage code</li>
|
||||
<li>mesa: fix GL_LUMINANCE handling in glGetTexImage</li>
|
||||
<li>docs: add links to 8.0.1 release notes</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Daniel Vetter (1):
|
||||
<ul>
|
||||
<li>i965: fixup W-tile offset computation to take swizzling into account</li>
|
||||
<ul></p>
|
||||
|
||||
<p>Dylan Noblesmith (1):
|
||||
<ul>
|
||||
<li>mesa: add back glGetnUniform*v() overflow error reporting</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Ian Romanick (1):
|
||||
<ul>
|
||||
<li>docs: Add 8.0.1 release md5sums</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Jakob Bornecrantz (3):
|
||||
<ul>
|
||||
<li>mesa: Include mesa ES mapi generated files</li>
|
||||
<li>mesa: Bump version number to 8.0.2</li>
|
||||
<li>docs: Add 8.0.2 release notes</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Jeremy Huddleston (3):
|
||||
<ul>
|
||||
<li>darwin: config file cleanups</li>
|
||||
<li>darwin: Build create_context.c</li>
|
||||
<li>darwin: Link against libxcb</li>
|
||||
</ul></p>
|
||||
|
||||
<p>José Fonseca (1):
|
||||
<ul>
|
||||
<li>svga: Clamp advertised PIPE_SHADER_CAP_MAX_TEMPS to SVGA3D_TEMPREG_MAX.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Kenneth Graunke (2):
|
||||
<ul>
|
||||
<li>i965: Only set Last Render Target Select on the last FB write.</li>
|
||||
<li>i965: Fix Gen6+ dynamic state upper bound on older kernels.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Marek Olšák (1):
|
||||
<ul>
|
||||
<li>gallium/rtasm: properly detect SSE and SSE2</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Neil Roberts (1):
|
||||
<ul>
|
||||
<li>mesa: Don't disable fast path for normalized types</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Tom Stellard (1):
|
||||
<ul>
|
||||
<li>r300/compiler: Fix bug when lowering KILP on r300 cards</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Yuanhan Liu (6):
|
||||
<ul>
|
||||
<li>mesa: let GL3 buf obj queries not depend on opengl major version</li>
|
||||
<li>tnl: let _TNL_ATTRIB_POINTSIZE do not depend on ctx->VertexProgram._Enabled</li>
|
||||
<li>i915: fix wrong rendering of gl_PointSize on Pineview</li>
|
||||
<li>i915: move the FALLBACK_DRAW_OFFSET check outside the drawing rect check</li>
|
||||
<li>i965: handle gl_PointCoord for Gen4 and Gen5 platforms</li>
|
||||
<li>i915: fallback for NPOT cubemap texture</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Zack Rusin (3):
|
||||
<ul>
|
||||
<li>svga: fix a crash happening before setting fragment shaders.</li>
|
||||
<li>svga: Fix stencil op mapping</li>
|
||||
<li>svga: fix the rasterizer state resets</li>
|
||||
</ul></p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
319
docs/relnotes-8.0.3.html
Normal file
319
docs/relnotes-8.0.3.html
Normal file
@@ -0,0 +1,319 @@
|
||||
<HTML>
|
||||
|
||||
<head>
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
</head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 8.0.3 Release Notes / May 18, 2012</H1>
|
||||
|
||||
<p>
|
||||
Mesa 8.0.3 is a bug fix release which fixes bugs found since the 8.0.2 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 8.0.3 implements the OpenGL 3.0 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 3.0.
|
||||
</p>
|
||||
<p>
|
||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||
for DRI hardware acceleration.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
b7210a6d6e4584bd852ab29294ce717e MesaLib-8.0.3.tar.gz
|
||||
cc5ee15e306b8c15da6a478923797171 MesaLib-8.0.3.tar.bz2
|
||||
32773634a0f7e70a680505a81426eccf MesaLib-8.0.3.zip
|
||||
</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=28138">Bug 28138</a> - [G45] Regnum Online, sparkling in in-game rendering</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30102">Bug 30102</a> - glean depthStencil test fails BadLength with indirect non-swrast rendering</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=40361">Bug 40361</a> - Glitches on X3100 after upgrade to 7.11</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=41152">Bug 41152</a> - [glsl] Shader backend in Regnum Online does not work</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=41216">Bug 41216</a> - [bisected pineview]oglc filtercubemin(basic.sizedRGBA) fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=41372">Bug 41372</a> - i830_state.c PBO crash</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=41495">Bug 41495</a> - i830: intel_get_vb_max / intel_batchbuffer_space mismatch.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=44701">Bug 44701</a> - Regnum online textures flickering</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=44961">Bug 44961</a> - [bisected i965] oglc sRGB(Mipmap.1D_textures) regressed</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=44970">Bug 44970</a> - [i965]oglc max_values(negative.textureSize.textureCube) segfaults</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45214">Bug 45214</a> - Textures disappearing or missing in RegnumOnline OpenGL game</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45558">Bug 45558</a> - cannot render on a drawable of size equal the max framebuffer size</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45921">Bug 45921</a> - [r300g, bisected] Multiple piglit regressions after glsl_to_tgsi changes</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=46303">Bug 46303</a> - [SNB] segfault in intel_miptree_release()</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=46739">Bug 46739</a> - [snb-m-gt2+] compiz crashed with SIGSEGV in intel_miptree_release()</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=46834">Bug 46834</a> - small performance when playing flightgear (swrast fallback through GTT mapping)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47126">Bug 47126</a> - tests/fbo/fbo-array.c:109: create_array_fbo: Assertion `glGetError() == 0' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48218">Bug 48218</a> - brw_fs_schedule_instructions.cpp segfault due to accessing not allocated last_mrf_write[16]</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48545">Bug 48545</a> - LLVMpipe glReadPixels Firefox hits the slow path (WebGL rendering)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=49124">Bug 49124</a> - swrast/s_texfetch.c:1156: set_fetch_functions: Assertion `texImage->FetchTexel' failed.</li>
|
||||
|
||||
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </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-8.0.2..mesa-8.0.3
|
||||
</pre>
|
||||
|
||||
<p>Alban Browaeys (1):
|
||||
<ul>
|
||||
<li>dri/i915: Fix off-by-one in i830 clip region size.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Alex Deucher (2):
|
||||
<ul>
|
||||
<li>r200: fix fog coordinate emit</li>
|
||||
<li>radeon: fix fog coordinate emit</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Alexander von Gluck (4):
|
||||
<ul>
|
||||
<li>llvmpipe: fix symbol conflict on Haiku</li>
|
||||
<li>svga: fix typedef conflicts on Haiku</li>
|
||||
<li>mesa: Don't use newlocale on Haiku</li>
|
||||
<li>glsl: Don't use newlocale on Haiku</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Anuj Phogat (4):
|
||||
<ul>
|
||||
<li>mesa: fix issues with texture border and array textures</li>
|
||||
<li>mesa: Fix valid texture target test in _mesa_GetTexLevelParameteriv()</li>
|
||||
<li>mesa: Fix the cause of piglit test fbo-array failure</li>
|
||||
<li>intel: Fix a case when mapping large texture fails</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Brian Paul (17):
|
||||
<ul>
|
||||
<li>mesa: add a couple fast-paths to fast_read_rgba_pixels_memcpy()</li>
|
||||
<li>mesa/gdi: remove wmesa_set_renderbuffer_funcs() function</li>
|
||||
<li>mesa/gdi: remove clear_color() function</li>
|
||||
<li>mesa: bump version to 8.0.2 in configs/default</li>
|
||||
<li>swrast: include s_fragprog.h to silence warnings</li>
|
||||
<li>mesa: remove LSB-first pixel packing check in glReadPixels</li>
|
||||
<li>mesa: fix error in _mesa_format_matches_format_and_type() for RGB888</li>
|
||||
<li>mesa: add BGR888 code in _mesa_format_matches_format_and_type()</li>
|
||||
<li>vbo: fix node_attrsz[] usage in vbo_bind_vertex_list()</li>
|
||||
<li>mesa: add missing texture integer test in glTexSubImage()</li>
|
||||
<li>mesa: add missing return after _mesa_error() in update_array()</li>
|
||||
<li>glsl: propagate MaxUnrollIterations to the optimizer's loop unroller</li>
|
||||
<li>st/mesa: set MaxUnrollIterations = 255</li>
|
||||
<li>st/mesa: no-op glCopyPixels if source region is out of bounds</li>
|
||||
<li>mesa: do more teximage error checking for generic compressed formats</li>
|
||||
<li>mesa: fix/add error check in _mesa_ColorMaterial()</li>
|
||||
<li>mesa: fix glMaterial / dlist bug</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Chad Versace (3):
|
||||
<ul>
|
||||
<li>glsl: Fix Android build</li>
|
||||
<li>main: Fix memory leak in _mesa_make_extension_string()</li>
|
||||
<li>intel: Disable ARB_framebuffer_object in ES contexts</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Chris Wilson (1):
|
||||
<ul>
|
||||
<li>i830: Compute initial number of vertices from remaining batch space</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Dave Airlie (4):
|
||||
<ul>
|
||||
<li>mesa/format_unpack: add LUMINANCE 8/16 UINT/INT</li>
|
||||
<li>glx/drisw: avoid segfaults when we fail to get visual</li>
|
||||
<li>drisw: fix image stride calculation for 16-bit.</li>
|
||||
<li>intel: fix TFP at 16-bpp</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Dylan Noblesmith (7):
|
||||
<ul>
|
||||
<li>intel: fix null dereference processing HiZ buffer</li>
|
||||
<li>util: fix undefined behavior</li>
|
||||
<li>util: fix uninitialized table</li>
|
||||
<li>egl: fix uninitialized values</li>
|
||||
<li>st/vega: fix uninitialized values</li>
|
||||
<li>egl-static: fix printf warning</li>
|
||||
<li>i965: fix typo</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Eric Anholt (19):
|
||||
<ul>
|
||||
<li>i965/fs: Jump from discard statements to the end of the program when done.</li>
|
||||
<li>intel: Fix rendering from textures after RenderTexture().</li>
|
||||
<li>mesa: Fix handling of glCopyBufferSubData() for src == dst.</li>
|
||||
<li>i965/fs: Move GL_CLAMP handling to coordinate setup.</li>
|
||||
<li>i965/fs: Implement GL_CLAMP behavior on texture rectangles on gen6+.</li>
|
||||
<li>mesa: Fix push/pop of multisample coverage invert.</li>
|
||||
<li>mesa: Include the multisample enables under GL_MULTISAMPLE_BIT attrib as well.</li>
|
||||
<li>mesa: Fix display list handling for GL_ARB_draw_instanced.</li>
|
||||
<li>mesa: Fix display lists for draw_elements_base_vertex with draw_instanced.</li>
|
||||
<li>mesa: Add missing error check for first < 0 in glDrawArraysInstanced().</li>
|
||||
<li>i915: Fix piglit fbo-nodepth-test on i830.</li>
|
||||
<li>intel: Return success when asked to allocate a 0-width/height renderbuffer.</li>
|
||||
<li>mesa: Throw error on glGetActiveUniform inside Begin/End.</li>
|
||||
<li>i965/vs: Fix up swizzle for dereference_array of matrices.</li>
|
||||
<li>glsl: Fix indentation of switch code.</li>
|
||||
<li>glsl: Let the constructor figure out the types of switch-related expressions.</li>
|
||||
<li>glsl: Reject non-scalar switch expressions.</li>
|
||||
<li>glsl: Fix assertion failure on handling switch on uint expressions.</li>
|
||||
<li>mesa: Check for framebuffer completeness before looking at the rb.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Eugeni Dodonov (1):
|
||||
<ul>
|
||||
<li>intel: add PCI IDs for Ivy Bridge GT2 server variant</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Han Shen(沈涵) (1):
|
||||
<ul>
|
||||
<li>bin/mklib: remove '-m32' for arm linux</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Ian Romanick (1):
|
||||
<ul>
|
||||
<li>mesa: Bump version number to 8.0.3</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Jakob Bornecrantz (1):
|
||||
<ul>
|
||||
<li>docs: Add 8.0.2 md5sums</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Jeremy Huddleston (7):
|
||||
<ul>
|
||||
<li>darwin: Eliminate a pthread mutex leak</li>
|
||||
<li>darwin: Fix an error message</li>
|
||||
<li>darwin: Make reported errors more user-friendly</li>
|
||||
<li>darwin: Use ASL for logging</li>
|
||||
<li>darwin: Unlock our mutex before destroying it</li>
|
||||
<li>darwin: Eliminate a possible race condition while destroying a surface</li>
|
||||
<li>darwin: Address a build failure on Leopard and earlier OS versions</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Jon TURNEY (1):
|
||||
<ul>
|
||||
<li>Have __glImageSize handle format GL_DEPTH_STENCIL_NV the same way as the server does</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Jonas Maebe (2):
|
||||
<ul>
|
||||
<li>glapi: Correct size of allocated _glapi_table struct</li>
|
||||
<li>apple: Fix a use after free</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Jordan Justen (1):
|
||||
<ul>
|
||||
<li>mesa: Add primitive restart support to glArrayElement</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Kenneth Graunke (12):
|
||||
<ul>
|
||||
<li>i965: Actually upload sampler state pointers for the VS unit on Gen6.</li>
|
||||
<li>i965/fs: Fix FB writes that tried to use the non-existent m16 register.</li>
|
||||
<li>vbo: Remove pedantic warning about 'end' beind out of bounds.</li>
|
||||
<li>vbo: Ignore invalid element ranges which are outside VBO bounds.</li>
|
||||
<li>vbo: Rework checking of 'end' against _MaxElement.</li>
|
||||
<li>vbo: Eliminate short-circuiting in invalid-start case.</li>
|
||||
<li>i965: Fix GPU hangs in the dummy fragment shader.</li>
|
||||
<li>i965: Make the dummy fragment shader work in SIMD16 mode.</li>
|
||||
<li>drirc: Add force_glsl_extensions_warn workaround for Unigine Heaven.</li>
|
||||
<li>i965: Avoid explicit accumulator operands in SIMD16 mode on Gen7.</li>
|
||||
<li>intel: Remove pointless software fallback for glBitmap on Gen6.</li>
|
||||
<li>glsl: Fix broken constant expression handling for <, <=, >, and >=.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Kurt Roeckx (2):
|
||||
<ul>
|
||||
<li>i915: Compute maximum number of verts using the actual batchbuffer size.</li>
|
||||
<li>i915: Fix i830 polygon stipple from PBOs.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Marek Olšák (5):
|
||||
<ul>
|
||||
<li>r300g/swtcl: don't print an error when getting ClipVertex</li>
|
||||
<li>r300g/swtcl: don't enter u_vbuf_mgr</li>
|
||||
<li>r300g/swtcl: don't expose shader subroutine support</li>
|
||||
<li>r300g/swtcl: fix polygon offset</li>
|
||||
<li>r300g/swtcl: fix crash when back color is present in vertex shader</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Mathias Fröhlich (1):
|
||||
<ul>
|
||||
<li>glsl: Avoid excessive loop unrolling.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Matt Turner (1):
|
||||
<ul>
|
||||
<li>Remove -ffast-math from default CFLAGS</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Paul Berry (1):
|
||||
<ul>
|
||||
<li>i915: Initialize swrast_texture_image structure fields.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Roland Scheidegger (1):
|
||||
<ul>
|
||||
<li>mesa: check_index_bounds off-by-one fix</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Tom Stellard (2):
|
||||
<ul>
|
||||
<li>r300/compiler: Clear loop registers in vertex shaders w/o loops</li>
|
||||
<li>r300/compiler: Copy all instruction attributes during local transfoms</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Vinson Lee (5):
|
||||
<ul>
|
||||
<li>mesa: Fix memory leak in _mesa_get_uniform_location.</li>
|
||||
<li>linker: Fix memory leak in count_uniform_size::visit_field.</li>
|
||||
<li>swrast: Fix memory leaks in blit_linear.</li>
|
||||
<li>ir_to_mesa: Fix uninitialized member in add_uniform_to_shader.</li>
|
||||
<li>mesa: Fix memory leak in generate_mipmap_compressed.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Yuanhan Liu (2):
|
||||
<ul>
|
||||
<li>i915: set SPRITE_POINT_ENABLE bit correctly</li>
|
||||
<li>i965: fix wrong cube/3D texture layout</li>
|
||||
</ul></p>
|
||||
|
||||
</body>
|
||||
</html>
|
202
docs/relnotes-8.0.4.html
Normal file
202
docs/relnotes-8.0.4.html
Normal file
@@ -0,0 +1,202 @@
|
||||
<HTML>
|
||||
|
||||
<head>
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
</head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 8.0.4 Release Notes / July 10, 2012</H1>
|
||||
|
||||
<p>
|
||||
Mesa 8.0.4 is a bug fix release which fixes bugs found since the 8.0.2 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 8.0.4 implements the OpenGL 3.0 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 3.0.
|
||||
</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=45967">Bug 45967</a> - piglit getteximage-invalid-format-for-packed-type regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47742">Bug 47742</a> - [softpipe] piglit fbo-generatemipmap-array regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48141">Bug 48141</a> - [vmwgfx] src/gallium/auxiliary/util/u_inlines.h:256:pipe_buffer_map_range: Assertion `offset + length <= buffer->width0' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48472">Bug 48472</a> - GPU Lockup while running demo (rzr - the scene is dead) in wine</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50033">Bug 50033</a> - src/mesa/state_tracker/st_cb_fbo.c:379:st_render_texture: Assertion `strb->rtt_level <= strb->texture->last_level' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50621">Bug 50621</a> - Mesa fails its test suite with a buffer overflow.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50298">Bug 50298</a> - [ILK IVB bisected]Ogles2conform GL/sin/sin_float_vert_xvary.test regressed</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51574">Bug 51574</a> - ir_loop_jump constructor assigns member variable to itself</li>
|
||||
|
||||
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </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-8.0.3..mesa-8.0.4
|
||||
</pre>
|
||||
|
||||
<p>Andreas Betz (1):
|
||||
<ul>
|
||||
<li>vega: fix 565 color unpacking bug</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Antoine Labour (2):
|
||||
<ul>
|
||||
<li>meta: Cleanup the resources we allocate.</li>
|
||||
<li>mesa: Free uniforms correclty.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Brian Paul (22):
|
||||
<ul>
|
||||
<li>docs: add link to 8.0.3 release notes</li>
|
||||
<li>mesa: fix Z32_FLOAT -> uint conversion functions</li>
|
||||
<li>draw: fix primitive restart bug by using the index buffer offset</li>
|
||||
<li>st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color output</li>
|
||||
<li>svga: fix synchronization bug between sampler views and surfaces</li>
|
||||
<li>mesa: new _mesa_error_check_format_and_type() function</li>
|
||||
<li>mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case</li>
|
||||
<li>mesa: fix missing return value in getteximage_error_check()</li>
|
||||
<li>st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers</li>
|
||||
<li>svga: add 0.5 in float->int conversion of sample min/max lod</li>
|
||||
<li>svga: fix min/max lod clamping</li>
|
||||
<li>svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0</li>
|
||||
<li>st/mesa: add fallback pipe formats for (compressed) R, RG formats</li>
|
||||
<li>st/mesa: copy num_immediates field when copying the immediates array</li>
|
||||
<li>svga: move svga_texture() casts/calls in svga_surface_copy()</li>
|
||||
<li>svga: reset vertex buffer offset in svga_release_user_upl_buffers()</li>
|
||||
<li>st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers</li>
|
||||
<li>st/mesa: use private pipe_sampler_view in decompress_with_blit()</li>
|
||||
<li>st/mesa: add null pointer check in st_texture_image_map()</li>
|
||||
<li>st/mesa: fix mipmap image size computation w.r.t. texture arrays</li>
|
||||
<li>draw: fix missing immediates bug in polygon stipple code</li>
|
||||
<li>st/mesa: fix max_offset computation for base vertex</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Christoph Bumiller (1):
|
||||
<ul>
|
||||
<li>nv50: handle NEG,ABS modifiers for short RCP encoding</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Dylan Noblesmith (1):
|
||||
<ul>
|
||||
<li>mesa: require GL_MAX_SAMPLES >= 4 for GL 3.0</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Eric Anholt (1):
|
||||
<ul>
|
||||
<li>i965/vs: Fix texelFetchOffset()</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Ian Romanick (5):
|
||||
<ul>
|
||||
<li>docs: Add 8.0.3 release md5sums</li>
|
||||
<li>glx/tests: Fix off-by-one error in allocating extension string buffer</li>
|
||||
<li>glsl: Remove spurious printf messages</li>
|
||||
<li>glsl: Fix pi/2 constant in acos built-in function</li>
|
||||
<li>mesa: Bump version number to 8.0.4</li>
|
||||
</ul></p>
|
||||
|
||||
<p>José Fonseca (2):
|
||||
<ul>
|
||||
<li>mesa: Avoid void acinclude.m4 Android.common.mk Android.mk autogen.sh bin common.py configs configure.ac docs doxygen include Makefile scons SConstruct src tests arithmetic.</li>
|
||||
<li>draw: Ensure that prepare is always run after LLVM garbagge collection.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Kenneth Graunke (15):
|
||||
<ul>
|
||||
<li>mesa: Check for a negative "size" parameter in glCopyBufferSubData().</li>
|
||||
<li>i965: Fix brw_swap_cmod() for LE/GE comparisons.</li>
|
||||
<li>glsl: Remove unused ir_loop_jump::loop pointer.</li>
|
||||
<li>ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.</li>
|
||||
<li>mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).</li>
|
||||
<li>glsl/builtins: Fix textureGrad() for Array samplers.</li>
|
||||
<li>mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.</li>
|
||||
<li>mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.</li>
|
||||
<li>mesa: Unbind ARB_transform_feedback2 binding points on Delete too.</li>
|
||||
<li>meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().</li>
|
||||
<li>i965/fs: Fix texelFetchOffset() on pre-Gen7.</li>
|
||||
<li>i965/vs: Fix texelFetchOffset() on pre-Gen7.</li>
|
||||
<li>i965/fs: Fix user-defined FS outputs with less than four components.</li>
|
||||
<li>glsl: Hook up loop_variable_state destructor to plug a memory leak.</li>
|
||||
<li>glsl: Don't trust loop analysis in the presence of function calls.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Kurt Roeckx (1):
|
||||
<ul>
|
||||
<li>i830: Fix crash for GL_STENCIL_TEST in i830Enable()</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Lukas Rössler (1):
|
||||
<ul>
|
||||
<li>glu: fix two Clang warnings</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Marek Olšák (2):
|
||||
<ul>
|
||||
<li>mesa: allow exposing GL3 without EXT_texture_integer</li>
|
||||
<li>st/mesa: don't do srgb->linear conversion in decompress_with_blit</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Paul Seidler (1):
|
||||
<ul>
|
||||
<li>tests: include mesa headers</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Stéphane Marchesin (3):
|
||||
<ul>
|
||||
<li>glx: Handle a null reply in QueryVersion.</li>
|
||||
<li>i915g: Don't invert signalled/unsignalled fences</li>
|
||||
<li>i915g: Don't avoid flushing when we have a pending fence.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Thomas Gstädtner (1):
|
||||
<ul>
|
||||
<li>gallium/targets: pass ldflags parameter to MKLIB</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Vadim Girlin (2):
|
||||
<ul>
|
||||
<li>st/mesa: set stObj->lastLevel in guess_and_alloc_texture</li>
|
||||
<li>r600g: check gpr count limit</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Vinson Lee (1):
|
||||
<ul>
|
||||
<li>st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.</li>
|
||||
</ul></p>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -13,6 +13,10 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
</p>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="relnotes-8.0.4.html">8.0.4 release notes</A>
|
||||
<LI><A HREF="relnotes-8.0.3.html">8.0.3 release notes</A>
|
||||
<LI><A HREF="relnotes-8.0.2.html">8.0.2 release notes</A>
|
||||
<LI><A HREF="relnotes-8.0.1.html">8.0.1 release notes</A>
|
||||
<LI><A HREF="relnotes-8.0.html">8.0 release notes</A>
|
||||
<LI><A HREF="relnotes-7.11.html">7.11 release notes</A>
|
||||
<LI><A HREF="relnotes-7.10.3.html">7.10.3 release notes</A>
|
||||
|
@@ -25,3 +25,4 @@ CHIPSET(0x0162, IVYBRIDGE_GT2, ivb_gt2)
|
||||
CHIPSET(0x0156, IVYBRIDGE_M_GT1, ivb_gt1)
|
||||
CHIPSET(0x0166, IVYBRIDGE_M_GT2, ivb_gt2)
|
||||
CHIPSET(0x015a, IVYBRIDGE_S_GT1, ivb_gt1)
|
||||
CHIPSET(0x016a, IVYBRIDGE_S_GT2, ivb_gt2)
|
||||
|
@@ -45,7 +45,7 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
|
||||
(void) dpy;
|
||||
|
||||
memset(attrs, 0, sizeof(attrs));
|
||||
memset(attrs, 0, sizeof(*attrs));
|
||||
attrs->ImagePreserved = EGL_FALSE;
|
||||
attrs->GLTextureLevel = 0;
|
||||
attrs->GLTextureZOffset = 0;
|
||||
|
@@ -80,6 +80,21 @@ void draw_set_viewport_state( struct draw_context *draw,
|
||||
void draw_set_clip_state( struct draw_context *pipe,
|
||||
const struct pipe_clip_state *clip );
|
||||
|
||||
/**
|
||||
* Sets the rasterization state used by the draw module.
|
||||
* The rast_handle is used to pass the driver specific representation
|
||||
* of the rasterization state. It's going to be used when the
|
||||
* draw module sets the state back on the driver itself using the
|
||||
* pipe::bind_rasterizer_state method.
|
||||
*
|
||||
* NOTE: if you're calling this function from within the pipe's
|
||||
* bind_rasterizer_state you should always call it before binding
|
||||
* the actual state - that's because the draw module can try to
|
||||
* bind its own rasterizer state which would reset your newly
|
||||
* set state. i.e. always do
|
||||
* draw_set_rasterizer_state(driver->draw, state->pipe_state, state);
|
||||
* driver->state.raster = state;
|
||||
*/
|
||||
void draw_set_rasterizer_state( struct draw_context *draw,
|
||||
const struct pipe_rasterizer_state *raster,
|
||||
void *rast_handle );
|
||||
|
@@ -65,8 +65,13 @@ static void
|
||||
draw_llvm_garbage_collect_callback(void *cb_data)
|
||||
{
|
||||
struct draw_llvm *llvm = (struct draw_llvm *) cb_data;
|
||||
struct draw_context *draw = llvm->draw;
|
||||
struct draw_llvm_variant_list_item *li;
|
||||
|
||||
/* Ensure prepare will be run and shaders recompiled */
|
||||
assert(!draw->suspend_flushing);
|
||||
draw_do_flush(draw, DRAW_FLUSH_STATE_CHANGE);
|
||||
|
||||
/* free all shader variants */
|
||||
li = first_elem(&llvm->vs_variants_list);
|
||||
while (!at_end(&llvm->vs_variants_list, li)) {
|
||||
|
@@ -165,11 +165,16 @@ pstip_transform_decl(struct tgsi_transform_context *ctx,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TGSI immediate declaration transform callback.
|
||||
* We're just counting the number of immediates here.
|
||||
*/
|
||||
static void
|
||||
pstip_transform_immed(struct tgsi_transform_context *ctx,
|
||||
struct tgsi_full_immediate *immed)
|
||||
{
|
||||
struct pstip_transform_context *pctx = (struct pstip_transform_context *) ctx;
|
||||
ctx->emit_immediate(ctx, immed); /* emit to output shader */
|
||||
pctx->numImmed++;
|
||||
}
|
||||
|
||||
|
@@ -329,25 +329,28 @@ draw_pt_arrays_restart(struct draw_context *draw,
|
||||
|
||||
if (draw->pt.user.elts) {
|
||||
/* indexed prims (draw_elements) */
|
||||
const char *elts =
|
||||
(const char *) draw->pt.user.elts + draw->pt.index_buffer.offset;
|
||||
|
||||
cur_start = start;
|
||||
cur_count = 0;
|
||||
|
||||
switch (draw->pt.user.eltSize) {
|
||||
case 1:
|
||||
{
|
||||
const ubyte *elt_ub = (const ubyte *) draw->pt.user.elts;
|
||||
const ubyte *elt_ub = (const ubyte *) elts;
|
||||
PRIM_RESTART_LOOP(elt_ub);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
const ushort *elt_us = (const ushort *) draw->pt.user.elts;
|
||||
const ushort *elt_us = (const ushort *) elts;
|
||||
PRIM_RESTART_LOOP(elt_us);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
const uint *elt_ui = (const uint *) draw->pt.user.elts;
|
||||
const uint *elt_ui = (const uint *) elts;
|
||||
PRIM_RESTART_LOOP(elt_ui);
|
||||
}
|
||||
break;
|
||||
|
@@ -25,43 +25,43 @@
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include "util/u_debug.h"
|
||||
#include "pipe/p_config.h"
|
||||
#include "rtasm_cpu.h"
|
||||
|
||||
|
||||
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
|
||||
static boolean rtasm_sse_enabled(void)
|
||||
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_cpu_detect.h"
|
||||
|
||||
DEBUG_GET_ONCE_BOOL_OPTION(nosse, "GALLIUM_NOSSE", FALSE);
|
||||
|
||||
static struct util_cpu_caps *get_cpu_caps(void)
|
||||
{
|
||||
static boolean firsttime = 1;
|
||||
static boolean enabled;
|
||||
|
||||
/* This gets called quite often at the moment:
|
||||
*/
|
||||
if (firsttime) {
|
||||
enabled = !debug_get_bool_option("GALLIUM_NOSSE", FALSE);
|
||||
firsttime = FALSE;
|
||||
}
|
||||
return enabled;
|
||||
util_cpu_detect();
|
||||
return &util_cpu_caps;
|
||||
}
|
||||
#endif
|
||||
|
||||
int rtasm_cpu_has_sse(void)
|
||||
{
|
||||
/* FIXME: actually detect this at run-time */
|
||||
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
|
||||
return rtasm_sse_enabled();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
return !debug_get_option_nosse() && get_cpu_caps()->has_sse;
|
||||
}
|
||||
|
||||
int rtasm_cpu_has_sse2(void)
|
||||
{
|
||||
/* FIXME: actually detect this at run-time */
|
||||
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
|
||||
return rtasm_sse_enabled();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
return !debug_get_option_nosse() && get_cpu_caps()->has_sse2;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
int rtasm_cpu_has_sse(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rtasm_cpu_has_sse2(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -38,6 +38,7 @@
|
||||
|
||||
#include "os/os_memory.h"
|
||||
#include "os/os_memory_debug.h"
|
||||
#include "os/os_thread.h"
|
||||
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_debug_stack.h"
|
||||
@@ -72,6 +73,8 @@ struct debug_memory_footer
|
||||
|
||||
static struct list_head list = { &list, &list };
|
||||
|
||||
pipe_static_mutex(list_mutex);
|
||||
|
||||
static unsigned long last_no = 0;
|
||||
|
||||
|
||||
@@ -132,7 +135,9 @@ debug_malloc(const char *file, unsigned line, const char *function,
|
||||
ftr = footer_from_header(hdr);
|
||||
ftr->magic = DEBUG_MEMORY_MAGIC;
|
||||
|
||||
pipe_mutex_lock(list_mutex);
|
||||
LIST_ADDTAIL(&hdr->head, &list);
|
||||
pipe_mutex_unlock(list_mutex);
|
||||
|
||||
return data_from_header(hdr);
|
||||
}
|
||||
@@ -164,7 +169,9 @@ debug_free(const char *file, unsigned line, const char *function,
|
||||
debug_assert(0);
|
||||
}
|
||||
|
||||
pipe_mutex_lock(list_mutex);
|
||||
LIST_DEL(&hdr->head);
|
||||
pipe_mutex_unlock(list_mutex);
|
||||
hdr->magic = 0;
|
||||
ftr->magic = 0;
|
||||
|
||||
@@ -232,7 +239,9 @@ debug_realloc(const char *file, unsigned line, const char *function,
|
||||
new_ftr = footer_from_header(new_hdr);
|
||||
new_ftr->magic = DEBUG_MEMORY_MAGIC;
|
||||
|
||||
pipe_mutex_lock(list_mutex);
|
||||
LIST_REPLACE(&old_hdr->head, &new_hdr->head);
|
||||
pipe_mutex_unlock(list_mutex);
|
||||
|
||||
/* copy data */
|
||||
new_ptr = data_from_header(new_hdr);
|
||||
|
@@ -105,6 +105,11 @@ static INLINE void list_delinit(struct list_head *item)
|
||||
#define LIST_IS_EMPTY(__list) \
|
||||
((__list)->next == (__list))
|
||||
|
||||
/**
|
||||
* Cast from a pointer to a member of a struct back to the containing struct.
|
||||
*
|
||||
* 'sample' MUST be initialized, or else the result is undefined!
|
||||
*/
|
||||
#ifndef container_of
|
||||
#define container_of(ptr, sample, member) \
|
||||
(void *)((char *)(ptr) \
|
||||
@@ -112,29 +117,29 @@ static INLINE void list_delinit(struct list_head *item)
|
||||
#endif
|
||||
|
||||
#define LIST_FOR_EACH_ENTRY(pos, head, member) \
|
||||
for (pos = container_of((head)->next, pos, member); \
|
||||
for (pos = NULL, pos = container_of((head)->next, pos, member); \
|
||||
&pos->member != (head); \
|
||||
pos = container_of(pos->member.next, pos, member))
|
||||
|
||||
#define LIST_FOR_EACH_ENTRY_SAFE(pos, storage, head, member) \
|
||||
for (pos = container_of((head)->next, pos, member), \
|
||||
for (pos = NULL, pos = container_of((head)->next, pos, member), \
|
||||
storage = container_of(pos->member.next, pos, member); \
|
||||
&pos->member != (head); \
|
||||
pos = storage, storage = container_of(storage->member.next, storage, member))
|
||||
|
||||
#define LIST_FOR_EACH_ENTRY_SAFE_REV(pos, storage, head, member) \
|
||||
for (pos = container_of((head)->prev, pos, member), \
|
||||
for (pos = NULL, pos = container_of((head)->prev, pos, member), \
|
||||
storage = container_of(pos->member.prev, pos, member); \
|
||||
&pos->member != (head); \
|
||||
pos = storage, storage = container_of(storage->member.prev, storage, member))
|
||||
|
||||
#define LIST_FOR_EACH_ENTRY_FROM(pos, start, head, member) \
|
||||
for (pos = container_of((start), pos, member); \
|
||||
for (pos = NULL, pos = container_of((start), pos, member); \
|
||||
&pos->member != (head); \
|
||||
pos = container_of(pos->member.next, pos, member))
|
||||
|
||||
#define LIST_FOR_EACH_ENTRY_FROM_REV(pos, start, head, member) \
|
||||
for (pos = container_of((start), pos, member); \
|
||||
for (pos = NULL, pos = container_of((start), pos, member); \
|
||||
&pos->member != (head); \
|
||||
pos = container_of(pos->member.prev, pos, member))
|
||||
|
||||
|
@@ -49,15 +49,16 @@ unsigned util_semantic_set_from_program_file(struct util_semantic_set *set, cons
|
||||
*
|
||||
* num_slots is the size of the layout array and hardware limit instead.
|
||||
*
|
||||
* efficient_slots == 0 or efficient_solts == num_slots are typical settings.
|
||||
* efficient_slots == 0 or efficient_slots == num_slots are typical settings.
|
||||
*/
|
||||
void util_semantic_layout_from_set(unsigned char *layout, const struct util_semantic_set *set, unsigned efficient_slots, unsigned num_slots);
|
||||
|
||||
static INLINE void
|
||||
util_semantic_table_from_layout(unsigned char *table, unsigned char *layout, unsigned char first_slot_value, unsigned char num_slots)
|
||||
util_semantic_table_from_layout(unsigned char *table, size_t table_size, unsigned char *layout,
|
||||
unsigned char first_slot_value, unsigned char num_slots)
|
||||
{
|
||||
int i;
|
||||
memset(table, 0xff, sizeof(table));
|
||||
unsigned char i;
|
||||
memset(table, 0xff, table_size);
|
||||
|
||||
for(i = 0; i < num_slots; ++i)
|
||||
table[layout[i]] = first_slot_value + i;
|
||||
|
@@ -45,7 +45,10 @@ static void i915_flush_pipe( struct pipe_context *pipe,
|
||||
|
||||
draw_flush(i915->draw);
|
||||
|
||||
if (i915->batch->map == i915->batch->ptr) {
|
||||
/* Only shortcut this if we have no fence, otherwise we must flush the
|
||||
* empty batchbuffer to get our fence back.
|
||||
*/
|
||||
if (!fence && i915->batch && (i915->batch->map == i915->batch->ptr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -368,7 +368,7 @@ i915_fence_signalled(struct pipe_screen *screen,
|
||||
{
|
||||
struct i915_screen *is = i915_screen(screen);
|
||||
|
||||
return is->iws->fence_signalled(is->iws, fence) == 0;
|
||||
return is->iws->fence_signalled(is->iws, fence) == 1;
|
||||
}
|
||||
|
||||
static boolean
|
||||
@@ -378,7 +378,7 @@ i915_fence_finish(struct pipe_screen *screen,
|
||||
{
|
||||
struct i915_screen *is = i915_screen(screen);
|
||||
|
||||
return is->iws->fence_finish(is->iws, fence) == 0;
|
||||
return is->iws->fence_finish(is->iws, fence) == 1;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -792,7 +792,7 @@ lp_rast_finish( struct lp_rasterizer *rast )
|
||||
* 2. do work
|
||||
* 3. signal that we're done
|
||||
*/
|
||||
static PIPE_THREAD_ROUTINE( thread_func, init_data )
|
||||
static PIPE_THREAD_ROUTINE( thread_function, init_data )
|
||||
{
|
||||
struct lp_rasterizer_task *task = (struct lp_rasterizer_task *) init_data;
|
||||
struct lp_rasterizer *rast = task->rast;
|
||||
@@ -860,7 +860,7 @@ create_rast_threads(struct lp_rasterizer *rast)
|
||||
for (i = 0; i < rast->num_threads; i++) {
|
||||
pipe_semaphore_init(&rast->tasks[i].work_ready, 0);
|
||||
pipe_semaphore_init(&rast->tasks[i].work_done, 0);
|
||||
rast->threads[i] = pipe_thread_create(thread_func,
|
||||
rast->threads[i] = pipe_thread_create(thread_function,
|
||||
(void *) &rast->tasks[i]);
|
||||
}
|
||||
}
|
||||
|
@@ -865,8 +865,10 @@ emit_flop(struct nv_pc *pc, struct nv_instruction *i)
|
||||
assert(SFILE(i, 0) == NV_FILE_GPR);
|
||||
|
||||
if (!i->is_long) {
|
||||
assert(i->opcode == NV_OP_RCP);
|
||||
emit_form_MUL(pc, i);
|
||||
assert(i->opcode == NV_OP_RCP && !src0->mod);
|
||||
if (src0->mod & NV_MOD_NEG) pc->emit[0] |= 0x00400000;
|
||||
if (src0->mod & NV_MOD_ABS) pc->emit[0] |= 0x00008000;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -977,7 +977,8 @@ nvfx_fragprog_prepare(struct nvfx_context* nvfx, struct nvfx_fpc *fpc)
|
||||
if(fpc->fp->num_slots > num_texcoords)
|
||||
return FALSE;
|
||||
util_semantic_layout_from_set(fpc->fp->slot_to_generic, &set, 0, num_texcoords);
|
||||
util_semantic_table_from_layout(fpc->generic_to_slot, fpc->fp->slot_to_generic, 0, num_texcoords);
|
||||
util_semantic_table_from_layout(fpc->generic_to_slot, sizeof fpc->generic_to_slot,
|
||||
fpc->fp->slot_to_generic, 0, num_texcoords);
|
||||
|
||||
memset(fpc->fp->slot_to_fp_input, 0xff, sizeof(fpc->fp->slot_to_fp_input));
|
||||
|
||||
|
@@ -41,13 +41,16 @@
|
||||
|
||||
static struct rc_instruction *emit1(
|
||||
struct radeon_compiler * c, struct rc_instruction * after,
|
||||
rc_opcode Opcode, rc_saturate_mode Saturate, struct rc_dst_register DstReg,
|
||||
struct rc_src_register SrcReg)
|
||||
rc_opcode Opcode, struct rc_sub_instruction * base,
|
||||
struct rc_dst_register DstReg, struct rc_src_register SrcReg)
|
||||
{
|
||||
struct rc_instruction *fpi = rc_insert_new_instruction(c, after);
|
||||
|
||||
if (base) {
|
||||
memcpy(&fpi->U.I, base, sizeof(struct rc_sub_instruction));
|
||||
}
|
||||
|
||||
fpi->U.I.Opcode = Opcode;
|
||||
fpi->U.I.SaturateMode = Saturate;
|
||||
fpi->U.I.DstReg = DstReg;
|
||||
fpi->U.I.SrcReg[0] = SrcReg;
|
||||
return fpi;
|
||||
@@ -55,13 +58,17 @@ static struct rc_instruction *emit1(
|
||||
|
||||
static struct rc_instruction *emit2(
|
||||
struct radeon_compiler * c, struct rc_instruction * after,
|
||||
rc_opcode Opcode, rc_saturate_mode Saturate, struct rc_dst_register DstReg,
|
||||
rc_opcode Opcode, struct rc_sub_instruction * base,
|
||||
struct rc_dst_register DstReg,
|
||||
struct rc_src_register SrcReg0, struct rc_src_register SrcReg1)
|
||||
{
|
||||
struct rc_instruction *fpi = rc_insert_new_instruction(c, after);
|
||||
|
||||
if (base) {
|
||||
memcpy(&fpi->U.I, base, sizeof(struct rc_sub_instruction));
|
||||
}
|
||||
|
||||
fpi->U.I.Opcode = Opcode;
|
||||
fpi->U.I.SaturateMode = Saturate;
|
||||
fpi->U.I.DstReg = DstReg;
|
||||
fpi->U.I.SrcReg[0] = SrcReg0;
|
||||
fpi->U.I.SrcReg[1] = SrcReg1;
|
||||
@@ -70,14 +77,18 @@ static struct rc_instruction *emit2(
|
||||
|
||||
static struct rc_instruction *emit3(
|
||||
struct radeon_compiler * c, struct rc_instruction * after,
|
||||
rc_opcode Opcode, rc_saturate_mode Saturate, struct rc_dst_register DstReg,
|
||||
rc_opcode Opcode, struct rc_sub_instruction * base,
|
||||
struct rc_dst_register DstReg,
|
||||
struct rc_src_register SrcReg0, struct rc_src_register SrcReg1,
|
||||
struct rc_src_register SrcReg2)
|
||||
{
|
||||
struct rc_instruction *fpi = rc_insert_new_instruction(c, after);
|
||||
|
||||
if (base) {
|
||||
memcpy(&fpi->U.I, base, sizeof(struct rc_sub_instruction));
|
||||
}
|
||||
|
||||
fpi->U.I.Opcode = Opcode;
|
||||
fpi->U.I.SaturateMode = Saturate;
|
||||
fpi->U.I.DstReg = DstReg;
|
||||
fpi->U.I.SrcReg[0] = SrcReg0;
|
||||
fpi->U.I.SrcReg[1] = SrcReg1;
|
||||
@@ -221,7 +232,7 @@ static void transform_ABS(struct radeon_compiler* c,
|
||||
struct rc_src_register src = inst->U.I.SrcReg[0];
|
||||
src.Abs = 1;
|
||||
src.Negate = RC_MASK_NONE;
|
||||
emit1(c, inst->Prev, RC_OPCODE_MOV, inst->U.I.SaturateMode, inst->U.I.DstReg, src);
|
||||
emit1(c, inst->Prev, RC_OPCODE_MOV, &inst->U.I, inst->U.I.DstReg, src);
|
||||
rc_remove_instruction(inst);
|
||||
}
|
||||
|
||||
@@ -240,7 +251,7 @@ static void transform_CEIL(struct radeon_compiler* c,
|
||||
|
||||
struct rc_dst_register dst = try_to_reuse_dst(c, inst);
|
||||
emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dst, negate(inst->U.I.SrcReg[0]));
|
||||
emit2(c, inst->Prev, RC_OPCODE_ADD, inst->U.I.SaturateMode, inst->U.I.DstReg,
|
||||
emit2(c, inst->Prev, RC_OPCODE_ADD, &inst->U.I, inst->U.I.DstReg,
|
||||
inst->U.I.SrcReg[0], srcreg(RC_FILE_TEMPORARY, dst.Index));
|
||||
rc_remove_instruction(inst);
|
||||
}
|
||||
@@ -256,7 +267,7 @@ static void transform_CLAMP(struct radeon_compiler *c,
|
||||
struct rc_dst_register dst = try_to_reuse_dst(c, inst);
|
||||
emit2(c, inst->Prev, RC_OPCODE_MIN, 0, dst,
|
||||
inst->U.I.SrcReg[0], inst->U.I.SrcReg[2]);
|
||||
emit2(c, inst->Prev, RC_OPCODE_MAX, inst->U.I.SaturateMode, inst->U.I.DstReg,
|
||||
emit2(c, inst->Prev, RC_OPCODE_MAX, &inst->U.I, inst->U.I.DstReg,
|
||||
srcreg(RC_FILE_TEMPORARY, dst.Index), inst->U.I.SrcReg[1]);
|
||||
rc_remove_instruction(inst);
|
||||
}
|
||||
@@ -272,7 +283,7 @@ static void transform_DP2(struct radeon_compiler* c,
|
||||
src1.Negate &= ~(RC_MASK_Z | RC_MASK_W);
|
||||
src1.Swizzle &= ~(63 << (3 * 2));
|
||||
src1.Swizzle |= (RC_SWIZZLE_ZERO << (3 * 2)) | (RC_SWIZZLE_ZERO << (3 * 3));
|
||||
emit2(c, inst->Prev, RC_OPCODE_DP3, inst->U.I.SaturateMode, inst->U.I.DstReg, src0, src1);
|
||||
emit2(c, inst->Prev, RC_OPCODE_DP3, &inst->U.I, inst->U.I.DstReg, src0, src1);
|
||||
rc_remove_instruction(inst);
|
||||
}
|
||||
|
||||
@@ -283,7 +294,7 @@ static void transform_DPH(struct radeon_compiler* c,
|
||||
src0.Negate &= ~RC_MASK_W;
|
||||
src0.Swizzle &= ~(7 << (3 * 3));
|
||||
src0.Swizzle |= RC_SWIZZLE_ONE << (3 * 3);
|
||||
emit2(c, inst->Prev, RC_OPCODE_DP4, inst->U.I.SaturateMode, inst->U.I.DstReg, src0, inst->U.I.SrcReg[1]);
|
||||
emit2(c, inst->Prev, RC_OPCODE_DP4, &inst->U.I, inst->U.I.DstReg, src0, inst->U.I.SrcReg[1]);
|
||||
rc_remove_instruction(inst);
|
||||
}
|
||||
|
||||
@@ -294,7 +305,7 @@ static void transform_DPH(struct radeon_compiler* c,
|
||||
static void transform_DST(struct radeon_compiler* c,
|
||||
struct rc_instruction* inst)
|
||||
{
|
||||
emit2(c, inst->Prev, RC_OPCODE_MUL, inst->U.I.SaturateMode, inst->U.I.DstReg,
|
||||
emit2(c, inst->Prev, RC_OPCODE_MUL, &inst->U.I, inst->U.I.DstReg,
|
||||
swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_ONE, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ONE),
|
||||
swizzle(inst->U.I.SrcReg[1], RC_SWIZZLE_ONE, RC_SWIZZLE_Y, RC_SWIZZLE_ONE, RC_SWIZZLE_W));
|
||||
rc_remove_instruction(inst);
|
||||
@@ -305,7 +316,7 @@ static void transform_FLR(struct radeon_compiler* c,
|
||||
{
|
||||
struct rc_dst_register dst = try_to_reuse_dst(c, inst);
|
||||
emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dst, inst->U.I.SrcReg[0]);
|
||||
emit2(c, inst->Prev, RC_OPCODE_ADD, inst->U.I.SaturateMode, inst->U.I.DstReg,
|
||||
emit2(c, inst->Prev, RC_OPCODE_ADD, &inst->U.I, inst->U.I.DstReg,
|
||||
inst->U.I.SrcReg[0], negate(srcreg(RC_FILE_TEMPORARY, dst.Index)));
|
||||
rc_remove_instruction(inst);
|
||||
}
|
||||
@@ -379,14 +390,14 @@ static void transform_LIT(struct radeon_compiler* c,
|
||||
swizzle_wwww(srctemp));
|
||||
|
||||
/* tmp.z = (tmp.x > 0) ? tmp.w : 0.0 */
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode,
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, &inst->U.I,
|
||||
dstregtmpmask(temp, RC_MASK_Z),
|
||||
negate(swizzle_xxxx(srctemp)),
|
||||
swizzle_wwww(srctemp),
|
||||
builtin_zero);
|
||||
|
||||
/* tmp.x, tmp.y, tmp.w = 1.0, tmp.x, 1.0 */
|
||||
emit1(c, inst->Prev, RC_OPCODE_MOV, inst->U.I.SaturateMode,
|
||||
emit1(c, inst->Prev, RC_OPCODE_MOV, &inst->U.I,
|
||||
dstregtmpmask(temp, RC_MASK_XYW),
|
||||
swizzle(srctemp, RC_SWIZZLE_ONE, RC_SWIZZLE_X, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE));
|
||||
|
||||
@@ -401,7 +412,7 @@ static void transform_LRP(struct radeon_compiler* c,
|
||||
emit2(c, inst->Prev, RC_OPCODE_ADD, 0,
|
||||
dst,
|
||||
inst->U.I.SrcReg[1], negate(inst->U.I.SrcReg[2]));
|
||||
emit3(c, inst->Prev, RC_OPCODE_MAD, inst->U.I.SaturateMode,
|
||||
emit3(c, inst->Prev, RC_OPCODE_MAD, &inst->U.I,
|
||||
inst->U.I.DstReg,
|
||||
inst->U.I.SrcReg[0], srcreg(RC_FILE_TEMPORARY, dst.Index), inst->U.I.SrcReg[2]);
|
||||
|
||||
@@ -418,7 +429,7 @@ static void transform_POW(struct radeon_compiler* c,
|
||||
|
||||
emit1(c, inst->Prev, RC_OPCODE_LG2, 0, tempdst, swizzle_xxxx(inst->U.I.SrcReg[0]));
|
||||
emit2(c, inst->Prev, RC_OPCODE_MUL, 0, tempdst, tempsrc, swizzle_xxxx(inst->U.I.SrcReg[1]));
|
||||
emit1(c, inst->Prev, RC_OPCODE_EX2, inst->U.I.SaturateMode, inst->U.I.DstReg, tempsrc);
|
||||
emit1(c, inst->Prev, RC_OPCODE_EX2, &inst->U.I, inst->U.I.DstReg, tempsrc);
|
||||
|
||||
rc_remove_instruction(inst);
|
||||
}
|
||||
@@ -472,7 +483,7 @@ static void transform_SEQ(struct radeon_compiler* c,
|
||||
struct rc_dst_register dst = try_to_reuse_dst(c, inst);
|
||||
|
||||
emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dst, inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1]));
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg,
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, &inst->U.I, inst->U.I.DstReg,
|
||||
negate(absolute(srcreg(RC_FILE_TEMPORARY, dst.Index))), builtin_zero, builtin_one);
|
||||
|
||||
rc_remove_instruction(inst);
|
||||
@@ -481,7 +492,7 @@ static void transform_SEQ(struct radeon_compiler* c,
|
||||
static void transform_SFL(struct radeon_compiler* c,
|
||||
struct rc_instruction* inst)
|
||||
{
|
||||
emit1(c, inst->Prev, RC_OPCODE_MOV, inst->U.I.SaturateMode, inst->U.I.DstReg, builtin_zero);
|
||||
emit1(c, inst->Prev, RC_OPCODE_MOV, &inst->U.I, inst->U.I.DstReg, builtin_zero);
|
||||
rc_remove_instruction(inst);
|
||||
}
|
||||
|
||||
@@ -491,7 +502,7 @@ static void transform_SGE(struct radeon_compiler* c,
|
||||
struct rc_dst_register dst = try_to_reuse_dst(c, inst);
|
||||
|
||||
emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dst, inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1]));
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg,
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, &inst->U.I, inst->U.I.DstReg,
|
||||
srcreg(RC_FILE_TEMPORARY, dst.Index), builtin_zero, builtin_one);
|
||||
|
||||
rc_remove_instruction(inst);
|
||||
@@ -503,7 +514,7 @@ static void transform_SGT(struct radeon_compiler* c,
|
||||
struct rc_dst_register dst = try_to_reuse_dst(c, inst);
|
||||
|
||||
emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dst, negate(inst->U.I.SrcReg[0]), inst->U.I.SrcReg[1]);
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg,
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, &inst->U.I, inst->U.I.DstReg,
|
||||
srcreg(RC_FILE_TEMPORARY, dst.Index), builtin_one, builtin_zero);
|
||||
|
||||
rc_remove_instruction(inst);
|
||||
@@ -515,7 +526,7 @@ static void transform_SLE(struct radeon_compiler* c,
|
||||
struct rc_dst_register dst = try_to_reuse_dst(c, inst);
|
||||
|
||||
emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dst, negate(inst->U.I.SrcReg[0]), inst->U.I.SrcReg[1]);
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg,
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, &inst->U.I, inst->U.I.DstReg,
|
||||
srcreg(RC_FILE_TEMPORARY, dst.Index), builtin_zero, builtin_one);
|
||||
|
||||
rc_remove_instruction(inst);
|
||||
@@ -527,7 +538,7 @@ static void transform_SLT(struct radeon_compiler* c,
|
||||
struct rc_dst_register dst = try_to_reuse_dst(c, inst);
|
||||
|
||||
emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dst, inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1]));
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg,
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, &inst->U.I, inst->U.I.DstReg,
|
||||
srcreg(RC_FILE_TEMPORARY, dst.Index), builtin_one, builtin_zero);
|
||||
|
||||
rc_remove_instruction(inst);
|
||||
@@ -539,7 +550,7 @@ static void transform_SNE(struct radeon_compiler* c,
|
||||
struct rc_dst_register dst = try_to_reuse_dst(c, inst);
|
||||
|
||||
emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dst, inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1]));
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg,
|
||||
emit3(c, inst->Prev, RC_OPCODE_CMP, &inst->U.I, inst->U.I.DstReg,
|
||||
negate(absolute(srcreg(RC_FILE_TEMPORARY, dst.Index))), builtin_one, builtin_zero);
|
||||
|
||||
rc_remove_instruction(inst);
|
||||
@@ -604,7 +615,7 @@ static void transform_XPD(struct radeon_compiler* c,
|
||||
emit2(c, inst->Prev, RC_OPCODE_MUL, 0, dst,
|
||||
swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_W),
|
||||
swizzle(inst->U.I.SrcReg[1], RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_W));
|
||||
emit3(c, inst->Prev, RC_OPCODE_MAD, inst->U.I.SaturateMode, inst->U.I.DstReg,
|
||||
emit3(c, inst->Prev, RC_OPCODE_MAD, &inst->U.I, inst->U.I.DstReg,
|
||||
swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_W),
|
||||
swizzle(inst->U.I.SrcReg[1], RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_W),
|
||||
negate(srcreg(RC_FILE_TEMPORARY, dst.Index)));
|
||||
@@ -719,7 +730,7 @@ static void transform_r300_vertex_DP3(struct radeon_compiler* c,
|
||||
src1.Negate &= ~RC_MASK_W;
|
||||
src1.Swizzle &= ~(7 << (3 * 3));
|
||||
src1.Swizzle |= RC_SWIZZLE_ZERO << (3 * 3);
|
||||
emit2(c, inst->Prev, RC_OPCODE_DP4, inst->U.I.SaturateMode, inst->U.I.DstReg, src0, src1);
|
||||
emit2(c, inst->Prev, RC_OPCODE_DP4, &inst->U.I, inst->U.I.DstReg, src0, src1);
|
||||
rc_remove_instruction(inst);
|
||||
}
|
||||
|
||||
@@ -1043,22 +1054,22 @@ static void r300_transform_SIN_COS_SCS(struct radeon_compiler *c,
|
||||
unsigned srctmp)
|
||||
{
|
||||
if (inst->U.I.Opcode == RC_OPCODE_COS) {
|
||||
emit1(c, inst->Prev, RC_OPCODE_COS, inst->U.I.SaturateMode, inst->U.I.DstReg,
|
||||
emit1(c, inst->Prev, RC_OPCODE_COS, &inst->U.I, inst->U.I.DstReg,
|
||||
srcregswz(RC_FILE_TEMPORARY, srctmp, RC_SWIZZLE_WWWW));
|
||||
} else if (inst->U.I.Opcode == RC_OPCODE_SIN) {
|
||||
emit1(c, inst->Prev, RC_OPCODE_SIN, inst->U.I.SaturateMode,
|
||||
emit1(c, inst->Prev, RC_OPCODE_SIN, &inst->U.I,
|
||||
inst->U.I.DstReg, srcregswz(RC_FILE_TEMPORARY, srctmp, RC_SWIZZLE_WWWW));
|
||||
} else if (inst->U.I.Opcode == RC_OPCODE_SCS) {
|
||||
struct rc_dst_register moddst = inst->U.I.DstReg;
|
||||
|
||||
if (inst->U.I.DstReg.WriteMask & RC_MASK_X) {
|
||||
moddst.WriteMask = RC_MASK_X;
|
||||
emit1(c, inst->Prev, RC_OPCODE_COS, inst->U.I.SaturateMode, moddst,
|
||||
emit1(c, inst->Prev, RC_OPCODE_COS, &inst->U.I, moddst,
|
||||
srcregswz(RC_FILE_TEMPORARY, srctmp, RC_SWIZZLE_WWWW));
|
||||
}
|
||||
if (inst->U.I.DstReg.WriteMask & RC_MASK_Y) {
|
||||
moddst.WriteMask = RC_MASK_Y;
|
||||
emit1(c, inst->Prev, RC_OPCODE_SIN, inst->U.I.SaturateMode, moddst,
|
||||
emit1(c, inst->Prev, RC_OPCODE_SIN, &inst->U.I, moddst,
|
||||
srcregswz(RC_FILE_TEMPORARY, srctmp, RC_SWIZZLE_WWWW));
|
||||
}
|
||||
}
|
||||
@@ -1165,35 +1176,79 @@ int radeonTransformDeriv(struct radeon_compiler* c,
|
||||
}
|
||||
|
||||
/**
|
||||
* IF Temp[0].x -> IF Temp[0].x
|
||||
* ... -> ...
|
||||
* KILP -> KIL -abs(Temp[0].x)
|
||||
* ... -> ...
|
||||
* ENDIF -> ENDIF
|
||||
*
|
||||
* === OR ===
|
||||
*
|
||||
* IF Temp[0].x -\
|
||||
* KILP - > KIL -abs(Temp[0].x)
|
||||
* ENDIF -/
|
||||
*
|
||||
* This needs to be done in its own pass, because it modifies the instructions
|
||||
* before and after KILP.
|
||||
* === OR ===
|
||||
*
|
||||
* IF Temp[0].x -> IF Temp[0].x
|
||||
* ... -> ...
|
||||
* ELSE -> ELSE
|
||||
* ... -> ...
|
||||
* KILP -> KIL -abs(Temp[0].x)
|
||||
* ... -> ...
|
||||
* ENDIF -> ENDIF
|
||||
*
|
||||
* === OR ===
|
||||
*
|
||||
* KILP -> KIL -none.1111
|
||||
*
|
||||
* This needs to be done in its own pass, because it might modify the
|
||||
* instructions before and after KILP.
|
||||
*/
|
||||
void rc_transform_KILP(struct radeon_compiler * c, void *user)
|
||||
{
|
||||
struct rc_instruction * inst;
|
||||
for (inst = c->Program.Instructions.Next;
|
||||
inst != &c->Program.Instructions; inst = inst->Next) {
|
||||
struct rc_instruction * if_inst;
|
||||
unsigned in_if = 0;
|
||||
|
||||
if (inst->U.I.Opcode != RC_OPCODE_KILP)
|
||||
continue;
|
||||
|
||||
for (if_inst = inst->Prev; if_inst != &c->Program.Instructions;
|
||||
if_inst = if_inst->Prev) {
|
||||
|
||||
if (if_inst->U.I.Opcode == RC_OPCODE_IF) {
|
||||
in_if = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
inst->U.I.Opcode = RC_OPCODE_KIL;
|
||||
|
||||
if (inst->Prev->U.I.Opcode != RC_OPCODE_IF
|
||||
|| inst->Next->U.I.Opcode != RC_OPCODE_ENDIF) {
|
||||
if (!in_if) {
|
||||
inst->U.I.SrcReg[0] = negate(builtin_one);
|
||||
} else {
|
||||
|
||||
/* This should work even if the KILP is inside the ELSE
|
||||
* block, because -0.0 is considered negative. */
|
||||
inst->U.I.SrcReg[0] =
|
||||
negate(absolute(inst->Prev->U.I.SrcReg[0]));
|
||||
/* Remove IF */
|
||||
rc_remove_instruction(inst->Prev);
|
||||
/* Remove ENDIF */
|
||||
rc_remove_instruction(inst->Next);
|
||||
negate(absolute(if_inst->U.I.SrcReg[0]));
|
||||
|
||||
if (inst->Prev->U.I.Opcode != RC_OPCODE_IF
|
||||
&& inst->Next->U.I.Opcode != RC_OPCODE_ENDIF) {
|
||||
|
||||
/* Optimize the special case:
|
||||
* IF Temp[0].x
|
||||
* KILP
|
||||
* ENDIF
|
||||
*/
|
||||
|
||||
/* Remove IF */
|
||||
rc_remove_instruction(inst->Prev);
|
||||
/* Remove ENDIF */
|
||||
rc_remove_instruction(inst->Next);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -63,8 +63,13 @@ static void r300_blitter_begin(struct r300_context* r300, enum r300_blitter_op o
|
||||
util_blitter_save_vertex_shader(r300->blitter, r300->vs_state.state);
|
||||
util_blitter_save_viewport(r300->blitter, &r300->viewport);
|
||||
util_blitter_save_vertex_elements(r300->blitter, r300->velems);
|
||||
util_blitter_save_vertex_buffers(r300->blitter, r300->vbuf_mgr->nr_vertex_buffers,
|
||||
r300->vbuf_mgr->vertex_buffer);
|
||||
if (r300->vbuf_mgr) {
|
||||
util_blitter_save_vertex_buffers(r300->blitter, r300->vbuf_mgr->nr_vertex_buffers,
|
||||
r300->vbuf_mgr->vertex_buffer);
|
||||
} else {
|
||||
util_blitter_save_vertex_buffers(r300->blitter, r300->swtcl_nr_vertex_buffers,
|
||||
r300->swtcl_vertex_buffer);
|
||||
}
|
||||
|
||||
if (op & R300_SAVE_FRAMEBUFFER) {
|
||||
util_blitter_save_framebuffer(r300->blitter, r300->fb_state.state);
|
||||
|
@@ -419,17 +419,19 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
|
||||
r300_init_query_functions(r300);
|
||||
r300_init_state_functions(r300);
|
||||
r300_init_resource_functions(r300);
|
||||
|
||||
|
||||
r300->context.create_video_decoder = vl_create_decoder;
|
||||
r300->context.create_video_buffer = vl_video_buffer_create;
|
||||
|
||||
r300->vbuf_mgr = u_vbuf_create(&r300->context, 1024 * 1024, 16,
|
||||
if (r300->screen->caps.has_tcl) {
|
||||
r300->vbuf_mgr = u_vbuf_create(&r300->context, 1024 * 1024, 16,
|
||||
PIPE_BIND_VERTEX_BUFFER |
|
||||
PIPE_BIND_INDEX_BUFFER,
|
||||
U_VERTEX_FETCH_DWORD_ALIGNED);
|
||||
if (!r300->vbuf_mgr)
|
||||
goto fail;
|
||||
r300->vbuf_mgr->caps.format_fixed32 = 0;
|
||||
if (!r300->vbuf_mgr)
|
||||
goto fail;
|
||||
r300->vbuf_mgr->caps.format_fixed32 = 0;
|
||||
}
|
||||
|
||||
r300->blitter = util_blitter_create(&r300->context);
|
||||
if (r300->blitter == NULL)
|
||||
|
@@ -581,6 +581,9 @@ struct r300_context {
|
||||
void *dsa_decompress_zmask;
|
||||
|
||||
struct u_vbuf *vbuf_mgr;
|
||||
struct pipe_index_buffer swtcl_index_buffer;
|
||||
struct pipe_vertex_buffer swtcl_vertex_buffer[PIPE_MAX_ATTRIBS];
|
||||
unsigned swtcl_nr_vertex_buffers;
|
||||
|
||||
struct util_slab_mempool pool_transfers;
|
||||
|
||||
|
@@ -1030,20 +1030,18 @@ void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state)
|
||||
R300_PVS_VF_MAX_VTX_NUM(12) |
|
||||
(r300screen->caps.is_r500 ? R500_TCL_STATE_OPTIMIZATION : 0));
|
||||
|
||||
/* Emit flow control instructions. */
|
||||
if (code->num_fc_ops) {
|
||||
|
||||
OUT_CS_REG(R300_VAP_PVS_FLOW_CNTL_OPC, code->fc_ops);
|
||||
if (r300screen->caps.is_r500) {
|
||||
OUT_CS_REG_SEQ(R500_VAP_PVS_FLOW_CNTL_ADDRS_LW_0, code->num_fc_ops * 2);
|
||||
OUT_CS_TABLE(code->fc_op_addrs.r500, code->num_fc_ops * 2);
|
||||
} else {
|
||||
OUT_CS_REG_SEQ(R300_VAP_PVS_FLOW_CNTL_ADDRS_0, code->num_fc_ops);
|
||||
OUT_CS_TABLE(code->fc_op_addrs.r300, code->num_fc_ops);
|
||||
}
|
||||
OUT_CS_REG_SEQ(R300_VAP_PVS_FLOW_CNTL_LOOP_INDEX_0, code->num_fc_ops);
|
||||
OUT_CS_TABLE(code->fc_loop_index, code->num_fc_ops);
|
||||
/* Emit flow control instructions. Even if there are no fc instructions,
|
||||
* we still need to write the registers to make sure they are cleared. */
|
||||
OUT_CS_REG(R300_VAP_PVS_FLOW_CNTL_OPC, code->fc_ops);
|
||||
if (r300screen->caps.is_r500) {
|
||||
OUT_CS_REG_SEQ(R500_VAP_PVS_FLOW_CNTL_ADDRS_LW_0, R300_VS_MAX_FC_OPS * 2);
|
||||
OUT_CS_TABLE(code->fc_op_addrs.r500, R300_VS_MAX_FC_OPS * 2);
|
||||
} else {
|
||||
OUT_CS_REG_SEQ(R300_VAP_PVS_FLOW_CNTL_ADDRS_0, R300_VS_MAX_FC_OPS);
|
||||
OUT_CS_TABLE(code->fc_op_addrs.r300, R300_VS_MAX_FC_OPS);
|
||||
}
|
||||
OUT_CS_REG_SEQ(R300_VAP_PVS_FLOW_CNTL_LOOP_INDEX_0, R300_VS_MAX_FC_OPS);
|
||||
OUT_CS_TABLE(code->fc_loop_index, R300_VS_MAX_FC_OPS);
|
||||
|
||||
END_CS;
|
||||
}
|
||||
|
@@ -818,7 +818,7 @@ static void r300_swtcl_draw_vbo(struct pipe_context* pipe,
|
||||
struct pipe_transfer *ib_transfer = NULL;
|
||||
int i;
|
||||
void *indices = NULL;
|
||||
boolean indexed = info->indexed && r300->vbuf_mgr->index_buffer.buffer;
|
||||
boolean indexed = info->indexed && r300->swtcl_index_buffer.buffer;
|
||||
|
||||
if (r300->skip_rendering) {
|
||||
return;
|
||||
@@ -831,10 +831,10 @@ static void r300_swtcl_draw_vbo(struct pipe_context* pipe,
|
||||
(indexed ? PREP_INDEXED : 0),
|
||||
indexed ? 256 : 6);
|
||||
|
||||
for (i = 0; i < r300->vbuf_mgr->nr_vertex_buffers; i++) {
|
||||
if (r300->vbuf_mgr->vertex_buffer[i].buffer) {
|
||||
for (i = 0; i < r300->swtcl_nr_vertex_buffers; i++) {
|
||||
if (r300->swtcl_vertex_buffer[i].buffer) {
|
||||
void *buf = pipe_buffer_map(pipe,
|
||||
r300->vbuf_mgr->vertex_buffer[i].buffer,
|
||||
r300->swtcl_vertex_buffer[i].buffer,
|
||||
PIPE_TRANSFER_READ |
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED,
|
||||
&vb_transfer[i]);
|
||||
@@ -843,7 +843,7 @@ static void r300_swtcl_draw_vbo(struct pipe_context* pipe,
|
||||
}
|
||||
|
||||
if (indexed) {
|
||||
indices = pipe_buffer_map(pipe, r300->vbuf_mgr->index_buffer.buffer,
|
||||
indices = pipe_buffer_map(pipe, r300->swtcl_index_buffer.buffer,
|
||||
PIPE_TRANSFER_READ |
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED, &ib_transfer);
|
||||
}
|
||||
@@ -856,8 +856,8 @@ static void r300_swtcl_draw_vbo(struct pipe_context* pipe,
|
||||
draw_flush(r300->draw);
|
||||
r300->draw_vbo_locked = FALSE;
|
||||
|
||||
for (i = 0; i < r300->vbuf_mgr->nr_vertex_buffers; i++) {
|
||||
if (r300->vbuf_mgr->vertex_buffer[i].buffer) {
|
||||
for (i = 0; i < r300->swtcl_nr_vertex_buffers; i++) {
|
||||
if (r300->swtcl_vertex_buffer[i].buffer) {
|
||||
pipe_buffer_unmap(pipe, vb_transfer[i]);
|
||||
draw_set_mapped_vertex_buffer(r300->draw, i, NULL);
|
||||
}
|
||||
|
@@ -212,6 +212,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e
|
||||
switch (param)
|
||||
{
|
||||
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
|
||||
case PIPE_SHADER_CAP_SUBROUTINES:
|
||||
return 0;
|
||||
default:;
|
||||
}
|
||||
|
@@ -1048,6 +1048,10 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
|
||||
|
||||
/* Override some states for Draw. */
|
||||
rs->rs_draw.sprite_coord_enable = 0; /* We can do this in HW. */
|
||||
rs->rs_draw.offset_point = 0;
|
||||
rs->rs_draw.offset_line = 0;
|
||||
rs->rs_draw.offset_tri = 0;
|
||||
rs->rs_draw.offset_clamp = 0;
|
||||
|
||||
#ifdef PIPE_ARCH_LITTLE_ENDIAN
|
||||
vap_control_status = R300_VC_NO_SWAP;
|
||||
@@ -1595,7 +1599,6 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
|
||||
const struct pipe_vertex_buffer* buffers)
|
||||
{
|
||||
struct r300_context* r300 = r300_context(pipe);
|
||||
unsigned i;
|
||||
struct pipe_vertex_buffer dummy_vb = {0};
|
||||
|
||||
/* There must be at least one vertex buffer set, otherwise it locks up. */
|
||||
@@ -1605,18 +1608,13 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
|
||||
count = 1;
|
||||
}
|
||||
|
||||
u_vbuf_set_vertex_buffers(r300->vbuf_mgr, count, buffers);
|
||||
|
||||
if (r300->screen->caps.has_tcl) {
|
||||
/* HW TCL. */
|
||||
for (i = 0; i < count; i++) {
|
||||
if (buffers[i].buffer &&
|
||||
!r300_resource(buffers[i].buffer)->b.user_ptr) {
|
||||
}
|
||||
}
|
||||
u_vbuf_set_vertex_buffers(r300->vbuf_mgr, count, buffers);
|
||||
r300->vertex_arrays_dirty = TRUE;
|
||||
} else {
|
||||
/* SW TCL. */
|
||||
util_copy_vertex_buffers(r300->swtcl_vertex_buffer,
|
||||
&r300->swtcl_nr_vertex_buffers,
|
||||
buffers, count);
|
||||
draw_set_vertex_buffers(r300->draw, count, buffers);
|
||||
}
|
||||
}
|
||||
@@ -1626,9 +1624,15 @@ static void r300_set_index_buffer(struct pipe_context* pipe,
|
||||
{
|
||||
struct r300_context* r300 = r300_context(pipe);
|
||||
|
||||
u_vbuf_set_index_buffer(r300->vbuf_mgr, ib);
|
||||
|
||||
if (!r300->screen->caps.has_tcl) {
|
||||
if (r300->screen->caps.has_tcl) {
|
||||
u_vbuf_set_index_buffer(r300->vbuf_mgr, ib);
|
||||
} else {
|
||||
if (ib) {
|
||||
pipe_resource_reference(&r300->swtcl_index_buffer.buffer, ib->buffer);
|
||||
memcpy(&r300->swtcl_index_buffer, ib, sizeof(*ib));
|
||||
} else {
|
||||
pipe_resource_reference(&r300->swtcl_index_buffer.buffer, NULL);
|
||||
}
|
||||
draw_set_index_buffer(r300->draw, ib);
|
||||
}
|
||||
}
|
||||
@@ -1702,11 +1706,11 @@ static void* r300_create_vertex_elements_state(struct pipe_context* pipe,
|
||||
return NULL;
|
||||
|
||||
velems->count = count;
|
||||
velems->vmgr_elements =
|
||||
u_vbuf_create_vertex_elements(r300->vbuf_mgr, count, attribs,
|
||||
velems->velem);
|
||||
|
||||
if (r300_screen(pipe->screen)->caps.has_tcl) {
|
||||
velems->vmgr_elements =
|
||||
u_vbuf_create_vertex_elements(r300->vbuf_mgr, count, attribs,
|
||||
velems->velem);
|
||||
/* Setup PSC.
|
||||
* The unused components will be replaced by (..., 0, 1). */
|
||||
r300_vertex_psc(velems);
|
||||
@@ -1716,6 +1720,8 @@ static void* r300_create_vertex_elements_state(struct pipe_context* pipe,
|
||||
align(util_format_get_blocksize(velems->velem[i].src_format), 4);
|
||||
velems->vertex_size_dwords += velems->format_size[i] / 4;
|
||||
}
|
||||
} else {
|
||||
memcpy(velems->velem, attribs, count * sizeof(struct pipe_vertex_element));
|
||||
}
|
||||
|
||||
return velems;
|
||||
@@ -1733,9 +1739,9 @@ static void r300_bind_vertex_elements_state(struct pipe_context *pipe,
|
||||
|
||||
r300->velems = velems;
|
||||
|
||||
u_vbuf_bind_vertex_elements(r300->vbuf_mgr, state, velems->vmgr_elements);
|
||||
|
||||
if (r300->draw) {
|
||||
if (r300->screen->caps.has_tcl) {
|
||||
u_vbuf_bind_vertex_elements(r300->vbuf_mgr, state, velems->vmgr_elements);
|
||||
} else {
|
||||
draw_set_vertex_elements(r300->draw, velems->count, velems->velem);
|
||||
return;
|
||||
}
|
||||
@@ -1750,7 +1756,9 @@ static void r300_delete_vertex_elements_state(struct pipe_context *pipe, void *s
|
||||
struct r300_context *r300 = r300_context(pipe);
|
||||
struct r300_vertex_element_state *velems = state;
|
||||
|
||||
u_vbuf_destroy_vertex_elements(r300->vbuf_mgr, velems->vmgr_elements);
|
||||
if (r300->screen->caps.has_tcl) {
|
||||
u_vbuf_destroy_vertex_elements(r300->vbuf_mgr, velems->vmgr_elements);
|
||||
}
|
||||
FREE(state);
|
||||
}
|
||||
|
||||
@@ -1765,10 +1773,10 @@ static void* r300_create_vs_state(struct pipe_context* pipe,
|
||||
vs->state.tokens = tgsi_dup_tokens(shader->tokens);
|
||||
|
||||
if (r300->screen->caps.has_tcl) {
|
||||
r300_init_vs_outputs(vs);
|
||||
r300_init_vs_outputs(r300, vs);
|
||||
r300_translate_vertex_shader(r300, vs);
|
||||
} else {
|
||||
r300_draw_init_vertex_shader(r300->draw, vs);
|
||||
r300_draw_init_vertex_shader(r300, vs);
|
||||
}
|
||||
|
||||
return vs;
|
||||
@@ -1794,9 +1802,8 @@ static void r300_bind_vs_state(struct pipe_context* pipe, void* shader)
|
||||
if (r300->screen->caps.has_tcl) {
|
||||
unsigned fc_op_dwords = r300->screen->caps.is_r500 ? 3 : 2;
|
||||
r300_mark_atom_dirty(r300, &r300->vs_state);
|
||||
r300->vs_state.size =
|
||||
vs->code.length + 9 +
|
||||
(vs->code.num_fc_ops ? vs->code.num_fc_ops * fc_op_dwords + 4 : 0);
|
||||
r300->vs_state.size = vs->code.length + 9 +
|
||||
(R300_VS_MAX_FC_OPS * fc_op_dwords + 4);
|
||||
|
||||
r300_mark_atom_dirty(r300, &r300->vs_constants);
|
||||
r300->vs_constants.size =
|
||||
|
@@ -36,6 +36,7 @@
|
||||
|
||||
/* Convert info about VS output semantics into r300_shader_semantics. */
|
||||
static void r300_shader_read_vs_outputs(
|
||||
struct r300_context *r300,
|
||||
struct tgsi_shader_info* info,
|
||||
struct r300_shader_semantics* vs_outputs)
|
||||
{
|
||||
@@ -83,6 +84,14 @@ static void r300_shader_read_vs_outputs(
|
||||
fprintf(stderr, "r300 VP: cannot handle edgeflag output.\n");
|
||||
break;
|
||||
|
||||
case TGSI_SEMANTIC_CLIPVERTEX:
|
||||
assert(index == 0);
|
||||
/* Draw does clip vertex for us. */
|
||||
if (r300->screen->caps.has_tcl) {
|
||||
fprintf(stderr, "r300 VP: cannot handle clip vertex output.\n");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "r300 VP: unknown vertex output semantic: %i.\n",
|
||||
info->output_semantic_name[i]);
|
||||
@@ -160,10 +169,11 @@ static void set_vertex_inputs_outputs(struct r300_vertex_program_compiler * c)
|
||||
c->code->outputs[outputs->wpos] = reg++;
|
||||
}
|
||||
|
||||
void r300_init_vs_outputs(struct r300_vertex_shader *vs)
|
||||
void r300_init_vs_outputs(struct r300_context *r300,
|
||||
struct r300_vertex_shader *vs)
|
||||
{
|
||||
tgsi_scan_shader(vs->state.tokens, &vs->info);
|
||||
r300_shader_read_vs_outputs(&vs->info, &vs->outputs);
|
||||
r300_shader_read_vs_outputs(r300, &vs->info, &vs->outputs);
|
||||
}
|
||||
|
||||
static void r300_dummy_vertex_shader(
|
||||
@@ -187,7 +197,7 @@ static void r300_dummy_vertex_shader(
|
||||
ureg_destroy(ureg);
|
||||
|
||||
shader->dummy = TRUE;
|
||||
r300_init_vs_outputs(shader);
|
||||
r300_init_vs_outputs(r300, shader);
|
||||
r300_translate_vertex_shader(r300, shader);
|
||||
}
|
||||
|
||||
|
@@ -56,12 +56,13 @@ struct r300_vertex_shader {
|
||||
void *draw_vs;
|
||||
};
|
||||
|
||||
void r300_init_vs_outputs(struct r300_vertex_shader *vs);
|
||||
void r300_init_vs_outputs(struct r300_context *r300,
|
||||
struct r300_vertex_shader *vs);
|
||||
|
||||
void r300_translate_vertex_shader(struct r300_context *r300,
|
||||
struct r300_vertex_shader *vs);
|
||||
|
||||
void r300_draw_init_vertex_shader(struct draw_context *draw,
|
||||
void r300_draw_init_vertex_shader(struct r300_context *r300,
|
||||
struct r300_vertex_shader *vs);
|
||||
|
||||
#endif /* R300_VS_H */
|
||||
|
@@ -29,7 +29,7 @@
|
||||
*
|
||||
* Transformations:
|
||||
* 1) If the secondary color output is present, the primary color must be
|
||||
* inserted before it.
|
||||
* present too.
|
||||
* 2) If any back-face color output is present, there must be all 4 color
|
||||
* outputs and missing ones must be inserted.
|
||||
* 3) Insert a trailing texcoord output containing a copy of POS, for WPOS.
|
||||
@@ -52,7 +52,6 @@ struct vs_transform_context {
|
||||
|
||||
boolean color_used[2];
|
||||
boolean bcolor_used[2];
|
||||
boolean temp_used[128];
|
||||
|
||||
/* Index of the pos output, typically 0. */
|
||||
unsigned pos_output;
|
||||
@@ -72,6 +71,8 @@ struct vs_transform_context {
|
||||
boolean first_instruction;
|
||||
/* End instruction processed? */
|
||||
boolean end_instruction;
|
||||
|
||||
boolean temp_used[1024];
|
||||
};
|
||||
|
||||
static void emit_temp(struct tgsi_transform_context *ctx, unsigned reg)
|
||||
@@ -102,9 +103,9 @@ static void emit_output(struct tgsi_transform_context *ctx,
|
||||
++vsctx->num_outputs;
|
||||
}
|
||||
|
||||
static void insert_output(struct tgsi_transform_context *ctx,
|
||||
struct tgsi_full_declaration *before,
|
||||
unsigned name, unsigned index, unsigned interp)
|
||||
static void insert_output_before(struct tgsi_transform_context *ctx,
|
||||
struct tgsi_full_declaration *before,
|
||||
unsigned name, unsigned index, unsigned interp)
|
||||
{
|
||||
struct vs_transform_context *vsctx = (struct vs_transform_context *)ctx;
|
||||
unsigned i;
|
||||
@@ -115,28 +116,29 @@ static void insert_output(struct tgsi_transform_context *ctx,
|
||||
}
|
||||
|
||||
/* Insert the new output. */
|
||||
emit_output(ctx, name, index, interp, before->Range.First);
|
||||
emit_output(ctx, name, index, interp,
|
||||
before->Range.First + vsctx->decl_shift);
|
||||
|
||||
++vsctx->decl_shift;
|
||||
}
|
||||
|
||||
static void insert_trailing_bcolor(struct tgsi_transform_context *ctx,
|
||||
struct tgsi_full_declaration *before)
|
||||
static void insert_output_after(struct tgsi_transform_context *ctx,
|
||||
struct tgsi_full_declaration *after,
|
||||
unsigned name, unsigned index, unsigned interp)
|
||||
{
|
||||
struct vs_transform_context *vsctx = (struct vs_transform_context *)ctx;
|
||||
unsigned i;
|
||||
|
||||
/* If BCOLOR0 is used, make sure BCOLOR1 is present too. Otherwise
|
||||
* the rasterizer doesn't do the color selection correctly. */
|
||||
if (vsctx->bcolor_used[0] && !vsctx->bcolor_used[1]) {
|
||||
if (before) {
|
||||
insert_output(ctx, before, TGSI_SEMANTIC_BCOLOR, 1,
|
||||
TGSI_INTERPOLATE_LINEAR);
|
||||
} else {
|
||||
emit_output(ctx, TGSI_SEMANTIC_BCOLOR, 1,
|
||||
TGSI_INTERPOLATE_LINEAR, vsctx->num_outputs);
|
||||
}
|
||||
vsctx->bcolor_used[1] = TRUE;
|
||||
/* Make a place for the new output. */
|
||||
for (i = after->Range.First+1; i < Elements(vsctx->out_remap); i++) {
|
||||
++vsctx->out_remap[i];
|
||||
}
|
||||
|
||||
/* Insert the new output. */
|
||||
emit_output(ctx, name, index, interp,
|
||||
after->Range.First + 1);
|
||||
|
||||
++vsctx->decl_shift;
|
||||
}
|
||||
|
||||
static void transform_decl(struct tgsi_transform_context *ctx,
|
||||
@@ -153,41 +155,38 @@ static void transform_decl(struct tgsi_transform_context *ctx,
|
||||
|
||||
case TGSI_SEMANTIC_COLOR:
|
||||
assert(decl->Semantic.Index < 2);
|
||||
vsctx->color_used[decl->Semantic.Index] = TRUE;
|
||||
|
||||
/* We must rasterize the first color if the second one is
|
||||
* used, otherwise the rasterizer doesn't do the color
|
||||
* selection correctly. Declare it, but don't write to it. */
|
||||
if (decl->Semantic.Index == 1 && !vsctx->color_used[0]) {
|
||||
insert_output(ctx, decl, TGSI_SEMANTIC_COLOR, 0,
|
||||
TGSI_INTERPOLATE_LINEAR);
|
||||
insert_output_before(ctx, decl, TGSI_SEMANTIC_COLOR, 0,
|
||||
TGSI_INTERPOLATE_LINEAR);
|
||||
vsctx->color_used[0] = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case TGSI_SEMANTIC_BCOLOR:
|
||||
assert(decl->Semantic.Index < 2);
|
||||
vsctx->bcolor_used[decl->Semantic.Index] = TRUE;
|
||||
|
||||
/* We must rasterize all 4 colors if back-face colors are
|
||||
* used, otherwise the rasterizer doesn't do the color
|
||||
* selection correctly. Declare it, but don't write to it. */
|
||||
if (!vsctx->color_used[0]) {
|
||||
insert_output(ctx, decl, TGSI_SEMANTIC_COLOR, 0,
|
||||
TGSI_INTERPOLATE_LINEAR);
|
||||
insert_output_before(ctx, decl, TGSI_SEMANTIC_COLOR, 0,
|
||||
TGSI_INTERPOLATE_LINEAR);
|
||||
vsctx->color_used[0] = TRUE;
|
||||
}
|
||||
if (!vsctx->color_used[1]) {
|
||||
insert_output(ctx, decl, TGSI_SEMANTIC_COLOR, 1,
|
||||
TGSI_INTERPOLATE_LINEAR);
|
||||
insert_output_before(ctx, decl, TGSI_SEMANTIC_COLOR, 1,
|
||||
TGSI_INTERPOLATE_LINEAR);
|
||||
vsctx->color_used[1] = TRUE;
|
||||
}
|
||||
if (decl->Semantic.Index == 1 && !vsctx->bcolor_used[0]) {
|
||||
insert_output(ctx, decl, TGSI_SEMANTIC_BCOLOR, 0,
|
||||
TGSI_INTERPOLATE_LINEAR);
|
||||
insert_output_before(ctx, decl, TGSI_SEMANTIC_BCOLOR, 0,
|
||||
TGSI_INTERPOLATE_LINEAR);
|
||||
vsctx->bcolor_used[0] = TRUE;
|
||||
}
|
||||
/* One more case is handled in insert_trailing_bcolor. */
|
||||
break;
|
||||
|
||||
case TGSI_SEMANTIC_GENERIC:
|
||||
@@ -195,11 +194,6 @@ static void transform_decl(struct tgsi_transform_context *ctx,
|
||||
break;
|
||||
}
|
||||
|
||||
if (decl->Semantic.Name != TGSI_SEMANTIC_BCOLOR) {
|
||||
/* Insert it as soon as possible. */
|
||||
insert_trailing_bcolor(ctx, decl);
|
||||
}
|
||||
|
||||
/* Since we're inserting new outputs in between, the following outputs
|
||||
* should be moved to the right so that they don't overlap with
|
||||
* the newly added ones. */
|
||||
@@ -214,6 +208,14 @@ static void transform_decl(struct tgsi_transform_context *ctx,
|
||||
}
|
||||
|
||||
ctx->emit_declaration(ctx, decl);
|
||||
|
||||
/* Insert BCOLOR1 if needed. */
|
||||
if (decl->Declaration.File == TGSI_FILE_OUTPUT &&
|
||||
decl->Semantic.Name == TGSI_SEMANTIC_BCOLOR &&
|
||||
!vsctx->bcolor_used[1]) {
|
||||
insert_output_after(ctx, decl, TGSI_SEMANTIC_BCOLOR, 1,
|
||||
TGSI_INTERPOLATE_LINEAR);
|
||||
}
|
||||
}
|
||||
|
||||
static void transform_inst(struct tgsi_transform_context *ctx,
|
||||
@@ -226,10 +228,6 @@ static void transform_inst(struct tgsi_transform_context *ctx,
|
||||
if (!vsctx->first_instruction) {
|
||||
vsctx->first_instruction = TRUE;
|
||||
|
||||
/* The trailing BCOLOR should be inserted before the code
|
||||
* if it hasn't already been done so. */
|
||||
insert_trailing_bcolor(ctx, NULL);
|
||||
|
||||
/* Insert the generic output for WPOS. */
|
||||
emit_output(ctx, TGSI_SEMANTIC_GENERIC, vsctx->last_generic + 1,
|
||||
TGSI_INTERPOLATE_PERSPECTIVE, vsctx->num_outputs);
|
||||
@@ -309,14 +307,18 @@ static void transform_inst(struct tgsi_transform_context *ctx,
|
||||
ctx->emit_instruction(ctx, inst);
|
||||
}
|
||||
|
||||
void r300_draw_init_vertex_shader(struct draw_context *draw,
|
||||
void r300_draw_init_vertex_shader(struct r300_context *r300,
|
||||
struct r300_vertex_shader *vs)
|
||||
{
|
||||
struct draw_context *draw = r300->draw;
|
||||
struct pipe_shader_state new_vs;
|
||||
struct tgsi_shader_info info;
|
||||
struct vs_transform_context transform;
|
||||
const uint newLen = tgsi_num_tokens(vs->state.tokens) + 100 /* XXX */;
|
||||
unsigned i;
|
||||
|
||||
tgsi_scan_shader(vs->state.tokens, &info);
|
||||
|
||||
new_vs.tokens = tgsi_alloc_tokens(newLen);
|
||||
if (new_vs.tokens == NULL)
|
||||
return;
|
||||
@@ -329,6 +331,22 @@ void r300_draw_init_vertex_shader(struct draw_context *draw,
|
||||
transform.base.transform_instruction = transform_inst;
|
||||
transform.base.transform_declaration = transform_decl;
|
||||
|
||||
for (i = 0; i < info.num_outputs; i++) {
|
||||
unsigned index = info.output_semantic_index[i];
|
||||
|
||||
switch (info.output_semantic_name[i]) {
|
||||
case TGSI_SEMANTIC_COLOR:
|
||||
assert(index < 2);
|
||||
transform.color_used[index] = TRUE;
|
||||
break;
|
||||
|
||||
case TGSI_SEMANTIC_BCOLOR:
|
||||
assert(index < 2);
|
||||
transform.bcolor_used[index] = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tgsi_transform_shader(vs->state.tokens,
|
||||
(struct tgsi_token*)new_vs.tokens,
|
||||
newLen, &transform.base);
|
||||
@@ -350,7 +368,7 @@ void r300_draw_init_vertex_shader(struct draw_context *draw,
|
||||
vs->state.tokens = new_vs.tokens;
|
||||
|
||||
/* Init the VS output table for the rasterizer. */
|
||||
r300_init_vs_outputs(vs);
|
||||
r300_init_vs_outputs(r300, vs);
|
||||
|
||||
/* Make the last generic be WPOS. */
|
||||
vs->outputs.wpos = vs->outputs.generic[transform.last_generic + 1];
|
||||
|
@@ -1277,6 +1277,14 @@ static int r600_shader_from_tgsi(struct r600_pipe_context * rctx, struct r600_pi
|
||||
if (ctx.bc->chip_class == CAYMAN)
|
||||
cm_bytecode_add_cf_end(ctx.bc);
|
||||
|
||||
/* check GPR limit - we have 124 = 128 - 4
|
||||
* (4 are reserved as alu clause temporary registers) */
|
||||
if (ctx.bc->ngpr > 124) {
|
||||
R600_ERR("GPR limit exceeded - shader requires %d registers\n", ctx.bc->ngpr);
|
||||
r = -ENOMEM;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
free(ctx.literals);
|
||||
tgsi_parse_free(&ctx.parse);
|
||||
return 0;
|
||||
|
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
|
||||
#ifndef __HAIKU__
|
||||
typedef int64_t int64;
|
||||
typedef uint64_t uint64;
|
||||
|
||||
@@ -39,6 +40,9 @@ typedef uint16_t uint16;
|
||||
|
||||
typedef int8_t int8;
|
||||
typedef uint8_t uint8;
|
||||
#else
|
||||
#include <OS.h>
|
||||
#endif /* HAIKU */
|
||||
|
||||
typedef uint8_t Bool;
|
||||
|
||||
|
@@ -44,8 +44,7 @@ static void svga_surface_copy(struct pipe_context *pipe,
|
||||
const struct pipe_box *src_box)
|
||||
{
|
||||
struct svga_context *svga = svga_context(pipe);
|
||||
struct svga_texture *stex = svga_texture(src_tex);
|
||||
struct svga_texture *dtex = svga_texture(dst_tex);
|
||||
struct svga_texture *stex, *dtex;
|
||||
/* struct pipe_screen *screen = pipe->screen;
|
||||
SVGA3dCopyBox *box;
|
||||
enum pipe_error ret;
|
||||
@@ -63,6 +62,9 @@ static void svga_surface_copy(struct pipe_context *pipe,
|
||||
return;
|
||||
}
|
||||
|
||||
stex = svga_texture(src_tex);
|
||||
dtex = svga_texture(dst_tex);
|
||||
|
||||
#if 0
|
||||
srcsurf = screen->get_tex_surface(screen, src_tex,
|
||||
src_level, src_box->z, src_box->z,
|
||||
|
@@ -57,10 +57,10 @@ svga_translate_stencil_op(unsigned op)
|
||||
case PIPE_STENCIL_OP_KEEP: return SVGA3D_STENCILOP_KEEP;
|
||||
case PIPE_STENCIL_OP_ZERO: return SVGA3D_STENCILOP_ZERO;
|
||||
case PIPE_STENCIL_OP_REPLACE: return SVGA3D_STENCILOP_REPLACE;
|
||||
case PIPE_STENCIL_OP_INCR: return SVGA3D_STENCILOP_INCR;
|
||||
case PIPE_STENCIL_OP_DECR: return SVGA3D_STENCILOP_DECR;
|
||||
case PIPE_STENCIL_OP_INCR_WRAP: return SVGA3D_STENCILOP_INCRSAT; /* incorrect? */
|
||||
case PIPE_STENCIL_OP_DECR_WRAP: return SVGA3D_STENCILOP_DECRSAT; /* incorrect? */
|
||||
case PIPE_STENCIL_OP_INCR: return SVGA3D_STENCILOP_INCRSAT;
|
||||
case PIPE_STENCIL_OP_DECR: return SVGA3D_STENCILOP_DECRSAT;
|
||||
case PIPE_STENCIL_OP_INCR_WRAP: return SVGA3D_STENCILOP_INCR;
|
||||
case PIPE_STENCIL_OP_DECR_WRAP: return SVGA3D_STENCILOP_DECR;
|
||||
case PIPE_STENCIL_OP_INVERT: return SVGA3D_STENCILOP_INVERT;
|
||||
default:
|
||||
assert(0);
|
||||
|
@@ -201,6 +201,17 @@ svga_release_user_upl_buffers(struct svga_context *svga)
|
||||
if (vb->buffer && svga_buffer_is_user_buffer(vb->buffer)) {
|
||||
struct svga_buffer *buffer = svga_buffer(vb->buffer);
|
||||
|
||||
/* The buffer_offset is relative to the uploaded buffer.
|
||||
* Since we're discarding that buffer we need to reset this offset
|
||||
* so it's not inadvertantly applied to a subsequent draw.
|
||||
*
|
||||
* XXX a root problem here is that the svga->curr.vb[] information
|
||||
* is getting set both by gallium API calls and by code in
|
||||
* svga_upload_user_buffers(). We should instead have two copies
|
||||
* of the vertex buffer information and choose between as needed.
|
||||
*/
|
||||
vb->buffer_offset = 0;
|
||||
|
||||
buffer->uploaded.start = ~0;
|
||||
buffer->uploaded.end = 0;
|
||||
if (buffer->uploaded.buffer)
|
||||
|
@@ -237,11 +237,11 @@ static void svga_bind_rasterizer_state( struct pipe_context *pipe,
|
||||
struct svga_context *svga = svga_context(pipe);
|
||||
struct svga_rasterizer_state *raster = (struct svga_rasterizer_state *)state;
|
||||
|
||||
svga->curr.rast = raster;
|
||||
|
||||
draw_set_rasterizer_state(svga->swtnl.draw, raster ? &raster->templ : NULL,
|
||||
state);
|
||||
|
||||
svga->curr.rast = raster;
|
||||
|
||||
svga->dirty |= SVGA_NEW_RAST;
|
||||
}
|
||||
|
||||
|
@@ -125,8 +125,8 @@ svga_create_sampler_state(struct pipe_context *pipe,
|
||||
* - min/max LOD clamping
|
||||
*/
|
||||
cso->min_lod = 0;
|
||||
cso->view_min_lod = MAX2(sampler->min_lod, 0);
|
||||
cso->view_max_lod = MAX2(sampler->max_lod, 0);
|
||||
cso->view_min_lod = MAX2((int) (sampler->min_lod + 0.5), 0);
|
||||
cso->view_max_lod = MAX2((int) (sampler->max_lod + 0.5), 0);
|
||||
|
||||
/* Use min_mipmap */
|
||||
if (svga->debug.use_min_mipmap) {
|
||||
|
@@ -120,7 +120,7 @@ svga_get_paramf(struct pipe_screen *screen, enum pipe_capf param)
|
||||
return result.u;
|
||||
|
||||
case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
|
||||
return 16.0;
|
||||
return 15.0;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
@@ -235,7 +235,7 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en
|
||||
case PIPE_SHADER_CAP_MAX_TEMPS:
|
||||
if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS, &result))
|
||||
return 32;
|
||||
return result.u;
|
||||
return MIN2(result.u, SVGA3D_TEMPREG_MAX);
|
||||
case PIPE_SHADER_CAP_MAX_ADDRS:
|
||||
case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
|
||||
/*
|
||||
@@ -286,7 +286,7 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en
|
||||
case PIPE_SHADER_CAP_MAX_TEMPS:
|
||||
if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS, &result))
|
||||
return 32;
|
||||
return result.u;
|
||||
return MIN2(result.u, SVGA3D_TEMPREG_MAX);
|
||||
case PIPE_SHADER_CAP_MAX_ADDRS:
|
||||
return 1;
|
||||
case PIPE_SHADER_CAP_MAX_PREDS:
|
||||
|
@@ -136,7 +136,7 @@ update_need_pipeline( struct svga_context *svga,
|
||||
|
||||
/* EDGEFLAGS
|
||||
*/
|
||||
if (vs->base.info.writes_edgeflag) {
|
||||
if (vs && vs->base.info.writes_edgeflag) {
|
||||
SVGA_DBG(DEBUG_SWTNL, "%s: edgeflags\n", __FUNCTION__);
|
||||
need_pipeline = TRUE;
|
||||
}
|
||||
@@ -145,7 +145,8 @@ update_need_pipeline( struct svga_context *svga,
|
||||
*/
|
||||
if (svga->curr.reduced_prim == PIPE_PRIM_POINTS) {
|
||||
unsigned sprite_coord_gen = svga->curr.rast->templ.sprite_coord_enable;
|
||||
unsigned generic_inputs = svga->curr.fs->generic_inputs;
|
||||
unsigned generic_inputs =
|
||||
svga->curr.fs ? svga->curr.fs->generic_inputs : 0;
|
||||
|
||||
if (sprite_coord_gen &&
|
||||
(generic_inputs & ~sprite_coord_gen)) {
|
||||
|
@@ -82,12 +82,14 @@ update_tss_binding(struct svga_context *svga,
|
||||
const struct svga_sampler_state *s = svga->curr.sampler[i];
|
||||
struct svga_hw_view_state *view = &svga->state.hw_draw.views[i];
|
||||
struct pipe_resource *texture = NULL;
|
||||
struct pipe_sampler_view *sv = svga->curr.sampler_views[i];
|
||||
|
||||
/* get min max lod */
|
||||
if (svga->curr.sampler_views[i]) {
|
||||
min_lod = MAX2(s->view_min_lod, 0);
|
||||
max_lod = MIN2(s->view_max_lod, svga->curr.sampler_views[i]->texture->last_level);
|
||||
texture = svga->curr.sampler_views[i]->texture;
|
||||
if (sv) {
|
||||
min_lod = MAX2(0, (s->view_min_lod + sv->u.tex.first_level));
|
||||
max_lod = MIN2(s->view_max_lod, sv->texture->last_level);
|
||||
max_lod += sv->u.tex.first_level;
|
||||
texture = sv->texture;
|
||||
} else {
|
||||
min_lod = 0;
|
||||
max_lod = 0;
|
||||
|
@@ -320,6 +320,11 @@ svga_mark_surface_dirty(struct pipe_surface *surf)
|
||||
else {
|
||||
/* this will happen later in svga_propagate_surface */
|
||||
}
|
||||
|
||||
/* Increment the view_age and texture age for this surface's slice
|
||||
* so that any sampler views into the texture are re-validated too.
|
||||
*/
|
||||
tex->view_age[surf->u.tex.first_layer] = ++(tex->age);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -253,6 +253,7 @@ drisw_update_tex_buffer(struct dri_drawable *drawable,
|
||||
char *map;
|
||||
int x, y, w, h;
|
||||
int ximage_stride, line;
|
||||
int cpp = util_format_get_blocksize(res->format);
|
||||
|
||||
get_drawable_info(dPriv, &x, &y, &w, &h);
|
||||
|
||||
@@ -265,9 +266,8 @@ drisw_update_tex_buffer(struct dri_drawable *drawable,
|
||||
/* Copy the Drawable content to the mapped texture buffer */
|
||||
get_image(dPriv, x, y, w, h, map);
|
||||
|
||||
/* The pipe transfer has a pitch rounded up to the nearest 64 pixels.
|
||||
We assume 32 bit pixels. */
|
||||
ximage_stride = w * 4;
|
||||
/* The pipe transfer has a pitch rounded up to the nearest 64 pixels. */
|
||||
ximage_stride = w * cpp;
|
||||
for (line = h-1; line; --line) {
|
||||
memmove(&map[line * transfer->stride],
|
||||
&map[line * ximage_stride],
|
||||
|
@@ -73,8 +73,8 @@ static void add_glyph(struct vg_font *font,
|
||||
glyph = CALLOC_STRUCT(vg_glyph);
|
||||
glyph->object = obj;
|
||||
glyph->is_hinted = isHinted;
|
||||
memcpy(glyph->glyph_origin, glyphOrigin, sizeof(glyphOrigin));
|
||||
memcpy(glyph->escapement, escapement, sizeof(escapement));
|
||||
memcpy(glyph->glyph_origin, glyphOrigin, sizeof(glyph->glyph_origin));
|
||||
memcpy(glyph->escapement, escapement, sizeof(glyph->glyph_origin));
|
||||
|
||||
cso_hash_insert(font->glyphs, (unsigned) glyphIndex, glyph);
|
||||
}
|
||||
|
@@ -526,8 +526,8 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx,
|
||||
src += offset;
|
||||
for (i = 0; i < n; ++i) {
|
||||
VGfloat clr[4];
|
||||
clr[0] = ((*src >> 10) & 31)/31.;
|
||||
clr[1] = ((*src >> 5) & 95)/95.;
|
||||
clr[0] = ((*src >> 11) & 31)/31.;
|
||||
clr[1] = ((*src >> 5) & 63)/63.;
|
||||
clr[2] = ((*src >> 0) & 31)/31.;
|
||||
clr[3] = 1.f;
|
||||
|
||||
|
@@ -46,7 +46,7 @@ endif
|
||||
default: depend $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING)
|
||||
|
||||
$(LIBNAME): $(OBJECTS) Makefile ../Makefile.xorg $(LIBS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES)
|
||||
$(MKLIB) -linker '$(LD)' -noprefix -o $@ $(LDFLAGS) $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
|
||||
$(MKLIB) -linker '$(LD)' -noprefix -o $@ -ldflags '$(LDFLAGS)' $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
|
||||
|
||||
depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES)
|
||||
rm -f depend
|
||||
|
@@ -54,8 +54,9 @@ dlopen_gl_lib_cb(const char *dir, size_t len, void *callback_data)
|
||||
int ret;
|
||||
|
||||
if (len) {
|
||||
assert(len <= INT_MAX && "path is insanely long!");
|
||||
ret = util_snprintf(path, sizeof(path), "%.*s/%s" UTIL_DL_EXT,
|
||||
len, dir, name);
|
||||
(int)len, dir, name);
|
||||
}
|
||||
else {
|
||||
ret = util_snprintf(path, sizeof(path), "%s" UTIL_DL_EXT, name);
|
||||
|
@@ -39,6 +39,7 @@ LOCAL_SRC_FILES := \
|
||||
$(LIBGLSL_CXX_SOURCES)
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
external/astl/include \
|
||||
$(MESA_TOP)/src/mapi \
|
||||
$(MESA_TOP)/src/mesa
|
||||
|
||||
|
@@ -3516,11 +3516,9 @@ ast_switch_statement::hir(exec_list *instructions,
|
||||
*
|
||||
* "The type of init-expression in a switch statement must be a
|
||||
* scalar integer."
|
||||
*
|
||||
* The checks are separated so that higher quality diagnostics can be
|
||||
* generated for cases where the rule is violated.
|
||||
*/
|
||||
if (!test_expression->type->is_integer()) {
|
||||
if (!test_expression->type->is_scalar() ||
|
||||
!test_expression->type->is_integer()) {
|
||||
YYLTYPE loc = this->test_expression->get_location();
|
||||
|
||||
_mesa_glsl_error(& loc,
|
||||
@@ -3571,7 +3569,7 @@ ast_switch_statement::hir(exec_list *instructions,
|
||||
/* Cache test expression.
|
||||
*/
|
||||
test_to_hir(instructions, state);
|
||||
|
||||
|
||||
/* Emit code for body of switch stmt.
|
||||
*/
|
||||
body->hir(instructions, state);
|
||||
@@ -3580,290 +3578,265 @@ ast_switch_statement::hir(exec_list *instructions,
|
||||
|
||||
state->switch_state = saved;
|
||||
|
||||
/* Switch statements do not have r-values.
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
/* Switch statements do not have r-values. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_switch_statement::test_to_hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
void *ctx = state;
|
||||
void
|
||||
ast_switch_statement::test_to_hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
void *ctx = state;
|
||||
|
||||
/* Cache value of test expression.
|
||||
*/
|
||||
ir_rvalue *const test_val =
|
||||
test_expression->hir(instructions,
|
||||
state);
|
||||
/* Cache value of test expression. */
|
||||
ir_rvalue *const test_val =
|
||||
test_expression->hir(instructions,
|
||||
state);
|
||||
|
||||
state->switch_state.test_var = new(ctx) ir_variable(glsl_type::int_type,
|
||||
"switch_test_tmp",
|
||||
ir_var_temporary);
|
||||
ir_dereference_variable *deref_test_var =
|
||||
new(ctx) ir_dereference_variable(state->switch_state.test_var);
|
||||
state->switch_state.test_var = new(ctx) ir_variable(test_val->type,
|
||||
"switch_test_tmp",
|
||||
ir_var_temporary);
|
||||
ir_dereference_variable *deref_test_var =
|
||||
new(ctx) ir_dereference_variable(state->switch_state.test_var);
|
||||
|
||||
instructions->push_tail(state->switch_state.test_var);
|
||||
instructions->push_tail(new(ctx) ir_assignment(deref_test_var,
|
||||
test_val,
|
||||
NULL));
|
||||
}
|
||||
instructions->push_tail(state->switch_state.test_var);
|
||||
instructions->push_tail(new(ctx) ir_assignment(deref_test_var, test_val,
|
||||
NULL));
|
||||
}
|
||||
|
||||
|
||||
ir_rvalue *
|
||||
ast_switch_body::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
if (stmts != NULL)
|
||||
stmts->hir(instructions, state);
|
||||
ir_rvalue *
|
||||
ast_switch_body::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
if (stmts != NULL)
|
||||
stmts->hir(instructions, state);
|
||||
|
||||
/* Switch bodies do not have r-values.
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
/* Switch bodies do not have r-values. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ir_rvalue *
|
||||
ast_case_statement_list::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
foreach_list_typed (ast_case_statement, case_stmt, link, & this->cases)
|
||||
case_stmt->hir(instructions, state);
|
||||
|
||||
/* Case statements do not have r-values. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ir_rvalue *
|
||||
ast_case_statement::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
labels->hir(instructions, state);
|
||||
|
||||
/* Conditionally set fallthru state based on break state. */
|
||||
ir_constant *const false_val = new(state) ir_constant(false);
|
||||
ir_dereference_variable *const deref_is_fallthru_var =
|
||||
new(state) ir_dereference_variable(state->switch_state.is_fallthru_var);
|
||||
ir_dereference_variable *const deref_is_break_var =
|
||||
new(state) ir_dereference_variable(state->switch_state.is_break_var);
|
||||
ir_assignment *const reset_fallthru_on_break =
|
||||
new(state) ir_assignment(deref_is_fallthru_var,
|
||||
false_val,
|
||||
deref_is_break_var);
|
||||
instructions->push_tail(reset_fallthru_on_break);
|
||||
|
||||
/* Guard case statements depending on fallthru state. */
|
||||
ir_dereference_variable *const deref_fallthru_guard =
|
||||
new(state) ir_dereference_variable(state->switch_state.is_fallthru_var);
|
||||
ir_if *const test_fallthru = new(state) ir_if(deref_fallthru_guard);
|
||||
|
||||
foreach_list_typed (ast_node, stmt, link, & this->stmts)
|
||||
stmt->hir(& test_fallthru->then_instructions, state);
|
||||
|
||||
instructions->push_tail(test_fallthru);
|
||||
|
||||
/* Case statements do not have r-values. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
ir_rvalue *
|
||||
ast_case_statement_list::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
foreach_list_typed (ast_case_statement, case_stmt, link, & this->cases)
|
||||
case_stmt->hir(instructions, state);
|
||||
ir_rvalue *
|
||||
ast_case_label_list::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
foreach_list_typed (ast_case_label, label, link, & this->labels)
|
||||
label->hir(instructions, state);
|
||||
|
||||
/* Case statements do not have r-values.
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
/* Case labels do not have r-values. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ir_rvalue *
|
||||
ast_case_label::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
void *ctx = state;
|
||||
|
||||
ir_rvalue *
|
||||
ast_case_statement::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
labels->hir(instructions, state);
|
||||
ir_dereference_variable *deref_fallthru_var =
|
||||
new(ctx) ir_dereference_variable(state->switch_state.is_fallthru_var);
|
||||
|
||||
/* Conditionally set fallthru state based on break state.
|
||||
*/
|
||||
ir_constant *const false_val = new(state) ir_constant(false);
|
||||
ir_dereference_variable *const deref_is_fallthru_var =
|
||||
new(state) ir_dereference_variable(state->switch_state.is_fallthru_var);
|
||||
ir_dereference_variable *const deref_is_break_var =
|
||||
new(state) ir_dereference_variable(state->switch_state.is_break_var);
|
||||
ir_assignment *const reset_fallthru_on_break =
|
||||
new(state) ir_assignment(deref_is_fallthru_var,
|
||||
false_val,
|
||||
deref_is_break_var);
|
||||
instructions->push_tail(reset_fallthru_on_break);
|
||||
ir_rvalue *const true_val = new(ctx) ir_constant(true);
|
||||
|
||||
/* Guard case statements depending on fallthru state.
|
||||
*/
|
||||
ir_dereference_variable *const deref_fallthru_guard =
|
||||
new(state) ir_dereference_variable(state->switch_state.is_fallthru_var);
|
||||
ir_if *const test_fallthru = new(state) ir_if(deref_fallthru_guard);
|
||||
/* If not default case, ... */
|
||||
if (this->test_value != NULL) {
|
||||
/* Conditionally set fallthru state based on
|
||||
* comparison of cached test expression value to case label.
|
||||
*/
|
||||
ir_rvalue *const label_rval = this->test_value->hir(instructions, state);
|
||||
ir_constant *label_const = label_rval->constant_expression_value();
|
||||
|
||||
foreach_list_typed (ast_node, stmt, link, & this->stmts)
|
||||
stmt->hir(& test_fallthru->then_instructions, state);
|
||||
if (!label_const) {
|
||||
YYLTYPE loc = this->test_value->get_location();
|
||||
|
||||
instructions->push_tail(test_fallthru);
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"switch statement case label must be a "
|
||||
"constant expression");
|
||||
|
||||
/* Case statements do not have r-values.
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
/* Stuff a dummy value in to allow processing to continue. */
|
||||
label_const = new(ctx) ir_constant(0);
|
||||
} else {
|
||||
ast_expression *previous_label = (ast_expression *)
|
||||
hash_table_find(state->switch_state.labels_ht,
|
||||
(void *)(uintptr_t)label_const->value.u[0]);
|
||||
|
||||
if (previous_label) {
|
||||
YYLTYPE loc = this->test_value->get_location();
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"duplicate case value");
|
||||
|
||||
ir_rvalue *
|
||||
ast_case_label_list::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
foreach_list_typed (ast_case_label, label, link, & this->labels)
|
||||
label->hir(instructions, state);
|
||||
|
||||
/* Case labels do not have r-values.
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
ir_rvalue *
|
||||
ast_case_label::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
void *ctx = state;
|
||||
|
||||
ir_dereference_variable *deref_fallthru_var =
|
||||
new(ctx) ir_dereference_variable(state->switch_state.is_fallthru_var);
|
||||
|
||||
ir_rvalue *const true_val = new(ctx) ir_constant(true);
|
||||
|
||||
/* If not default case, ...
|
||||
*/
|
||||
if (this->test_value != NULL) {
|
||||
/* Conditionally set fallthru state based on
|
||||
* comparison of cached test expression value to case label.
|
||||
*/
|
||||
ir_rvalue *const label_rval = this->test_value->hir(instructions, state);
|
||||
ir_constant *label_const = label_rval->constant_expression_value();
|
||||
|
||||
if (!label_const) {
|
||||
YYLTYPE loc = this->test_value->get_location();
|
||||
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"switch statement case label must be a "
|
||||
"constant expression");
|
||||
|
||||
/* Stuff a dummy value in to allow processing to continue. */
|
||||
label_const = new(ctx) ir_constant(0);
|
||||
} else {
|
||||
ast_expression *previous_label = (ast_expression *)
|
||||
hash_table_find(state->switch_state.labels_ht,
|
||||
loc = previous_label->get_location();
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"this is the previous case label");
|
||||
} else {
|
||||
hash_table_insert(state->switch_state.labels_ht,
|
||||
this->test_value,
|
||||
(void *)(uintptr_t)label_const->value.u[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (previous_label) {
|
||||
YYLTYPE loc = this->test_value->get_location();
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"duplicate case value");
|
||||
ir_dereference_variable *deref_test_var =
|
||||
new(ctx) ir_dereference_variable(state->switch_state.test_var);
|
||||
|
||||
loc = previous_label->get_location();
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"this is the previous case label");
|
||||
} else {
|
||||
hash_table_insert(state->switch_state.labels_ht,
|
||||
this->test_value,
|
||||
(void *)(uintptr_t)label_const->value.u[0]);
|
||||
}
|
||||
}
|
||||
ir_rvalue *const test_cond = new(ctx) ir_expression(ir_binop_all_equal,
|
||||
label_const,
|
||||
deref_test_var);
|
||||
|
||||
ir_dereference_variable *deref_test_var =
|
||||
new(ctx) ir_dereference_variable(state->switch_state.test_var);
|
||||
ir_assignment *set_fallthru_on_test =
|
||||
new(ctx) ir_assignment(deref_fallthru_var,
|
||||
true_val,
|
||||
test_cond);
|
||||
|
||||
ir_rvalue *const test_cond = new(ctx) ir_expression(ir_binop_all_equal,
|
||||
glsl_type::bool_type,
|
||||
label_const,
|
||||
deref_test_var);
|
||||
instructions->push_tail(set_fallthru_on_test);
|
||||
} else { /* default case */
|
||||
if (state->switch_state.previous_default) {
|
||||
YYLTYPE loc = this->get_location();
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"multiple default labels in one switch");
|
||||
|
||||
ir_assignment *set_fallthru_on_test =
|
||||
new(ctx) ir_assignment(deref_fallthru_var,
|
||||
true_val,
|
||||
test_cond);
|
||||
loc = state->switch_state.previous_default->get_location();
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"this is the first default label");
|
||||
}
|
||||
state->switch_state.previous_default = this;
|
||||
|
||||
instructions->push_tail(set_fallthru_on_test);
|
||||
} else { /* default case */
|
||||
if (state->switch_state.previous_default) {
|
||||
printf("a\n");
|
||||
YYLTYPE loc = this->get_location();
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"multiple default labels in one switch");
|
||||
/* Set falltrhu state. */
|
||||
ir_assignment *set_fallthru =
|
||||
new(ctx) ir_assignment(deref_fallthru_var, true_val, NULL);
|
||||
|
||||
printf("b\n");
|
||||
instructions->push_tail(set_fallthru);
|
||||
}
|
||||
|
||||
loc = state->switch_state.previous_default->get_location();
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"this is the first default label");
|
||||
}
|
||||
state->switch_state.previous_default = this;
|
||||
/* Case statements do not have r-values. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Set falltrhu state.
|
||||
*/
|
||||
ir_assignment *set_fallthru =
|
||||
new(ctx) ir_assignment(deref_fallthru_var,
|
||||
true_val,
|
||||
NULL);
|
||||
void
|
||||
ast_iteration_statement::condition_to_hir(ir_loop *stmt,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
void *ctx = state;
|
||||
|
||||
instructions->push_tail(set_fallthru);
|
||||
}
|
||||
if (condition != NULL) {
|
||||
ir_rvalue *const cond =
|
||||
condition->hir(& stmt->body_instructions, state);
|
||||
|
||||
/* Case statements do not have r-values.
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
if ((cond == NULL)
|
||||
|| !cond->type->is_boolean() || !cond->type->is_scalar()) {
|
||||
YYLTYPE loc = condition->get_location();
|
||||
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"loop condition must be scalar boolean");
|
||||
} else {
|
||||
/* As the first code in the loop body, generate a block that looks
|
||||
* like 'if (!condition) break;' as the loop termination condition.
|
||||
*/
|
||||
ir_rvalue *const not_cond =
|
||||
new(ctx) ir_expression(ir_unop_logic_not, cond);
|
||||
|
||||
ir_if *const if_stmt = new(ctx) ir_if(not_cond);
|
||||
|
||||
ir_jump *const break_stmt =
|
||||
new(ctx) ir_loop_jump(ir_loop_jump::jump_break);
|
||||
|
||||
if_stmt->then_instructions.push_tail(break_stmt);
|
||||
stmt->body_instructions.push_tail(if_stmt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_iteration_statement::condition_to_hir(ir_loop *stmt,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
void *ctx = state;
|
||||
ir_rvalue *
|
||||
ast_iteration_statement::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
void *ctx = state;
|
||||
|
||||
if (condition != NULL) {
|
||||
ir_rvalue *const cond =
|
||||
condition->hir(& stmt->body_instructions, state);
|
||||
/* For-loops and while-loops start a new scope, but do-while loops do not.
|
||||
*/
|
||||
if (mode != ast_do_while)
|
||||
state->symbols->push_scope();
|
||||
|
||||
if ((cond == NULL)
|
||||
|| !cond->type->is_boolean() || !cond->type->is_scalar()) {
|
||||
YYLTYPE loc = condition->get_location();
|
||||
if (init_statement != NULL)
|
||||
init_statement->hir(instructions, state);
|
||||
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"loop condition must be scalar boolean");
|
||||
} else {
|
||||
/* As the first code in the loop body, generate a block that looks
|
||||
* like 'if (!condition) break;' as the loop termination condition.
|
||||
*/
|
||||
ir_rvalue *const not_cond =
|
||||
new(ctx) ir_expression(ir_unop_logic_not, glsl_type::bool_type, cond,
|
||||
NULL);
|
||||
ir_loop *const stmt = new(ctx) ir_loop();
|
||||
instructions->push_tail(stmt);
|
||||
|
||||
ir_if *const if_stmt = new(ctx) ir_if(not_cond);
|
||||
/* Track the current loop nesting. */
|
||||
ast_iteration_statement *nesting_ast = state->loop_nesting_ast;
|
||||
|
||||
ir_jump *const break_stmt =
|
||||
new(ctx) ir_loop_jump(ir_loop_jump::jump_break);
|
||||
state->loop_nesting_ast = this;
|
||||
|
||||
if_stmt->then_instructions.push_tail(break_stmt);
|
||||
stmt->body_instructions.push_tail(if_stmt);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Likewise, indicate that following code is closest to a loop,
|
||||
* NOT closest to a switch.
|
||||
*/
|
||||
bool saved_is_switch_innermost = state->switch_state.is_switch_innermost;
|
||||
state->switch_state.is_switch_innermost = false;
|
||||
|
||||
if (mode != ast_do_while)
|
||||
condition_to_hir(stmt, state);
|
||||
|
||||
ir_rvalue *
|
||||
ast_iteration_statement::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
void *ctx = state;
|
||||
if (body != NULL)
|
||||
body->hir(& stmt->body_instructions, state);
|
||||
|
||||
/* For-loops and while-loops start a new scope, but do-while loops do not.
|
||||
*/
|
||||
if (mode != ast_do_while)
|
||||
state->symbols->push_scope();
|
||||
if (rest_expression != NULL)
|
||||
rest_expression->hir(& stmt->body_instructions, state);
|
||||
|
||||
if (init_statement != NULL)
|
||||
init_statement->hir(instructions, state);
|
||||
if (mode == ast_do_while)
|
||||
condition_to_hir(stmt, state);
|
||||
|
||||
ir_loop *const stmt = new(ctx) ir_loop();
|
||||
instructions->push_tail(stmt);
|
||||
if (mode != ast_do_while)
|
||||
state->symbols->pop_scope();
|
||||
|
||||
/* Track the current loop nesting.
|
||||
*/
|
||||
ast_iteration_statement *nesting_ast = state->loop_nesting_ast;
|
||||
|
||||
state->loop_nesting_ast = this;
|
||||
|
||||
/* Likewise, indicate that following code is closest to a loop,
|
||||
* NOT closest to a switch.
|
||||
*/
|
||||
bool saved_is_switch_innermost = state->switch_state.is_switch_innermost;
|
||||
state->switch_state.is_switch_innermost = false;
|
||||
|
||||
if (mode != ast_do_while)
|
||||
condition_to_hir(stmt, state);
|
||||
|
||||
if (body != NULL)
|
||||
body->hir(& stmt->body_instructions, state);
|
||||
|
||||
if (rest_expression != NULL)
|
||||
rest_expression->hir(& stmt->body_instructions, state);
|
||||
|
||||
if (mode == ast_do_while)
|
||||
condition_to_hir(stmt, state);
|
||||
|
||||
if (mode != ast_do_while)
|
||||
state->symbols->pop_scope();
|
||||
|
||||
/* Restore previous nesting before returning.
|
||||
*/
|
||||
state->loop_nesting_ast = nesting_ast;
|
||||
state->switch_state.is_switch_innermost = saved_is_switch_innermost;
|
||||
/* Restore previous nesting before returning. */
|
||||
state->loop_nesting_ast = nesting_ast;
|
||||
state->switch_state.is_switch_innermost = saved_is_switch_innermost;
|
||||
|
||||
/* Loops do not have r-values.
|
||||
*/
|
||||
|
@@ -2,21 +2,21 @@
|
||||
(signature float
|
||||
(parameters
|
||||
(declare (in) float x))
|
||||
((return (expression float - (constant float (1.5707963))
|
||||
((return (expression float - (constant float (1.5707964))
|
||||
(call asin ((var_ref x)))))))
|
||||
(signature vec2
|
||||
(parameters
|
||||
(declare (in) vec2 x))
|
||||
((return (expression vec2 - (constant float (1.5707963))
|
||||
((return (expression vec2 - (constant float (1.5707964))
|
||||
(call asin ((var_ref x)))))))
|
||||
(signature vec3
|
||||
(parameters
|
||||
(declare (in) vec3 x))
|
||||
((return (expression vec3 - (constant float (1.5707963))
|
||||
((return (expression vec3 - (constant float (1.5707964))
|
||||
(call asin ((var_ref x)))))))
|
||||
(signature vec4
|
||||
(parameters
|
||||
(declare (in) vec4 x))
|
||||
((return (expression vec4 - (constant float (1.5707963))
|
||||
((return (expression vec4 - (constant float (1.5707964))
|
||||
(call asin ((var_ref x)))))))
|
||||
))
|
||||
|
@@ -54,7 +54,7 @@ def get_txs_dim(sampler_type):
|
||||
def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0):
|
||||
coord_dim = get_coord_dim(sampler_type)
|
||||
extra_dim = get_extra_dim(sampler_type, variant & Proj, unused_fields)
|
||||
offset_dim = get_sampler_dim(sampler_type)
|
||||
sampler_dim = get_sampler_dim(sampler_type)
|
||||
|
||||
if variant & Single:
|
||||
return_type = "float"
|
||||
@@ -74,12 +74,12 @@ def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0):
|
||||
elif tex_inst == "txf" or tex_inst == "txs":
|
||||
print "\n (declare (in) int lod)",
|
||||
elif tex_inst == "txd":
|
||||
grad_type = vec_type("", coord_dim)
|
||||
grad_type = vec_type("", sampler_dim)
|
||||
print "\n (declare (in) " + grad_type + " dPdx)",
|
||||
print "\n (declare (in) " + grad_type + " dPdy)",
|
||||
|
||||
if variant & Offset:
|
||||
print "\n (declare (const_in) " + vec_type("i", offset_dim) + " offset)",
|
||||
print "\n (declare (const_in) " + vec_type("i", sampler_dim) + " offset)",
|
||||
if tex_inst == "txb":
|
||||
print "\n (declare (in) float bias)",
|
||||
|
||||
|
@@ -1158,7 +1158,6 @@ public:
|
||||
{
|
||||
this->ir_type = ir_type_loop_jump;
|
||||
this->mode = mode;
|
||||
this->loop = loop;
|
||||
}
|
||||
|
||||
virtual ir_loop_jump *clone(void *mem_ctx, struct hash_table *) const;
|
||||
@@ -1182,9 +1181,6 @@ public:
|
||||
|
||||
/** Mode selector for the jump instruction. */
|
||||
enum jump_mode mode;
|
||||
private:
|
||||
/** Loop containing this break instruction. */
|
||||
ir_loop *loop;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -633,13 +633,13 @@ ir_expression::constant_expression_value()
|
||||
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];
|
||||
data.b[c] = op[0]->value.u[c] < op[1]->value.u[c];
|
||||
break;
|
||||
case GLSL_TYPE_INT:
|
||||
data.b[0] = op[0]->value.i[0] < op[1]->value.i[0];
|
||||
data.b[c] = op[0]->value.i[c] < op[1]->value.i[c];
|
||||
break;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
data.b[0] = op[0]->value.f[0] < op[1]->value.f[0];
|
||||
data.b[c] = op[0]->value.f[c] < op[1]->value.f[c];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
@@ -669,13 +669,13 @@ ir_expression::constant_expression_value()
|
||||
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];
|
||||
data.b[c] = op[0]->value.u[c] <= op[1]->value.u[c];
|
||||
break;
|
||||
case GLSL_TYPE_INT:
|
||||
data.b[0] = op[0]->value.i[0] <= op[1]->value.i[0];
|
||||
data.b[c] = op[0]->value.i[c] <= op[1]->value.i[c];
|
||||
break;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
data.b[0] = op[0]->value.f[0] <= op[1]->value.f[0];
|
||||
data.b[c] = op[0]->value.f[c] <= op[1]->value.f[c];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
@@ -687,13 +687,13 @@ ir_expression::constant_expression_value()
|
||||
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];
|
||||
data.b[c] = op[0]->value.u[c] >= op[1]->value.u[c];
|
||||
break;
|
||||
case GLSL_TYPE_INT:
|
||||
data.b[0] = op[0]->value.i[0] >= op[1]->value.i[0];
|
||||
data.b[c] = op[0]->value.i[c] >= op[1]->value.i[c];
|
||||
break;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
data.b[0] = op[0]->value.f[0] >= op[1]->value.f[0];
|
||||
data.b[c] = op[0]->value.f[c] >= op[1]->value.f[c];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
|
@@ -174,8 +174,7 @@ private:
|
||||
if (this->map->get(id, name))
|
||||
return;
|
||||
|
||||
char *key = strdup(name);
|
||||
this->map->put(this->num_active_uniforms, key);
|
||||
this->map->put(this->num_active_uniforms, name);
|
||||
|
||||
/* Each leaf uniform occupies one entry in the list of active
|
||||
* uniforms.
|
||||
|
@@ -2263,7 +2263,9 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
if (ctx->ShaderCompilerOptions[i].LowerClipDistance)
|
||||
lower_clip_distance(prog->_LinkedShaders[i]->ir);
|
||||
|
||||
while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, false, 32))
|
||||
unsigned max_unroll = ctx->ShaderCompilerOptions[i].MaxUnrollIterations;
|
||||
|
||||
while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, false, max_unroll))
|
||||
;
|
||||
}
|
||||
|
||||
|
@@ -110,6 +110,8 @@ public:
|
||||
virtual ir_visitor_status visit(ir_loop_jump *);
|
||||
virtual ir_visitor_status visit(ir_dereference_variable *);
|
||||
|
||||
virtual ir_visitor_status visit_enter(ir_call *);
|
||||
|
||||
virtual ir_visitor_status visit_enter(ir_loop *);
|
||||
virtual ir_visitor_status visit_leave(ir_loop *);
|
||||
virtual ir_visitor_status visit_enter(ir_assignment *);
|
||||
@@ -152,6 +154,21 @@ loop_analysis::visit(ir_loop_jump *ir)
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
loop_analysis::visit_enter(ir_call *ir)
|
||||
{
|
||||
/* If we're not somewhere inside a loop, there's nothing to do. */
|
||||
if (this->state.is_empty())
|
||||
return visit_continue;
|
||||
|
||||
loop_variable_state *const ls =
|
||||
(loop_variable_state *) this->state.get_head();
|
||||
|
||||
ls->contains_calls = true;
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
loop_analysis::visit(ir_dereference_variable *ir)
|
||||
{
|
||||
@@ -209,6 +226,17 @@ loop_analysis::visit_leave(ir_loop *ir)
|
||||
loop_variable_state *const ls =
|
||||
(loop_variable_state *) this->state.pop_head();
|
||||
|
||||
/* Function calls may contain side effects. These could alter any of our
|
||||
* variables in ways that cannot be known, and may even terminate shader
|
||||
* execution (say, calling discard in the fragment shader). So we can't
|
||||
* rely on any of our analysis about assignments to variables.
|
||||
*
|
||||
* We could perform some conservative analysis (prove there's no statically
|
||||
* possible assignment, etc.) but it isn't worth it for now; function
|
||||
* inlining will allow us to unroll loops anyway.
|
||||
*/
|
||||
if (ls->contains_calls)
|
||||
return visit_continue;
|
||||
|
||||
foreach_list(node, &ir->body_instructions) {
|
||||
/* Skip over declarations at the start of a loop.
|
||||
|
@@ -122,10 +122,16 @@ public:
|
||||
*/
|
||||
unsigned num_loop_jumps;
|
||||
|
||||
/**
|
||||
* Whether this loop contains any function calls.
|
||||
*/
|
||||
bool contains_calls;
|
||||
|
||||
loop_variable_state()
|
||||
{
|
||||
this->max_iterations = -1;
|
||||
this->num_loop_jumps = 0;
|
||||
this->contains_calls = false;
|
||||
this->var_hash = hash_table_ctor(0, hash_table_pointer_hash,
|
||||
hash_table_pointer_compare);
|
||||
}
|
||||
@@ -134,6 +140,23 @@ public:
|
||||
{
|
||||
hash_table_dtor(this->var_hash);
|
||||
}
|
||||
|
||||
static void* operator new(size_t size, void *ctx)
|
||||
{
|
||||
void *lvs = ralloc_size(ctx, size);
|
||||
assert(lvs != NULL);
|
||||
|
||||
ralloc_set_destructor(lvs, (void (*)(void*)) destructor);
|
||||
|
||||
return lvs;
|
||||
}
|
||||
|
||||
private:
|
||||
static void
|
||||
destructor(loop_variable_state *lvs)
|
||||
{
|
||||
lvs->~loop_variable_state();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@@ -56,6 +56,7 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
|
||||
{
|
||||
loop_variable_state *const ls = this->state->get(ir);
|
||||
int iterations;
|
||||
unsigned ir_count;
|
||||
|
||||
/* If we've entered a loop that hasn't been analyzed, something really,
|
||||
* really bad has happened.
|
||||
@@ -78,6 +79,20 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
|
||||
if (iterations > (int) max_iterations)
|
||||
return visit_continue;
|
||||
|
||||
/* Don't try to unroll nested loops and loops with a huge body.
|
||||
*/
|
||||
ir_count = 0;
|
||||
foreach_list(node, &ir->body_instructions) {
|
||||
++ir_count;
|
||||
|
||||
/* If the loop body gets to huge, do not unroll. */
|
||||
if (5*max_iterations < ir_count*iterations)
|
||||
return visit_continue;
|
||||
/* Do not unroll loops with child loop nodes. */
|
||||
if (((ir_instruction *) node)->as_loop())
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
if (ls->num_loop_jumps > 1)
|
||||
return visit_continue;
|
||||
else if (ls->num_loop_jumps) {
|
||||
|
@@ -278,7 +278,7 @@ ralloc_parent(const void *ptr)
|
||||
return NULL;
|
||||
|
||||
info = get_header(ptr);
|
||||
return PTR_FROM_HEADER(info->parent);
|
||||
return info->parent ? PTR_FROM_HEADER(info->parent) : NULL;
|
||||
}
|
||||
|
||||
static void *autofree_context = NULL;
|
||||
|
@@ -44,7 +44,8 @@
|
||||
double
|
||||
glsl_strtod(const char *s, char **end)
|
||||
{
|
||||
#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
|
||||
#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \
|
||||
!defined(__HAIKU__)
|
||||
static locale_t loc = NULL;
|
||||
if (!loc) {
|
||||
loc = newlocale(LC_CTYPE_MASK, "C", NULL);
|
||||
|
@@ -90,7 +90,7 @@ Mapdesc::setBboxsize( INREAL *mat )
|
||||
void
|
||||
Mapdesc::identify( REAL dest[MAXCOORDS][MAXCOORDS] )
|
||||
{
|
||||
memset( dest, 0, sizeof( dest ) );
|
||||
memset( dest, 0, sizeof( REAL ) * MAXCOORDS * MAXCOORDS );
|
||||
for( int i=0; i != hcoords; i++ )
|
||||
dest[i][i] = 1.0;
|
||||
}
|
||||
|
@@ -505,7 +505,7 @@ NurbsTessellator::do_pwlcurve( O_pwlcurve *o_pwlcurve )
|
||||
o_pwlcurve->owner = currentCurve;
|
||||
}
|
||||
|
||||
if( (inCurve == 2) )
|
||||
if( inCurve == 2 )
|
||||
endcurve();
|
||||
}
|
||||
|
||||
|
@@ -26,6 +26,7 @@ SOURCES = \
|
||||
apple_glx.c \
|
||||
apple_glx_context.c \
|
||||
apple_glx_drawable.c \
|
||||
apple_glx_log.c \
|
||||
apple_glx_pbuffer.c \
|
||||
apple_glx_pixmap.c \
|
||||
apple_glx_surface.c \
|
||||
@@ -35,6 +36,7 @@ SOURCES = \
|
||||
apple_xgl_api_stereo.c \
|
||||
apple_xgl_api_viewport.c \
|
||||
appledri.c \
|
||||
../create_context.c \
|
||||
../clientattrib.c \
|
||||
../compsize.c \
|
||||
../glxconfig.c \
|
||||
|
@@ -33,6 +33,8 @@
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <dlfcn.h>
|
||||
#include <pthread.h>
|
||||
#include <inttypes.h>
|
||||
#include "appledri.h"
|
||||
#include "apple_glx.h"
|
||||
#include "apple_glx_context.h"
|
||||
@@ -43,22 +45,6 @@ static int dri_event_base = 0;
|
||||
|
||||
const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
|
||||
|
||||
static bool diagnostic = false;
|
||||
|
||||
void
|
||||
apple_glx_diagnostic(const char *fmt, ...)
|
||||
{
|
||||
va_list vl;
|
||||
|
||||
if (diagnostic) {
|
||||
fprintf(stderr, "DIAG: ");
|
||||
|
||||
va_start(vl, fmt);
|
||||
vfprintf(stderr, fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
apple_get_dri_event_base(void)
|
||||
{
|
||||
@@ -125,10 +111,9 @@ apple_init_glx(Display * dpy)
|
||||
if (initialized)
|
||||
return false;
|
||||
|
||||
if (getenv("LIBGL_DIAGNOSTIC")) {
|
||||
printf("initializing libGL in %s\n", __func__);
|
||||
diagnostic = true;
|
||||
}
|
||||
apple_glx_log_init();
|
||||
|
||||
apple_glx_log(ASL_LEVEL_INFO, "Initializing libGL.");
|
||||
|
||||
apple_cgl_init();
|
||||
(void) apple_glx_get_client_id();
|
||||
|
@@ -38,7 +38,8 @@
|
||||
#define XP_NO_X_HEADERS
|
||||
#include <Xplugin.h>
|
||||
|
||||
void apple_glx_diagnostic(const char *fmt, ...);
|
||||
#include "apple_glx_log.h"
|
||||
|
||||
xp_client_id apple_glx_get_client_id(void);
|
||||
bool apple_init_glx(Display * dpy);
|
||||
void apple_glx_swap_buffers(void *ptr);
|
||||
|
@@ -421,7 +421,7 @@ apple_glx_make_current_context(Display * dpy, void *oldptr, void *ptr,
|
||||
*/
|
||||
|
||||
if (same_drawable && ac->is_current) {
|
||||
apple_glx_diagnostic("%s: same_drawable and ac->is_current\n");
|
||||
apple_glx_diagnostic("same_drawable and ac->is_current\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
#include "apple_glx.h"
|
||||
#include "apple_glx_context.h"
|
||||
#include "apple_glx_drawable.h"
|
||||
@@ -48,8 +49,8 @@ lock_drawables_list(void)
|
||||
err = pthread_mutex_lock(&drawables_lock);
|
||||
|
||||
if (err) {
|
||||
fprintf(stderr, "pthread_mutex_lock failure in %s: %d\n",
|
||||
__func__, err);
|
||||
fprintf(stderr, "pthread_mutex_lock failure in %s: %s\n",
|
||||
__func__, strerror(err));
|
||||
abort();
|
||||
}
|
||||
}
|
||||
@@ -62,8 +63,8 @@ unlock_drawables_list(void)
|
||||
err = pthread_mutex_unlock(&drawables_lock);
|
||||
|
||||
if (err) {
|
||||
fprintf(stderr, "pthread_mutex_unlock failure in %s: %d\n",
|
||||
__func__, err);
|
||||
fprintf(stderr, "pthread_mutex_unlock failure in %s: %s\n",
|
||||
__func__, strerror(err));
|
||||
abort();
|
||||
}
|
||||
}
|
||||
@@ -95,7 +96,7 @@ drawable_lock(struct apple_glx_drawable *agd)
|
||||
err = pthread_mutex_lock(&agd->mutex);
|
||||
|
||||
if (err) {
|
||||
fprintf(stderr, "pthread_mutex_lock error: %d\n", err);
|
||||
fprintf(stderr, "pthread_mutex_lock error: %s\n", strerror(err));
|
||||
abort();
|
||||
}
|
||||
}
|
||||
@@ -108,7 +109,7 @@ drawable_unlock(struct apple_glx_drawable *d)
|
||||
err = pthread_mutex_unlock(&d->mutex);
|
||||
|
||||
if (err) {
|
||||
fprintf(stderr, "pthread_mutex_unlock error: %d\n", err);
|
||||
fprintf(stderr, "pthread_mutex_unlock error: %s\n", strerror(err));
|
||||
abort();
|
||||
}
|
||||
}
|
||||
@@ -135,6 +136,7 @@ release_drawable(struct apple_glx_drawable *d)
|
||||
static bool
|
||||
destroy_drawable(struct apple_glx_drawable *d)
|
||||
{
|
||||
int err;
|
||||
|
||||
d->lock(d);
|
||||
|
||||
@@ -172,6 +174,15 @@ destroy_drawable(struct apple_glx_drawable *d)
|
||||
|
||||
apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d);
|
||||
|
||||
/* Stupid recursive locks */
|
||||
while (pthread_mutex_unlock(&d->mutex) == 0);
|
||||
|
||||
err = pthread_mutex_destroy(&d->mutex);
|
||||
if (err) {
|
||||
fprintf(stderr, "pthread_mutex_destroy error: %s\n", strerror(err));
|
||||
abort();
|
||||
}
|
||||
|
||||
free(d);
|
||||
|
||||
/* So that the locks are balanced and the caller correctly unlocks. */
|
||||
@@ -238,7 +249,7 @@ common_init(Display * dpy, GLXDrawable drawable, struct apple_glx_drawable *d)
|
||||
err = pthread_mutexattr_init(&attr);
|
||||
|
||||
if (err) {
|
||||
fprintf(stderr, "pthread_mutexattr_init error: %d\n", err);
|
||||
fprintf(stderr, "pthread_mutexattr_init error: %s\n", strerror(err));
|
||||
abort();
|
||||
}
|
||||
|
||||
@@ -250,14 +261,14 @@ common_init(Display * dpy, GLXDrawable drawable, struct apple_glx_drawable *d)
|
||||
err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||
|
||||
if (err) {
|
||||
fprintf(stderr, "error: setting pthread mutex type: %d\n", err);
|
||||
fprintf(stderr, "error: setting pthread mutex type: %s\n", strerror(err));
|
||||
abort();
|
||||
}
|
||||
|
||||
err = pthread_mutex_init(&d->mutex, &attr);
|
||||
|
||||
if (err) {
|
||||
fprintf(stderr, "pthread_mutex_init error: %d\n", err);
|
||||
fprintf(stderr, "pthread_mutex_init error: %s\n", strerror(err));
|
||||
abort();
|
||||
}
|
||||
|
||||
|
128
src/glx/apple/apple_glx_log.c
Normal file
128
src/glx/apple/apple_glx_log.c
Normal file
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Apple Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
* and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
|
||||
* HOLDER(S) 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.
|
||||
*
|
||||
* Except as contained in this notice, the name(s) of the above
|
||||
* copyright holders shall not be used in advertising or otherwise to
|
||||
* promote the sale, use or other dealings in this Software without
|
||||
* prior written authorization.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <asl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#include <pthread.h>
|
||||
#include "apple_glx_log.h"
|
||||
|
||||
static bool diagnostic = false;
|
||||
static aslclient aslc;
|
||||
|
||||
void apple_glx_log_init(void) {
|
||||
if (getenv("LIBGL_DIAGNOSTIC")) {
|
||||
diagnostic = true;
|
||||
}
|
||||
|
||||
aslc = asl_open(NULL, NULL, 0);
|
||||
}
|
||||
|
||||
void _apple_glx_log(int level, const char *file, const char *function,
|
||||
int line, const char *fmt, ...) {
|
||||
va_list v;
|
||||
va_start(v, fmt);
|
||||
_apple_glx_vlog(level, file, function, line, fmt, v);
|
||||
va_end(v);
|
||||
}
|
||||
|
||||
static const char *
|
||||
_asl_level_string(int level)
|
||||
{
|
||||
if (level == ASL_LEVEL_EMERG) return ASL_STRING_EMERG;
|
||||
if (level == ASL_LEVEL_ALERT) return ASL_STRING_ALERT;
|
||||
if (level == ASL_LEVEL_CRIT) return ASL_STRING_CRIT;
|
||||
if (level == ASL_LEVEL_ERR) return ASL_STRING_ERR;
|
||||
if (level == ASL_LEVEL_WARNING) return ASL_STRING_WARNING;
|
||||
if (level == ASL_LEVEL_NOTICE) return ASL_STRING_NOTICE;
|
||||
if (level == ASL_LEVEL_INFO) return ASL_STRING_INFO;
|
||||
if (level == ASL_LEVEL_DEBUG) return ASL_STRING_DEBUG;
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
void _apple_glx_vlog(int level, const char *file, const char *function,
|
||||
int line, const char *fmt, va_list args) {
|
||||
aslmsg msg;
|
||||
uint64_t thread = 0;
|
||||
|
||||
if (pthread_is_threaded_np()) {
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
|
||||
thread = (uint64_t)(uintptr_t)pthread_self();
|
||||
#elif MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||
if (&pthread_threadid_np) {
|
||||
pthread_threadid_np(NULL, &thread);
|
||||
} else {
|
||||
thread = (uint64_t)(uintptr_t)pthread_self();
|
||||
}
|
||||
#else
|
||||
pthread_threadid_np(NULL, &thread);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (diagnostic) {
|
||||
va_list args2;
|
||||
va_copy(args2, args);
|
||||
|
||||
fprintf(stderr, "%-9s %24s:%-4d %s(%"PRIu64"): ",
|
||||
_asl_level_string(level), file, line, function, thread);
|
||||
vfprintf(stderr, fmt, args2);
|
||||
}
|
||||
|
||||
msg = asl_new(ASL_TYPE_MSG);
|
||||
if (msg) {
|
||||
if (file)
|
||||
asl_set(msg, "File", file);
|
||||
if (function)
|
||||
asl_set(msg, "Function", function);
|
||||
if (line) {
|
||||
char *_line;
|
||||
asprintf(&_line, "%d", line);
|
||||
if (_line) {
|
||||
asl_set(msg, "Line", _line);
|
||||
free(_line);
|
||||
}
|
||||
}
|
||||
if (pthread_is_threaded_np()) {
|
||||
char *_thread;
|
||||
asprintf(&_thread, "%"PRIu64, thread);
|
||||
if (_thread) {
|
||||
asl_set(msg, "Thread", _thread);
|
||||
free(_thread);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
asl_vlog(aslc, msg, level, fmt, args);
|
||||
if (msg)
|
||||
asl_free(msg);
|
||||
}
|
57
src/glx/apple/apple_glx_log.h
Normal file
57
src/glx/apple/apple_glx_log.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Apple Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
* and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
|
||||
* HOLDER(S) 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.
|
||||
*
|
||||
* Except as contained in this notice, the name(s) of the above
|
||||
* copyright holders shall not be used in advertising or otherwise to
|
||||
* promote the sale, use or other dealings in this Software without
|
||||
* prior written authorization.
|
||||
*/
|
||||
|
||||
#ifndef APPLE_GLX_LOG_H
|
||||
#define APPLE_GLX_LOG_H
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <asl.h>
|
||||
|
||||
void apple_glx_log_init(void);
|
||||
|
||||
__printflike(5, 6)
|
||||
void _apple_glx_log(int level, const char *file, const char *function,
|
||||
int line, const char *fmt, ...);
|
||||
#define apple_glx_log(l, f, args ...) \
|
||||
_apple_glx_log(l, __FILE__, __FUNCTION__, __LINE__, f, ## args)
|
||||
|
||||
|
||||
__printflike(5, 0)
|
||||
void _apple_glx_vlog(int level, const char *file, const char *function,
|
||||
int line, const char *fmt, va_list v);
|
||||
#define apple_glx_vlog(l, f, v) \
|
||||
_apple_glx_vlog(l, __FILE__, __FUNCTION__, __LINE__, f, v)
|
||||
|
||||
/* This is just here to help the transition.
|
||||
* TODO: Replace calls to apple_glx_diagnostic
|
||||
*/
|
||||
#define apple_glx_diagnostic(f, args ...) \
|
||||
apple_glx_log(ASL_LEVEL_DEBUG, f, ## args)
|
||||
|
||||
#endif
|
@@ -206,6 +206,7 @@ apple_glx_surface_destroy(unsigned int uid)
|
||||
if (d) {
|
||||
d->types.surface.pending_destroy = true;
|
||||
d->release(d);
|
||||
|
||||
/*
|
||||
* We release 2 references to the surface. One was acquired by
|
||||
* the find, and the other was leftover from a context, or
|
||||
@@ -216,8 +217,9 @@ apple_glx_surface_destroy(unsigned int uid)
|
||||
* to actually destroy it when the pending_destroy is processed
|
||||
* by a glViewport callback (see apple_glx_context_update()).
|
||||
*/
|
||||
d->destroy(d);
|
||||
|
||||
d->unlock(d);
|
||||
if (!d->destroy(d)) {
|
||||
/* apple_glx_drawable_find_by_uid returns a locked drawable */
|
||||
d->unlock(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -71,6 +71,7 @@ __glElementsPerGroup(GLenum format, GLenum type)
|
||||
case GL_422_REV_EXT:
|
||||
case GL_422_AVERAGE_EXT:
|
||||
case GL_422_REV_AVERAGE_EXT:
|
||||
case GL_DEPTH_STENCIL_NV:
|
||||
case GL_YCBCR_422_APPLE:
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
return 2;
|
||||
|
@@ -80,8 +80,13 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
|
||||
&dummy_err);
|
||||
}
|
||||
|
||||
if (gc == NULL)
|
||||
if (gc == NULL) {
|
||||
#ifdef GLX_USE_APPLEGL
|
||||
gc = applegl_create_context(psc, cfg, share, 0);
|
||||
#else
|
||||
gc = indirect_create_context(psc, cfg, share, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
gc->xid = xcb_generate_id(c);
|
||||
gc->share_xid = (share != NULL) ? share->xid : 0;
|
||||
|
@@ -91,6 +91,9 @@ XCreateDrawable(struct drisw_drawable * pdp,
|
||||
visMask = VisualIDMask;
|
||||
pdp->visinfo = XGetVisualInfo(dpy, visMask, &visTemp, &num_visuals);
|
||||
|
||||
if (!pdp->visinfo || num_visuals == 0)
|
||||
return False;
|
||||
|
||||
/* create XImage */
|
||||
pdp->ximage = XCreateImage(dpy,
|
||||
pdp->visinfo->visual,
|
||||
@@ -513,7 +516,7 @@ driswCreateDrawable(struct glx_screen *base, XID xDrawable,
|
||||
struct drisw_drawable *pdp;
|
||||
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes;
|
||||
struct drisw_screen *psc = (struct drisw_screen *) base;
|
||||
|
||||
Bool ret;
|
||||
const __DRIswrastExtension *swrast = psc->swrast;
|
||||
|
||||
pdp = Xmalloc(sizeof(*pdp));
|
||||
@@ -525,7 +528,11 @@ driswCreateDrawable(struct glx_screen *base, XID xDrawable,
|
||||
pdp->base.drawable = drawable;
|
||||
pdp->base.psc = &psc->base;
|
||||
|
||||
XCreateDrawable(pdp, psc->base.dpy, xDrawable, modes->visualID);
|
||||
ret = XCreateDrawable(pdp, psc->base.dpy, xDrawable, modes->visualID);
|
||||
if (!ret) {
|
||||
Xfree(pdp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Create a new drawable */
|
||||
pdp->driDrawable =
|
||||
|
@@ -293,6 +293,9 @@ QueryVersion(Display * dpy, int opcode, int *major, int *minor)
|
||||
GLX_MINOR_VERSION),
|
||||
NULL);
|
||||
|
||||
if (!reply)
|
||||
return GL_FALSE;
|
||||
|
||||
if (reply->major_version != GLX_MAJOR_VERSION) {
|
||||
free(reply);
|
||||
return GL_FALSE;
|
||||
|
@@ -105,7 +105,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) {
|
||||
|
||||
struct _glapi_table *
|
||||
_glapi_create_table_from_handle(void *handle, const char *symbol_prefix) {
|
||||
struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table));
|
||||
struct _glapi_table *disp = calloc(_glapi_get_dispatch_table_size(), sizeof(void *));
|
||||
char symboln[512];
|
||||
|
||||
if(!disp)
|
||||
|
@@ -315,6 +315,10 @@ struct gl_meta_state
|
||||
struct drawtex_state DrawTex; /**< For _mesa_meta_DrawTex() */
|
||||
};
|
||||
|
||||
static void meta_glsl_blit_cleanup(struct gl_context *ctx, struct blit_state *blit);
|
||||
static void cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex);
|
||||
static void meta_glsl_clear_cleanup(struct gl_context *ctx, struct clear_state *clear);
|
||||
|
||||
static GLuint
|
||||
compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB *source)
|
||||
{
|
||||
@@ -331,12 +335,16 @@ compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB
|
||||
return shader;
|
||||
|
||||
_mesa_GetShaderiv(shader, GL_INFO_LOG_LENGTH, &size);
|
||||
if (size == 0)
|
||||
if (size == 0) {
|
||||
_mesa_DeleteObjectARB(shader);
|
||||
return 0;
|
||||
}
|
||||
|
||||
info = malloc(size);
|
||||
if (!info)
|
||||
if (!info) {
|
||||
_mesa_DeleteObjectARB(shader);
|
||||
return 0;
|
||||
}
|
||||
|
||||
_mesa_GetProgramInfoLog(shader, size, NULL, info);
|
||||
_mesa_problem(ctx,
|
||||
@@ -345,6 +353,7 @@ compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB
|
||||
info, source);
|
||||
|
||||
free(info);
|
||||
_mesa_DeleteObjectARB(shader);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -397,10 +406,15 @@ _mesa_meta_init(struct gl_context *ctx)
|
||||
void
|
||||
_mesa_meta_free(struct gl_context *ctx)
|
||||
{
|
||||
/* Note: Any textures, VBOs, etc, that we allocate should get
|
||||
* freed by the normal context destruction code. But this would be
|
||||
* the place to free other meta data someday.
|
||||
*/
|
||||
GET_CURRENT_CONTEXT(old_context);
|
||||
_mesa_make_current(ctx, NULL, NULL);
|
||||
meta_glsl_blit_cleanup(ctx, &ctx->Meta->Blit);
|
||||
meta_glsl_clear_cleanup(ctx, &ctx->Meta->Clear);
|
||||
cleanup_temp_texture(ctx, &ctx->Meta->TempTex);
|
||||
if (old_context)
|
||||
_mesa_make_current(old_context, old_context->WinSysDrawBuffer, old_context->WinSysReadBuffer);
|
||||
else
|
||||
_mesa_make_current(NULL, NULL, NULL);
|
||||
free(ctx->Meta);
|
||||
ctx->Meta = NULL;
|
||||
}
|
||||
@@ -1056,6 +1070,15 @@ init_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
|
||||
_mesa_GenTextures(1, &tex->TexObj);
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
|
||||
{
|
||||
if (!tex->TexObj)
|
||||
return;
|
||||
_mesa_DeleteTextures(1, &tex->TexObj);
|
||||
tex->TexObj = 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return pointer to temp_texture info for non-bitmap ops.
|
||||
@@ -1592,6 +1615,21 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_glsl_blit_cleanup(struct gl_context *ctx, struct blit_state *blit)
|
||||
{
|
||||
if (blit->ArrayObj) {
|
||||
_mesa_DeleteVertexArraysAPPLE(1, &blit->ArrayObj);
|
||||
blit->ArrayObj = 0;
|
||||
_mesa_DeleteBuffersARB(1, &blit->VBO);
|
||||
blit->VBO = 0;
|
||||
}
|
||||
if (blit->DepthFP) {
|
||||
_mesa_DeletePrograms(1, &blit->DepthFP);
|
||||
blit->DepthFP = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Meta implementation of ctx->Driver.Clear() in terms of polygon rendering.
|
||||
@@ -1774,7 +1812,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
|
||||
|
||||
clear->ShaderProg = _mesa_CreateProgramObjectARB();
|
||||
_mesa_AttachShader(clear->ShaderProg, fs);
|
||||
_mesa_DeleteObjectARB(fs);
|
||||
_mesa_AttachShader(clear->ShaderProg, vs);
|
||||
_mesa_DeleteObjectARB(vs);
|
||||
_mesa_BindAttribLocationARB(clear->ShaderProg, 0, "position");
|
||||
_mesa_LinkProgramARB(clear->ShaderProg);
|
||||
|
||||
@@ -1787,7 +1827,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
|
||||
|
||||
clear->IntegerShaderProg = _mesa_CreateProgramObjectARB();
|
||||
_mesa_AttachShader(clear->IntegerShaderProg, fs);
|
||||
_mesa_DeleteObjectARB(fs);
|
||||
_mesa_AttachShader(clear->IntegerShaderProg, vs);
|
||||
_mesa_DeleteObjectARB(vs);
|
||||
_mesa_BindAttribLocationARB(clear->IntegerShaderProg, 0, "position");
|
||||
|
||||
/* Note that user-defined out attributes get automatically assigned
|
||||
@@ -1802,6 +1844,24 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_glsl_clear_cleanup(struct gl_context *ctx, struct clear_state *clear)
|
||||
{
|
||||
if (clear->ArrayObj == 0)
|
||||
return;
|
||||
_mesa_DeleteVertexArraysAPPLE(1, &clear->ArrayObj);
|
||||
clear->ArrayObj = 0;
|
||||
_mesa_DeleteBuffersARB(1, &clear->VBO);
|
||||
clear->VBO = 0;
|
||||
_mesa_DeleteObjectARB(clear->ShaderProg);
|
||||
clear->ShaderProg = 0;
|
||||
|
||||
if (clear->IntegerShaderProg) {
|
||||
_mesa_DeleteObjectARB(clear->IntegerShaderProg);
|
||||
clear->IntegerShaderProg = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta implementation of ctx->Driver.Clear() in terms of polygon rendering.
|
||||
*/
|
||||
@@ -3256,6 +3316,7 @@ decompress_texture_image(struct gl_context *ctx,
|
||||
};
|
||||
struct vertex verts[4];
|
||||
GLuint fboDrawSave, fboReadSave;
|
||||
GLuint rbSave;
|
||||
|
||||
if (slice > 0) {
|
||||
assert(target == GL_TEXTURE_3D ||
|
||||
@@ -3272,6 +3333,7 @@ decompress_texture_image(struct gl_context *ctx,
|
||||
/* save fbo bindings (not saved by _mesa_meta_begin()) */
|
||||
fboDrawSave = ctx->DrawBuffer->Name;
|
||||
fboReadSave = ctx->ReadBuffer->Name;
|
||||
rbSave = ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0;
|
||||
|
||||
_mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_PIXEL_STORE);
|
||||
|
||||
@@ -3292,6 +3354,7 @@ decompress_texture_image(struct gl_context *ctx,
|
||||
|
||||
/* alloc dest surface */
|
||||
if (width > decompress->Width || height > decompress->Height) {
|
||||
_mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, decompress->RBO);
|
||||
_mesa_RenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA,
|
||||
width, height);
|
||||
decompress->Width = width;
|
||||
@@ -3424,6 +3487,7 @@ decompress_texture_image(struct gl_context *ctx,
|
||||
_mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fboDrawSave);
|
||||
_mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fboReadSave);
|
||||
}
|
||||
_mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, rbSave);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -6,5 +6,11 @@
|
||||
<application executable="Tropics">
|
||||
<option name="force_glsl_extensions_warn" value="true" />
|
||||
</application>
|
||||
<application executable="heaven_x86">
|
||||
<option name="force_glsl_extensions_warn" value="true" />
|
||||
</application>
|
||||
<application executable="heaven_x64">
|
||||
<option name="force_glsl_extensions_warn" value="true" />
|
||||
</application>
|
||||
</device>
|
||||
</driconf>
|
||||
|
@@ -436,7 +436,10 @@ i830DepthMask(struct gl_context * ctx, GLboolean flag)
|
||||
struct i830_context *i830 = i830_context(ctx);
|
||||
|
||||
DBG("%s flag (%d)\n", __FUNCTION__, flag);
|
||||
|
||||
|
||||
if (!ctx->DrawBuffer || !ctx->DrawBuffer->Visual.depthBits)
|
||||
flag = false;
|
||||
|
||||
I830_STATECHANGE(i830, I830_UPLOAD_CTX);
|
||||
|
||||
i830->state.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK;
|
||||
@@ -473,7 +476,7 @@ static void
|
||||
i830PolygonStipple(struct gl_context * ctx, const GLubyte * mask)
|
||||
{
|
||||
struct i830_context *i830 = i830_context(ctx);
|
||||
const GLubyte *m = mask;
|
||||
const GLubyte *m;
|
||||
GLubyte p[4];
|
||||
int i, j, k;
|
||||
int active = (ctx->Polygon.StippleFlag &&
|
||||
@@ -485,6 +488,12 @@ i830PolygonStipple(struct gl_context * ctx, const GLubyte * mask)
|
||||
i830->state.Stipple[I830_STPREG_ST1] &= ~ST1_ENABLE;
|
||||
}
|
||||
|
||||
/* Use the already unpacked stipple data from the context rather than the
|
||||
* uninterpreted mask passed in.
|
||||
*/
|
||||
mask = (const GLubyte *)ctx->PolygonStipple;
|
||||
m = mask;
|
||||
|
||||
p[0] = mask[12] & 0xf;
|
||||
p[0] |= p[0] << 4;
|
||||
p[1] = mask[8] & 0xf;
|
||||
@@ -795,6 +804,9 @@ i830Enable(struct gl_context * ctx, GLenum cap, GLboolean state)
|
||||
I830_STATECHANGE(i830, I830_UPLOAD_CTX);
|
||||
i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_DEPTH_TEST_MASK;
|
||||
|
||||
if (!ctx->DrawBuffer || !ctx->DrawBuffer->Visual.depthBits)
|
||||
state = false;
|
||||
|
||||
if (state)
|
||||
i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_DEPTH_TEST;
|
||||
else
|
||||
@@ -849,7 +861,7 @@ i830Enable(struct gl_context * ctx, GLenum cap, GLboolean state)
|
||||
if (ctx->DrawBuffer) {
|
||||
struct intel_renderbuffer *irbStencil
|
||||
= intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL);
|
||||
hw_stencil = (irbStencil && irbStencil->mt->region);
|
||||
hw_stencil = (irbStencil && irbStencil->mt);
|
||||
}
|
||||
if (hw_stencil) {
|
||||
I830_STATECHANGE(i830, I830_UPLOAD_CTX);
|
||||
|
@@ -692,8 +692,8 @@ i830_set_draw_region(struct intel_context *intel,
|
||||
state->Buffer[I830_DESTREG_DRAWRECT1] = 0;
|
||||
state->Buffer[I830_DESTREG_DRAWRECT2] = (draw_y << 16) | draw_x;
|
||||
state->Buffer[I830_DESTREG_DRAWRECT3] =
|
||||
((ctx->DrawBuffer->Width + draw_x) & 0xffff) |
|
||||
((ctx->DrawBuffer->Height + draw_y) << 16);
|
||||
((ctx->DrawBuffer->Width + draw_x - 1) & 0xffff) |
|
||||
((ctx->DrawBuffer->Height + draw_y - 1) << 16);
|
||||
state->Buffer[I830_DESTREG_DRAWRECT4] = (draw_y << 16) | draw_x;
|
||||
state->Buffer[I830_DESTREG_DRAWRECT5] = MI_NOOP;
|
||||
|
||||
@@ -826,8 +826,7 @@ i830_update_draw_buffer(struct intel_context *intel)
|
||||
/*
|
||||
* Update depth and stencil test state
|
||||
*/
|
||||
ctx->Driver.Enable(ctx, GL_DEPTH_TEST,
|
||||
(ctx->Depth.Test && fb->Visual.depthBits > 0));
|
||||
ctx->Driver.Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test);
|
||||
ctx->Driver.Enable(ctx, GL_STENCIL_TEST,
|
||||
(ctx->Stencil.Enabled && fb->Visual.stencilBits > 0));
|
||||
|
||||
|
@@ -76,6 +76,8 @@ i915InvalidateState(struct gl_context * ctx, GLuint new_state)
|
||||
i915_update_provoking_vertex(ctx);
|
||||
if (new_state & (_NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS))
|
||||
i915_update_program(ctx);
|
||||
if (new_state & (_NEW_PROGRAM | _NEW_POINT))
|
||||
i915_update_sprite_point_enable(ctx);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -40,6 +40,7 @@
|
||||
#define I915_FALLBACK_POINT_SMOOTH 0x80000
|
||||
#define I915_FALLBACK_POINT_SPRITE_COORD_ORIGIN 0x100000
|
||||
#define I915_FALLBACK_DRAW_OFFSET 0x200000
|
||||
#define I915_FALLBACK_COORD_REPLACE 0x400000
|
||||
|
||||
#define I915_UPLOAD_CTX 0x1
|
||||
#define I915_UPLOAD_BUFFERS 0x2
|
||||
@@ -338,6 +339,7 @@ extern void i915InitStateFunctions(struct dd_function_table *functions);
|
||||
extern void i915InitState(struct i915_context *i915);
|
||||
extern void i915_update_stencil(struct gl_context * ctx);
|
||||
extern void i915_update_provoking_vertex(struct gl_context *ctx);
|
||||
extern void i915_update_sprite_point_enable(struct gl_context *ctx);
|
||||
|
||||
|
||||
/*======================================================================
|
||||
|
@@ -1361,6 +1361,10 @@ i915ValidateFragmentProgram(struct i915_context *i915)
|
||||
EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, S4_VFMT_XYZ, 12);
|
||||
}
|
||||
|
||||
/* Handle gl_PointSize builtin var here */
|
||||
if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled)
|
||||
EMIT_ATTR(_TNL_ATTRIB_POINTSIZE, EMIT_1F, S4_VFMT_POINT_WIDTH, 4);
|
||||
|
||||
if (inputsRead & FRAG_BIT_COL0) {
|
||||
intel->coloroffset = offset / 4;
|
||||
EMIT_ATTR(_TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, S4_VFMT_COLOR, 4);
|
||||
|
@@ -652,6 +652,48 @@ i915PointParameterfv(struct gl_context * ctx, GLenum pname, const GLfloat *param
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
i915_update_sprite_point_enable(struct gl_context *ctx)
|
||||
{
|
||||
struct intel_context *intel = intel_context(ctx);
|
||||
/* _NEW_PROGRAM */
|
||||
struct i915_fragment_program *p =
|
||||
(struct i915_fragment_program *) ctx->FragmentProgram._Current;
|
||||
const GLbitfield64 inputsRead = p->FragProg.Base.InputsRead;
|
||||
struct i915_context *i915 = i915_context(ctx);
|
||||
GLuint s4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_VFMT_MASK;
|
||||
int i;
|
||||
GLuint coord_replace_bits = 0x0;
|
||||
GLuint tex_coord_unit_bits = 0x0;
|
||||
|
||||
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
|
||||
/* _NEW_POINT */
|
||||
if (ctx->Point.CoordReplace[i] && ctx->Point.PointSprite)
|
||||
coord_replace_bits |= (1 << i);
|
||||
if (inputsRead & FRAG_BIT_TEX(i))
|
||||
tex_coord_unit_bits |= (1 << i);
|
||||
}
|
||||
|
||||
/*
|
||||
* Here we can't enable the SPRITE_POINT_ENABLE bit when the mis-match
|
||||
* of tex_coord_unit_bits and coord_replace_bits, or this will make all
|
||||
* the other non-point-sprite coords(like varying inputs, as we now use
|
||||
* tex coord to implement varying inputs) be replaced to value (0, 0)-(1, 1).
|
||||
*
|
||||
* Thus, do fallback when needed.
|
||||
*/
|
||||
FALLBACK(intel, I915_FALLBACK_COORD_REPLACE,
|
||||
coord_replace_bits && coord_replace_bits != tex_coord_unit_bits);
|
||||
|
||||
s4 &= ~S4_SPRITE_POINT_ENABLE;
|
||||
s4 |= (coord_replace_bits && coord_replace_bits == tex_coord_unit_bits) ?
|
||||
S4_SPRITE_POINT_ENABLE : 0;
|
||||
if (s4 != i915->state.Ctx[I915_CTXREG_LIS4]) {
|
||||
i915->state.Ctx[I915_CTXREG_LIS4] = s4;
|
||||
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Color masks
|
||||
@@ -869,18 +911,7 @@ i915Enable(struct gl_context * ctx, GLenum cap, GLboolean state)
|
||||
break;
|
||||
|
||||
case GL_POINT_SPRITE:
|
||||
/* This state change is handled in i915_reduced_primitive_state because
|
||||
* the hardware bit should only be set when rendering points.
|
||||
*/
|
||||
dw = i915->state.Ctx[I915_CTXREG_LIS4];
|
||||
if (state)
|
||||
dw |= S4_SPRITE_POINT_ENABLE;
|
||||
else
|
||||
dw &= ~S4_SPRITE_POINT_ENABLE;
|
||||
if (dw != i915->state.Ctx[I915_CTXREG_LIS4]) {
|
||||
i915->state.Ctx[I915_CTXREG_LIS4] = dw;
|
||||
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
|
||||
}
|
||||
/* Handle it at i915_update_sprite_point_enable () */
|
||||
break;
|
||||
|
||||
case GL_POINT_SMOOTH:
|
||||
|
@@ -319,6 +319,28 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
|
||||
((wt != GL_CLAMP) && (wt != GL_CLAMP_TO_EDGE))))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* According to 3DSTATE_MAP_STATE at page of 104 in Bspec
|
||||
* Vol3d 3D Instructions:
|
||||
* [DevGDG and DevAlv]: Must be a power of 2 for cube maps.
|
||||
* [DevLPT, DevCST and DevBLB]: If not a power of 2, cube maps
|
||||
* must have all faces enabled.
|
||||
*
|
||||
* But, as I tested on pineview(DevBLB derived), the rendering is
|
||||
* bad(you will find the color isn't samplered right in some
|
||||
* fragments). After checking, it seems that the texture layout is
|
||||
* wrong: making the width and height align of 4(although this
|
||||
* doesn't make much sense) will fix this issue and also broke some
|
||||
* others. Well, Bspec mentioned nothing about the layout alignment
|
||||
* and layout for NPOT cube map. I guess the Bspec just assume it's
|
||||
* a POT cube map.
|
||||
*
|
||||
* Thus, I guess we need do this for other platforms as well.
|
||||
*/
|
||||
if (tObj->Target == GL_TEXTURE_CUBE_MAP_ARB &&
|
||||
!is_power_of_two(firstImage->Height))
|
||||
return false;
|
||||
|
||||
state[I915_TEXREG_SS3] = ss3; /* SS3_NORMALIZED_COORDS */
|
||||
|
||||
state[I915_TEXREG_SS3] |=
|
||||
|
@@ -665,12 +665,11 @@ i915_set_draw_region(struct intel_context *intel,
|
||||
|
||||
draw_offset = (draw_y << 16) | draw_x;
|
||||
|
||||
FALLBACK(intel, I915_FALLBACK_DRAW_OFFSET,
|
||||
(ctx->DrawBuffer->Width + draw_x > 2048) ||
|
||||
(ctx->DrawBuffer->Height + draw_y > 2048));
|
||||
/* When changing drawing rectangle offset, an MI_FLUSH is first required. */
|
||||
if (draw_offset != i915->last_draw_offset) {
|
||||
FALLBACK(intel, I915_FALLBACK_DRAW_OFFSET,
|
||||
(ctx->DrawBuffer->Width + draw_x > 2048) ||
|
||||
(ctx->DrawBuffer->Height + draw_y > 2048));
|
||||
|
||||
state->Buffer[I915_DESTREG_DRAWRECT0] = MI_FLUSH | INHIBIT_FLUSH_RENDER_CACHE;
|
||||
i915->last_draw_offset = draw_offset;
|
||||
} else
|
||||
|
@@ -119,13 +119,15 @@ intelDmaPrimitive(struct intel_context *intel, GLenum prim)
|
||||
intel_set_prim(intel, hw_prim[prim]);
|
||||
}
|
||||
|
||||
#define INTEL_NO_VBO_STATE_RESERVED 1500
|
||||
|
||||
static INLINE GLuint intel_get_vb_max(struct intel_context *intel)
|
||||
{
|
||||
GLuint ret;
|
||||
|
||||
if (intel->intelScreen->no_vbo)
|
||||
ret = sizeof(intel->batch.map) - 1500;
|
||||
else
|
||||
if (intel->intelScreen->no_vbo) {
|
||||
ret = intel->batch.bo->size - INTEL_NO_VBO_STATE_RESERVED;
|
||||
} else
|
||||
ret = INTEL_VB_SIZE;
|
||||
ret /= (intel->vertex_size * 4);
|
||||
return ret;
|
||||
@@ -133,11 +135,15 @@ static INLINE GLuint intel_get_vb_max(struct intel_context *intel)
|
||||
|
||||
static INLINE GLuint intel_get_current_max(struct intel_context *intel)
|
||||
{
|
||||
GLuint ret;
|
||||
|
||||
if (intel->intelScreen->no_vbo)
|
||||
return intel_get_vb_max(intel);
|
||||
else
|
||||
return (INTEL_VB_SIZE - intel->prim.current_offset) / (intel->vertex_size * 4);
|
||||
if (intel->intelScreen->no_vbo) {
|
||||
ret = intel_batchbuffer_space(intel);
|
||||
ret = ret <= INTEL_NO_VBO_STATE_RESERVED ? 0 : ret - INTEL_NO_VBO_STATE_RESERVED;
|
||||
} else
|
||||
ret = (INTEL_VB_SIZE - intel->prim.current_offset);
|
||||
|
||||
return ret / (intel->vertex_size * 4);
|
||||
}
|
||||
|
||||
#define LOCAL_VARS struct intel_context *intel = intel_context(ctx)
|
||||
|
@@ -1198,6 +1198,7 @@ static char *fallbackStrings[] = {
|
||||
[19] = "Smooth point",
|
||||
[20] = "point sprite coord origin",
|
||||
[21] = "depth/color drawing offset",
|
||||
[22] = "coord replace(SPRITE POINT ENABLE)",
|
||||
};
|
||||
|
||||
|
||||
|
@@ -290,6 +290,12 @@ typedef enum
|
||||
BRW_VERT_RESULT_NDC = VERT_RESULT_MAX,
|
||||
BRW_VERT_RESULT_HPOS_DUPLICATE,
|
||||
BRW_VERT_RESULT_PAD,
|
||||
/*
|
||||
* It's actually not a vert_result but just a _mark_ to let sf aware that
|
||||
* he need do something special to handle gl_PointCoord builtin variable
|
||||
* correctly. see compile_sf_prog() for more info.
|
||||
*/
|
||||
BRW_VERT_RESULT_PNTC,
|
||||
BRW_VERT_RESULT_MAX
|
||||
} brw_vert_result;
|
||||
|
||||
|
@@ -47,13 +47,13 @@ brw_swap_cmod(uint32_t cmod)
|
||||
case BRW_CONDITIONAL_NZ:
|
||||
return cmod;
|
||||
case BRW_CONDITIONAL_G:
|
||||
return BRW_CONDITIONAL_LE;
|
||||
case BRW_CONDITIONAL_GE:
|
||||
return BRW_CONDITIONAL_L;
|
||||
case BRW_CONDITIONAL_GE:
|
||||
return BRW_CONDITIONAL_LE;
|
||||
case BRW_CONDITIONAL_L:
|
||||
return BRW_CONDITIONAL_GE;
|
||||
case BRW_CONDITIONAL_LE:
|
||||
return BRW_CONDITIONAL_G;
|
||||
case BRW_CONDITIONAL_LE:
|
||||
return BRW_CONDITIONAL_GE;
|
||||
default:
|
||||
return ~0;
|
||||
}
|
||||
|
@@ -1048,6 +1048,7 @@ struct brw_instruction *brw_WHILE(struct brw_compile *p);
|
||||
struct brw_instruction *brw_BREAK(struct brw_compile *p);
|
||||
struct brw_instruction *brw_CONT(struct brw_compile *p);
|
||||
struct brw_instruction *gen6_CONT(struct brw_compile *p);
|
||||
struct brw_instruction *gen6_HALT(struct brw_compile *p);
|
||||
/* Forward jumps:
|
||||
*/
|
||||
void brw_land_fwd_jump(struct brw_compile *p, int jmp_insn_idx);
|
||||
|
@@ -1339,6 +1339,20 @@ struct brw_instruction *brw_CONT(struct brw_compile *p)
|
||||
return insn;
|
||||
}
|
||||
|
||||
struct brw_instruction *gen6_HALT(struct brw_compile *p)
|
||||
{
|
||||
struct brw_instruction *insn;
|
||||
|
||||
insn = next_insn(p, BRW_OPCODE_HALT);
|
||||
brw_set_dest(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
|
||||
brw_set_src0(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
|
||||
brw_set_src1(p, insn, brw_imm_d(0x0)); /* UIP and JIP, updated later. */
|
||||
|
||||
insn->header.compression_control = BRW_COMPRESSION_NONE;
|
||||
insn->header.execution_size = BRW_EXECUTE_8;
|
||||
return insn;
|
||||
}
|
||||
|
||||
/* DO/WHILE loop:
|
||||
*
|
||||
* The DO/WHILE is just an unterminated loop -- break or continue are
|
||||
@@ -2188,7 +2202,7 @@ void brw_fb_WRITE(struct brw_compile *p,
|
||||
msg_type,
|
||||
msg_length,
|
||||
header_present,
|
||||
1, /* last render target write */
|
||||
eot, /* last render target write */
|
||||
response_length,
|
||||
eot,
|
||||
0 /* send_commit_msg */);
|
||||
@@ -2395,8 +2409,8 @@ brw_find_next_block_end(struct brw_compile *p, int start)
|
||||
return ip;
|
||||
}
|
||||
}
|
||||
assert(!"not reached");
|
||||
return start + 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* There is no DO instruction on gen6, so to find the end of the loop
|
||||
@@ -2425,7 +2439,7 @@ brw_find_loop_end(struct brw_compile *p, int start)
|
||||
}
|
||||
|
||||
/* After program generation, go back and update the UIP and JIP of
|
||||
* BREAK and CONT instructions to their correct locations.
|
||||
* BREAK, CONT, and HALT instructions to their correct locations.
|
||||
*/
|
||||
void
|
||||
brw_set_uip_jip(struct brw_compile *p)
|
||||
@@ -2439,18 +2453,47 @@ brw_set_uip_jip(struct brw_compile *p)
|
||||
|
||||
for (ip = 0; ip < p->nr_insn; ip++) {
|
||||
struct brw_instruction *insn = &p->store[ip];
|
||||
int block_end_ip = 0;
|
||||
|
||||
if (insn->header.opcode == BRW_OPCODE_BREAK ||
|
||||
insn->header.opcode == BRW_OPCODE_CONTINUE ||
|
||||
insn->header.opcode == BRW_OPCODE_HALT) {
|
||||
block_end_ip = brw_find_next_block_end(p, ip);
|
||||
}
|
||||
|
||||
switch (insn->header.opcode) {
|
||||
case BRW_OPCODE_BREAK:
|
||||
insn->bits3.break_cont.jip = br * (brw_find_next_block_end(p, ip) - ip);
|
||||
assert(block_end_ip != 0);
|
||||
insn->bits3.break_cont.jip = br * (block_end_ip - ip);
|
||||
/* Gen7 UIP points to WHILE; Gen6 points just after it */
|
||||
insn->bits3.break_cont.uip =
|
||||
br * (brw_find_loop_end(p, ip) - ip + (intel->gen == 6 ? 1 : 0));
|
||||
break;
|
||||
case BRW_OPCODE_CONTINUE:
|
||||
insn->bits3.break_cont.jip = br * (brw_find_next_block_end(p, ip) - ip);
|
||||
assert(block_end_ip != 0);
|
||||
insn->bits3.break_cont.jip = br * (block_end_ip - ip);
|
||||
insn->bits3.break_cont.uip = br * (brw_find_loop_end(p, ip) - ip);
|
||||
|
||||
assert(insn->bits3.break_cont.uip != 0);
|
||||
assert(insn->bits3.break_cont.jip != 0);
|
||||
break;
|
||||
case BRW_OPCODE_HALT:
|
||||
/* From the Sandy Bridge PRM (volume 4, part 2, section 8.3.19):
|
||||
*
|
||||
* "In case of the halt instruction not inside any conditional code
|
||||
* block, the value of <JIP> and <UIP> should be the same. In case
|
||||
* of the halt instruction inside conditional code block, the <UIP>
|
||||
* should be the end of the program, and the <JIP> should be end of
|
||||
* the most inner conditional code block."
|
||||
*
|
||||
* The uip will have already been set by whoever set up the
|
||||
* instruction.
|
||||
*/
|
||||
if (block_end_ip == 0) {
|
||||
insn->bits3.break_cont.jip = insn->bits3.break_cont.uip;
|
||||
} else {
|
||||
insn->bits3.break_cont.jip = br * (block_end_ip - ip);
|
||||
}
|
||||
assert(insn->bits3.break_cont.uip != 0);
|
||||
assert(insn->bits3.break_cont.jip != 0);
|
||||
break;
|
||||
|
@@ -710,6 +710,15 @@ fs_visitor::calculate_urb_setup()
|
||||
urb_setup[fp_index] = urb_next++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* It's a FS only attribute, and we did interpolation for this attribute
|
||||
* in SF thread. So, count it here, too.
|
||||
*
|
||||
* See compile_sf_prog() for more info.
|
||||
*/
|
||||
if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(FRAG_ATTRIB_PNTC))
|
||||
urb_setup[FRAG_ATTRIB_PNTC] = urb_next++;
|
||||
}
|
||||
|
||||
/* Each attribute is 4 setup channels, each of which is half a reg. */
|
||||
|
@@ -171,6 +171,26 @@ static const fs_reg reg_undef;
|
||||
static const fs_reg reg_null_f(ARF, BRW_ARF_NULL, BRW_REGISTER_TYPE_F);
|
||||
static const fs_reg reg_null_d(ARF, BRW_ARF_NULL, BRW_REGISTER_TYPE_D);
|
||||
|
||||
class ip_record : public exec_node {
|
||||
public:
|
||||
static void* operator new(size_t size, void *ctx)
|
||||
{
|
||||
void *node;
|
||||
|
||||
node = rzalloc_size(ctx, size);
|
||||
assert(node != NULL);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
ip_record(int ip)
|
||||
{
|
||||
this->ip = ip;
|
||||
}
|
||||
|
||||
int ip;
|
||||
};
|
||||
|
||||
class fs_inst : public exec_node {
|
||||
public:
|
||||
/* Callers of this ralloc-based new need not call delete. It's
|
||||
@@ -489,6 +509,7 @@ public:
|
||||
bool remove_duplicate_mrf_writes();
|
||||
bool virtual_grf_interferes(int a, int b);
|
||||
void schedule_instructions();
|
||||
void patch_discard_jumps_to_fb_writes();
|
||||
void fail(const char *msg, ...);
|
||||
|
||||
void push_force_uncompressed();
|
||||
@@ -571,6 +592,7 @@ public:
|
||||
struct gl_shader_program *prog;
|
||||
void *mem_ctx;
|
||||
exec_list instructions;
|
||||
exec_list discard_halt_patches;
|
||||
|
||||
/* Delayed setup of c->prog_data.params[] due to realloc of
|
||||
* ParamValues[] during compile.
|
||||
@@ -595,6 +617,7 @@ public:
|
||||
struct hash_table *variable_ht;
|
||||
ir_variable *frag_depth;
|
||||
fs_reg outputs[BRW_MAX_DRAW_BUFFERS];
|
||||
unsigned output_components[BRW_MAX_DRAW_BUFFERS];
|
||||
int first_non_payload_grf;
|
||||
int max_grf;
|
||||
int urb_setup[FRAG_ATTRIB_MAX];
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user