Compare commits
137 Commits
mesa-17.3.
...
mesa-9.2
Author | SHA1 | Date | |
---|---|---|---|
|
46273ba256 | ||
|
d3f99fb532 | ||
|
6fb2032c35 | ||
|
c0abf6499f | ||
|
1a9bda1f34 | ||
|
59781051eb | ||
|
f31a1d9f8d | ||
|
3370dfdf3e | ||
|
2153557906 | ||
|
dda7358377 | ||
|
3fd1ca7949 | ||
|
4aa9f013d5 | ||
|
7aefdab219 | ||
|
fe6526f439 | ||
|
08b192d26a | ||
|
c1c076dd8d | ||
|
368fc4f3ec | ||
|
e14baf425b | ||
|
dce3865306 | ||
|
8efdaedfc2 | ||
|
c47804d286 | ||
|
5114ac3f87 | ||
|
f0bc10679e | ||
|
3f438bfa4c | ||
|
60e1b03455 | ||
|
cf537c405b | ||
|
601926515e | ||
|
c9a7d6950b | ||
|
89aff30f9b | ||
|
3eae076d70 | ||
|
3ec07eaaa5 | ||
|
35c9345711 | ||
|
74fcc65b58 | ||
|
b802f6a124 | ||
|
170b952cfe | ||
|
b97305bc21 | ||
|
ecd1d92baf | ||
|
c8b5222074 | ||
|
bd83ff1923 | ||
|
a8b08c5ccd | ||
|
796b4a7b40 | ||
|
d3004acdd1 | ||
|
684316512c | ||
|
9f7f727345 | ||
|
1fb22bf143 | ||
|
9fa7313e34 | ||
|
6296abed15 | ||
|
5b8c943eb2 | ||
|
d72f7720a6 | ||
|
b40d9e4f41 | ||
|
e2185778e2 | ||
|
a98d5f2663 | ||
|
24d1949ddc | ||
|
996bc26c87 | ||
|
b055c8689e | ||
|
d6d0175203 | ||
|
4ba5fd1052 | ||
|
872c09586c | ||
|
4f44202aae | ||
|
33b581f6f6 | ||
|
c088c24588 | ||
|
7d6dcb61cd | ||
|
8025bac852 | ||
|
5d6dc93490 | ||
|
31f582abd4 | ||
|
0b131ae24f | ||
|
8ee4a4e417 | ||
|
0c405cd0e8 | ||
|
b76ff3dbcd | ||
|
cb8e109492 | ||
|
4006fc4656 | ||
|
731a08341e | ||
|
3da0c76ec0 | ||
|
10ff10c89e | ||
|
12da1bcb3b | ||
|
195e995968 | ||
|
6f9b090719 | ||
|
70c9e07bd4 | ||
|
d383ff0843 | ||
|
d1419857d7 | ||
|
c15b2d86e2 | ||
|
1e0ad955e7 | ||
|
9aeb967e75 | ||
|
001c29cb18 | ||
|
c331562158 | ||
|
8e1d37161f | ||
|
78e760c234 | ||
|
71891ce017 | ||
|
a19bc84380 | ||
|
73bde3b8ff | ||
|
4a37827752 | ||
|
adc87c5e3f | ||
|
4d7ebeb51e | ||
|
6d8f471640 | ||
|
687415cf70 | ||
|
e4f81bdbc4 | ||
|
6c25c0a0da | ||
|
526e71bfcc | ||
|
06aee8a56c | ||
|
b319e3975e | ||
|
d4c2c5a739 | ||
|
a3f48d97cd | ||
|
030ada7a50 | ||
|
b61036fa2d | ||
|
ddf6f591a9 | ||
|
e3dbfc5769 | ||
|
cdcba2878a | ||
|
8efee44c38 | ||
|
3bdd95270d | ||
|
5476049e38 | ||
|
a2dbaeb2d8 | ||
|
ded1695494 | ||
|
3213c60d81 | ||
|
678ac190a5 | ||
|
771b576da6 | ||
|
9c66a29358 | ||
|
5154c93fa8 | ||
|
8a27c824ec | ||
|
4953bf3837 | ||
|
c7bfe87721 | ||
|
c6f6b4e161 | ||
|
4f5e18cb3e | ||
|
e108bb07a0 | ||
|
55241e9958 | ||
|
6237090330 | ||
|
55ab069e5f | ||
|
925e8a200b | ||
|
014b9ceb62 | ||
|
8f80e55002 | ||
|
579eae3012 | ||
|
cb06c9b2aa | ||
|
253a4c3e73 | ||
|
99666d81e4 | ||
|
e8bc520713 | ||
|
49f40ebefa | ||
|
9b8ad64362 | ||
|
ee421aec32 |
@@ -35,7 +35,7 @@ LOCAL_C_INCLUDES += \
|
||||
|
||||
# define ANDROID_VERSION (e.g., 4.0.x => 0x0400)
|
||||
LOCAL_CFLAGS += \
|
||||
-DPACKAGE_VERSION=\"9.2.0-devel\" \
|
||||
-DPACKAGE_VERSION=\"9.2.0\" \
|
||||
-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\" \
|
||||
-DANDROID_VERSION=0x0$(MESA_ANDROID_MAJOR_VERSION)0$(MESA_ANDROID_MINOR_VERSION)
|
||||
|
||||
|
@@ -57,12 +57,6 @@ 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 \
|
||||
|
@@ -70,7 +70,7 @@ if env['gles']:
|
||||
# Environment setup
|
||||
|
||||
env.Append(CPPDEFINES = [
|
||||
('PACKAGE_VERSION', '\\"9.2.0-devel\\"'),
|
||||
('PACKAGE_VERSION', '\\"9.2.0\\"'),
|
||||
('PACKAGE_BUGREPORT', '\\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\\"'),
|
||||
])
|
||||
|
||||
|
@@ -14,7 +14,7 @@ git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
|
||||
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
|
||||
|
||||
# Grep for commits that were marked as a candidate for the stable tree.
|
||||
git log --reverse --pretty=%H -i --grep='^[[:space:]]*NOTE: .*[Cc]andidate' HEAD..origin/master |\
|
||||
git log --reverse --pretty=%H -i --grep='^\([[:space:]]*NOTE: .*[Cc]andidate\|CC:.*mesa-stable\)' HEAD..origin/master |\
|
||||
while read sha
|
||||
do
|
||||
# Check to see whether the patch is on the ignore list.
|
||||
|
38
configure.ac
38
configure.ac
@@ -6,7 +6,7 @@ dnl Tell the user about autoconf.html in the --help output
|
||||
m4_divert_once([HELP_END], [
|
||||
See docs/autoconf.html for more details on the options for Mesa.])
|
||||
|
||||
AC_INIT([Mesa], [9.2.0-devel],
|
||||
AC_INIT([Mesa], [9.2.0],
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
|
||||
AC_CONFIG_AUX_DIR([bin])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
@@ -579,6 +579,11 @@ AC_ARG_ENABLE([osmesa],
|
||||
[enable OSMesa library @<:@default=disabled@:>@])],
|
||||
[enable_osmesa="$enableval"],
|
||||
[enable_osmesa=no])
|
||||
AC_ARG_ENABLE([gallium-osmesa],
|
||||
[AS_HELP_STRING([--enable-gallium-osmesa],
|
||||
[enable Gallium implementation of the OSMesa library @<:@default=disabled@:>@])],
|
||||
[enable_gallium_osmesa="$enableval"],
|
||||
[enable_gallium_osmesa=no])
|
||||
AC_ARG_ENABLE([egl],
|
||||
[AS_HELP_STRING([--disable-egl],
|
||||
[disable EGL library @<:@default=enabled@:>@])],
|
||||
@@ -769,7 +774,13 @@ if test "x$enable_dri" = xyes; then
|
||||
GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
|
||||
fi
|
||||
|
||||
if test "x$enable_osmesa" = xyes; then
|
||||
if test "x$enable_gallium_osmesa" = xyes; then
|
||||
if test -z "$with_gallium_drivers"; then
|
||||
AC_MSG_ERROR([Cannot enable gallium_osmesa without Gallium])
|
||||
fi
|
||||
if test "x$enable_osmesa" = xyes; then
|
||||
AC_MSG_ERROR([Cannot enable both classic and Gallium OSMesa implementations])
|
||||
fi
|
||||
GALLIUM_STATE_TRACKERS_DIRS="osmesa $GALLIUM_STATE_TRACKERS_DIRS"
|
||||
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS osmesa"
|
||||
fi
|
||||
@@ -1135,7 +1146,7 @@ x16|x32)
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "x$enable_osmesa" = xyes; then
|
||||
if test "x$enable_osmesa" = xyes -o "x$enable_gallium_osmesa" = xyes; then
|
||||
# only link libraries with osmesa if shared
|
||||
if test "$enable_static" = no; then
|
||||
OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
|
||||
@@ -1914,8 +1925,8 @@ AM_CONDITIONAL(NEED_GALLIUM_SOFTPIPE_DRIVER, test "x$HAVE_GALLIUM_SVGA" = xyes -
|
||||
"x$HAVE_GALLIUM_I915" = xyes -o \
|
||||
"x$HAVE_GALLIUM_SOFTPIPE" = xyes)
|
||||
AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test "x$HAVE_GALLIUM_I915" = xyes -o \
|
||||
"x$HAVE_GALLIUM_SOFTPIPE" = xyes -a \
|
||||
"x$MESA_LLVM" = x1)
|
||||
"x$HAVE_GALLIUM_SOFTPIPE" = xyes \
|
||||
&& test "x$MESA_LLVM" = x1)
|
||||
|
||||
if test "x$enable_gallium_loader" = xyes; then
|
||||
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
|
||||
@@ -1962,9 +1973,11 @@ AC_SUBST([ELF_LIB])
|
||||
|
||||
AM_CONDITIONAL(NEED_LIBPROGRAM, test "x$with_gallium_drivers" != x -o \
|
||||
"x$enable_xlib_glx" = xyes -o \
|
||||
"x$enable_osmesa" = xyes)
|
||||
"x$enable_osmesa" = xyes -o \
|
||||
"x$enable_gallium_osmesa" = xyes)
|
||||
AM_CONDITIONAL(HAVE_X11_DRIVER, test "x$enable_xlib_glx" = xyes)
|
||||
AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_OSMESA, test "x$enable_gallium_osmesa" = xyes)
|
||||
|
||||
AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1)
|
||||
AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1)
|
||||
@@ -2053,6 +2066,7 @@ AC_CONFIG_FILES([Makefile
|
||||
src/gallium/targets/gbm/Makefile
|
||||
src/gallium/targets/opencl/Makefile
|
||||
src/gallium/targets/osmesa/Makefile
|
||||
src/gallium/targets/osmesa/osmesa.pc
|
||||
src/gallium/targets/pipe-loader/Makefile
|
||||
src/gallium/targets/libgl-xlib/Makefile
|
||||
src/gallium/targets/vdpau-nouveau/Makefile
|
||||
@@ -2151,11 +2165,17 @@ echo " OpenVG: $enable_openvg"
|
||||
|
||||
dnl Driver info
|
||||
echo ""
|
||||
if test "x$enable_osmesa" != xno; then
|
||||
case "x$enable_osmesa$enable_gallium_osmesa" in
|
||||
xnoyes)
|
||||
echo " OSMesa: lib$OSMESA_LIB (Gallium)"
|
||||
;;
|
||||
xyesno)
|
||||
echo " OSMesa: lib$OSMESA_LIB"
|
||||
else
|
||||
;;
|
||||
xnono)
|
||||
echo " OSMesa: no"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "x$enable_dri" != xno; then
|
||||
# cleanup the drivers var
|
||||
|
@@ -16,6 +16,12 @@
|
||||
|
||||
<h1>News</h1>
|
||||
|
||||
<h2>August 1, 2013</h2>
|
||||
<p>
|
||||
<a href="relnotes/9.1.6.html">Mesa 9.1.6</a> is released.
|
||||
This is a bug fix release.
|
||||
</p>
|
||||
|
||||
<h2>July 17, 2013</h2>
|
||||
<p>
|
||||
<a href="relnotes/9.1.5.html">Mesa 9.1.5</a> is released.
|
||||
|
@@ -22,6 +22,7 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
|
||||
<ul>
|
||||
<li><a href="relnotes/9.2.html">9.2 release notes</a>
|
||||
<li><a href="relnotes/9.1.6.html">9.1.6 release notes</a>
|
||||
<li><a href="relnotes/9.1.5.html">9.1.5 release notes</a>
|
||||
<li><a href="relnotes/9.1.4.html">9.1.4 release notes</a>
|
||||
<li><a href="relnotes/9.1.3.html">9.1.3 release notes</a>
|
||||
|
@@ -30,7 +30,9 @@ because GL_ARB_compatibility is not supported.
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
TBD
|
||||
4ed2af5943141a85a21869053a2fc2eb MesaLib-9.1.5.tar.bz2
|
||||
47181066acf3231d74e027b2033f9455 MesaLib-9.1.5.tar.gz
|
||||
4c9c6615bd99215325250f87ed34058f MesaLib-9.1.5.zip
|
||||
</pre>
|
||||
|
||||
<h2>New features</h2>
|
||||
|
168
docs/relnotes/9.1.6.html
Normal file
168
docs/relnotes/9.1.6.html
Normal file
@@ -0,0 +1,168 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="../mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>The Mesa 3D Graphics Library</h1>
|
||||
</div>
|
||||
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 9.1.6 Release Notes / August 1, 2013</h1>
|
||||
|
||||
<p>
|
||||
Mesa 9.1.6 is a bug fix release which fixes bugs found since the 9.1.5 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 9.1 implements the OpenGL 3.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
|
||||
3.1 is <strong>only</strong> available if requested at context creation
|
||||
because GL_ARB_compatibility is not supported.
|
||||
</p>
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
443a2a352667294b53d56cb1a74114e9 MesaLib-9.1.6.tar.bz2
|
||||
08d3069cccd6821e5f33e0840bca0718 MesaLib-9.1.6.tar.gz
|
||||
90aa7a6d9878cdbfcb055312f356d6b9 MesaLib-9.1.6.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=47824">Bug 47824</a> - osmesa using --enable-shared-glapi depends on libgl</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62362">Bug 62362</a> - Crash when using Wayland EGL platform</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=63435">Bug 63435</a> - [Regression since 9.0] Flickering in EGL OpenGL full-screen window with swap interval 1</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64087">Bug 64087</a> - Webgl conformance shader-with-non-reserved-words crash when mesa is compiled without --enable-debug</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64330">Bug 64330</a> - WebGL snake demo crash in loop_analysis.cpp:506: bool is_loop_terminator(ir_if*): assertion „inst != __null“ failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=65236">Bug 65236</a> - [i965] Rendering artifacts in VDrift/GL2</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66558">Bug 66558</a> - RS690: 3D artifacts when playing SuperTuxKart</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66847">Bug 66847</a> - compilation broken with llvm 3.3</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66850">Bug 66850</a> - glGenerateMipmap crashes when using GL_TEXTURE_2D_ARRAY with compressed internal format</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66921">Bug 66921</a> - [r300g] Heroes of Newerth: HiZ related corruption</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67283">Bug 67283</a> - VDPAU doesn't work on hybrid laptop through DRI_PRIME</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-9.1.5..mesa-9.1.6
|
||||
</pre>
|
||||
|
||||
<p>Andreas Boll (1):</p>
|
||||
<ul>
|
||||
<li>configure.ac: Require llvm-3.2 for r600g/radeonsi llvm backends</li>
|
||||
</ul>
|
||||
|
||||
<p>Brian Paul (4):</p>
|
||||
<ul>
|
||||
<li>mesa: handle 2D texture arrays in get_tex_rgba_compressed()</li>
|
||||
<li>meta: handle 2D texture arrays in decompress_texture_image()</li>
|
||||
<li>mesa: implement mipmap generation for compressed 2D array textures</li>
|
||||
<li>mesa: improve free() cleanup in generate_mipmap_compressed()</li>
|
||||
</ul>
|
||||
|
||||
<p>Carl Worth (7):</p>
|
||||
<ul>
|
||||
<li>docs: Add 9.1.5 release md5sums</li>
|
||||
<li>Merge 'origin/9.1' into stable</li>
|
||||
<li>cherry-ignore: Drop 13 patches from the pick list</li>
|
||||
<li>get-pick-list.sh: Include commits mentionining "CC: mesa-stable..." in pick list</li>
|
||||
<li>get-pick-list: Allow for non-whitespace between "CC:" and "mesa-stable"</li>
|
||||
<li>get-pick-list: Ignore commits which CC mesa-stable unless they say "9.1"</li>
|
||||
<li>Bump version to 9.1.6</li>
|
||||
</ul>
|
||||
|
||||
<p>Chris Forbes (5):</p>
|
||||
<ul>
|
||||
<li>i965/Gen4: Zero extra coordinates for ir_tex</li>
|
||||
<li>i965/vs: Fix flaky texture swizzling</li>
|
||||
<li>i965/vs: set up sampler state pointer for Gen4/5.</li>
|
||||
<li>i965/vs: Put lod parameter in the correct place for Gen4</li>
|
||||
<li>i965/vs: Gen4/5: enable front colors if back colors are written</li>
|
||||
</ul>
|
||||
|
||||
<p>Christoph Bumiller (1):</p>
|
||||
<ul>
|
||||
<li>nv50,nvc0: s/uint16/uint32 for constant buffer offset</li>
|
||||
</ul>
|
||||
|
||||
<p>Dave Airlie (1):</p>
|
||||
<ul>
|
||||
<li>gallium/vl: add prime support</li>
|
||||
</ul>
|
||||
|
||||
<p>Eric Anholt (1):</p>
|
||||
<ul>
|
||||
<li>egl: Restore "bogus" DRI2 invalidate event code.</li>
|
||||
</ul>
|
||||
|
||||
<p>Jeremy Huddleston Sequoia (1):</p>
|
||||
<ul>
|
||||
<li>Apple: glFlush() is not needed with CGLFlushDrawable()</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (1):</p>
|
||||
<ul>
|
||||
<li>glsl: Classify "layout" like other identifiers.</li>
|
||||
</ul>
|
||||
|
||||
<p>Kristian Høgsberg (1):</p>
|
||||
<ul>
|
||||
<li>egl-wayland: Fix left-over wl_display_roundtrip() usage</li>
|
||||
</ul>
|
||||
|
||||
<p>Maarten Lankhorst (2):</p>
|
||||
<ul>
|
||||
<li>osmesa: link against static libglapi library too to get the gl exports</li>
|
||||
<li>nvc0: force use of correct firmware file</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (4):</p>
|
||||
<ul>
|
||||
<li>r300g/swtcl: fix geometry corruption by uploading indices to a buffer</li>
|
||||
<li>r300g/swtcl: fix a lockup in MSAA resolve</li>
|
||||
<li>Revert "r300g: allow HiZ with a 16-bit zbuffer"</li>
|
||||
<li>r600g: increase array size for shader inputs and outputs</li>
|
||||
</ul>
|
||||
|
||||
<p>Matt Turner (2):</p>
|
||||
<ul>
|
||||
<li>i965: NULL check prog on shader compilation failure.</li>
|
||||
<li>i965/vs: Print error if vertex shader fails to compile.</li>
|
||||
</ul>
|
||||
|
||||
<p>Paul Berry (1):</p>
|
||||
<ul>
|
||||
<li>glsl: Handle empty if statement encountered during loop analysis.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -14,7 +14,7 @@
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 9.2 Release Notes / (date TBD)</h1>
|
||||
<h1>Mesa 9.2 Release Notes / (August 27, 2013)</h1>
|
||||
|
||||
<p>
|
||||
Mesa 9.2 is a new development release.
|
||||
@@ -44,21 +44,166 @@ Note: some of the new features are only available with certain drivers.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>GL_ARB_shading_language_420pack in all drivers that support GLSL 1.30.</li>
|
||||
<li>GL_ARB_texture_buffer_range</li>
|
||||
<li>GL_ARB_texture_multisample</li>
|
||||
<li>GL_ARB_texture_storage_multisample</li>
|
||||
<li>GL_ARB_texture_query_lod</li>
|
||||
<li>Enable GL_ARB_texture_storage on radeon, r200, and nouveau</li>
|
||||
<li>GL_EXT_discard_framebuffer in all OpenGL ES (all versions) drivers<li>
|
||||
<li>GL_EXT_framebuffer_multisample_blit_scaled on i965</li>
|
||||
<li>Added new freedreno gallium driver</li>
|
||||
<li>OSMesa interface for gallium llvmpipe/softpipe drivers</li>
|
||||
<li>Gallium Heads-Up Display (HUD) feature for performance monitoring</li>
|
||||
<li>Added support for UVD (2.2 and 3.0) video decoding on r600g and radeonsi through VDPAU (requires Kernel 3.10 or later)</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>TBD -- This list is likely incomplete.</p>
|
||||
<p>Attempts have been made to <b>not</b> include bugs fixed in previous 9.1
|
||||
releases or bugs that were regressions during 9.2 development. This list is
|
||||
likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=41787">Bug 41787</a> - [llvmpipe] stencil broken</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=44618">Bug 44618</a> - Cross-compilation broken by glsl builtin_compiler</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=46632">Bug 46632</a> - Make the alignment checks for the readpixel blit fastpath a bit more lenient</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47116">Bug 47116</a> - Enemy territory freezes with rs880 and commit fbebd431ec4e2e461a0cbcd5f3a04a000b8f6bbf</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47248">Bug 47248</a> - autogen missing dependency on flex and bison, causes infinite loop in glsl build</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48694">Bug 48694</a> - radeonsi_pipe.c:322:7: error: ‘PIPE_CAP_DUAL_SOURCE_BLEND’ undeclared</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50655">Bug 50655</a> - [r600g][RV670 HD3870] Ioquake games causes GPU lockup (waiting for 0x00003039 last fence id 0x00003030)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51471">Bug 51471</a> - [965gm] Corrupted graphics in corners of screen with pixel shaders enabled</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51782">Bug 51782</a> - mesa-8.0.3: fails to compile against uclibc</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=54240">Bug 54240</a> - [swrast] piglit fbo-generatemipmap-filtering regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55503">Bug 55503</a> - Constant vertex attributes broken</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55783">Bug 55783</a> - glEnable(GL_FRAMEBUFFER_SRGB) has no effect on the backbuffer</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55825">Bug 55825</a> - [Bisected i965]Oglc max_values(advanced.fragmentProgram.GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB) causes OOM-killer</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=56920">Bug 56920</a> - [sandybridge][uxa] graphics very glitchy and always flickering</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=57753">Bug 57753</a> - leak in loop_analysis</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=57875">Bug 57875</a> - Second Life viewer bad rendering with git-ec83535</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=58666">Bug 58666</a> - rv670 + llvm = errors.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=58680">Bug 58680</a> - [IVB] Graphical glitches in 0 A.D</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=58872">Bug 58872</a> - Mac OS X configure: error: Couldn't find clock_gettime</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59322">Bug 59322</a> - r300g MSAA breaks Half-Life 2 in Wine</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59364">Bug 59364</a> - [bisected] Mesa build fails: clientattrib.c:33:22: fatal error: indirect.h: No such file or directory</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59439">Bug 59439</a> - glCopyPixels generates no fragments (occlusion_query_meta_fragments test fails)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59440">Bug 59440</a> - glBitmap generates no fragments (occlusion_query_meta_fragments test fails)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59494">Bug 59494</a> - [Bisected]Piglit glean_depthStencil fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59592">Bug 59592</a> - Radeon HD 5670: reproducable GPU lockups with htile enabled</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59648">Bug 59648</a> - [SNB/IVB/HSW Bisected]Piglit spec/ARB_uniform_buffer/object_layout-std140-base-size-and-alignment fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59701">Bug 59701</a> - lp_test_arit fails on non-sse41 capable machines, breaking make check</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59737">Bug 59737</a> - [bisected] 0d108116bd80b757fb01a84a9f1946ef870b57b8 breaks osmesa when cross compiling</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59740">Bug 59740</a> - [i965 Bisected]Oglc api-error(negative.glEvalMesh) fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59851">Bug 59851</a> - AC_ARG_WITH misusage leading to mesa configure failure</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59873">Bug 59873</a> - [swrast] piglit ext_framebuffer_multisample-interpolation 0 centroid-edges regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59876">Bug 59876</a> - glGetTexLevelParameteriv broken for indirect rendering</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60038">Bug 60038</a> - [osmesa] [git] building 32-bit mesa on 64 bit fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60047">Bug 60047</a> - [softpipe] piglit masked-clear regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60052">Bug 60052</a> - [Bisected]Piglit glx_extension_string_sanity fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60082">Bug 60082</a> - [ FAILED ] DispatchSanity_test.GL31_CORE</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60086">Bug 60086</a> - Wayland platform backend crashes if there's no back buffer during dri2_swap_buffers</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60098">Bug 60098</a> - [softpipe] Unexpected PIPE_CAP 78 query</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60172">Bug 60172</a> - Planeshift: triangles where grass would be</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60200">Bug 60200</a> - radeon_bo with virtual address referencing mismatch</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60212">Bug 60212</a> - [Bisected] Weston black output</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60524">Bug 60524</a> - [softpipe] piglit depthstencil-render-miplevels 146 s=z24_s8 regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60527">Bug 60527</a> - [softpipe] fbo-stencil GL_DEPTH24_STENCIL8 clear regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60633">Bug 60633</a> - EXT_texture_sRGB does not work in game The Cave on IvyBridge</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60737">Bug 60737</a> - In GLSL ES, a missing FS precision qualifier does not generate an error</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60866">Bug 60866</a> - GLSL performance issues for uniform buffer objects</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61036">Bug 61036</a> - Shader fails to build in LLVMpipe, aborts program</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61200">Bug 61200</a> - insufficient linking of libxatracker.so</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61635">Bug 61635</a> - glVertexAttribPointer(id, GL_UNSIGNED_BYTE, GL_FALSE,...) does not work</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62466">Bug 62466</a> - r600g hyperz lockups with KSP 0.19</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62669">Bug 62669</a> - HyperZ freeze when playing PrBoom-Plus demo with lots of monsters</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62721">Bug 62721</a> - GPU lockup in Minecraft 1.5.1 with HyperZ</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62830">Bug 62830</a> - [i965 bisected] Wrong Lightning on Freespace 2 SCP (patch attached)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=63124">Bug 63124</a> - [r600g] HyperZ lockup on REDWOOD in Half Life 2 Deathmatch</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=63702">Bug 63702</a> - tiling2d in radeon trash vdpau UVD textures</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64935">Bug 64935</a> - [swrast] s_texfetch.c:1335: set_fetch_functions: Assertion `texImage->FetchTexel' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64959">Bug 64959</a> - Cannot build against EGL without X11</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=65112">Bug 65112</a> - glcpp hangs parsing line continuations</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=65958">Bug 65958</a> - GPU Lockup on Trinity 7500G</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66450">Bug 66450</a> - JUNIPER UVD accelerated playback of MPEG 1/2 streams does not work</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66606">Bug 66606</a> - [i965 bisected]GLBenchmark 2.5.1/2.7.0 sometimes render error with gnome-session enabling SNA</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66713">Bug 66713</a> - Team Fortress 2 crashes with r600-sb on HD4850</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67354">Bug 67354</a> - glsl_parser.cpp is broken with bison 3.0</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67548">Bug 67548</a> - glGetAttribLocation seems to be broken</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67927">Bug 67927</a> - R600_DEBUG=sb: Celestia show 2 earths, one wrongly rendered</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67934">Bug 67934</a> - [SNB/IVB/HSW 9.2 Bisected]Ogles2conform/GL2Tests/glUniform/glUniform.test fails with gnome-session enable compositing</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68162">Bug 68162</a> - [radeonsi] texture rendering is broken in Source-Engine games</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68195">Bug 68195</a> - piglit tests vs-struct-pad and fs-struct-pad both fail</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
@@ -70,7 +215,8 @@ Note: some of the new features are only available with certain drivers.
|
||||
the (unsupported) GDI driver.</li>
|
||||
<li>GL_EXT_separate_shader_objects has been removed from all Gallium drivers,
|
||||
because it disallows a critical GLSL shader optimization.
|
||||
GL_ARB_separate_shader_objects doesn't have this issue.
|
||||
GL_ARB_separate_shader_objects doesn't have this issue.</li>
|
||||
<li>i965 Gen6+ requires Kernel 3.6 or later. (92d2f5a)</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
@@ -29,6 +29,10 @@ if HAVE_DRI_GLX
|
||||
SUBDIRS += glx
|
||||
endif
|
||||
|
||||
if HAVE_EGL_PLATFORM_WAYLAND
|
||||
SUBDIRS += egl/wayland
|
||||
endif
|
||||
|
||||
if HAVE_GBM
|
||||
SUBDIRS += gbm
|
||||
endif
|
||||
|
@@ -21,8 +21,4 @@
|
||||
|
||||
SUBDIRS=
|
||||
|
||||
if HAVE_EGL_PLATFORM_WAYLAND
|
||||
SUBDIRS += wayland
|
||||
endif
|
||||
|
||||
SUBDIRS += drivers main
|
||||
|
@@ -28,6 +28,7 @@ AM_CFLAGS = \
|
||||
-I$(top_srcdir)/src/egl/wayland/wayland-drm \
|
||||
-I$(top_builddir)/src/egl/wayland/wayland-drm \
|
||||
$(DEFINES) \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(LIBDRM_CFLAGS) \
|
||||
$(LIBUDEV_CFLAGS) \
|
||||
$(LIBKMS_CFLAGS) \
|
||||
|
@@ -743,6 +743,20 @@ dri2_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
|
||||
free(reply);
|
||||
}
|
||||
|
||||
/* Since we aren't watching for the server's invalidate events like we're
|
||||
* supposed to (due to XCB providing no mechanism for filtering the events
|
||||
* the way xlib does), and SwapBuffers is a common cause of invalidate
|
||||
* events, just shove one down to the driver, even though we haven't told
|
||||
* the driver that we're the kind of loader that provides reliable
|
||||
* invalidate events. This causes the driver to request buffers again at
|
||||
* its next draw, so that we get the correct buffers if a pageflip
|
||||
* happened. The driver should still be using the viewport hack to catch
|
||||
* window resizes.
|
||||
*/
|
||||
if (dri2_dpy->flush &&
|
||||
dri2_dpy->flush->base.version >= 3 && dri2_dpy->flush->invalidate)
|
||||
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
|
||||
|
||||
return swap_count;
|
||||
}
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
AM_CFLAGS = \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src/egl/main \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(X11_CFLAGS) \
|
||||
$(DEFINES)
|
||||
|
||||
|
@@ -29,6 +29,7 @@ AM_CFLAGS = \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src/gbm/main \
|
||||
$(DEFINES) \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(EGL_CFLAGS) \
|
||||
-D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM) \
|
||||
-D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\" \
|
||||
|
@@ -1,6 +1,7 @@
|
||||
AM_CFLAGS = -I$(top_srcdir)/src/egl/main \
|
||||
-I$(top_srcdir)/include \
|
||||
$(DEFINES) \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(WAYLAND_CFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = libwayland-drm.la
|
||||
|
@@ -2,6 +2,7 @@ pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = wayland-egl.pc
|
||||
|
||||
AM_CFLAGS = $(DEFINES) \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(WAYLAND_CFLAGS)
|
||||
|
||||
lib_LTLIBRARIES = libwayland-egl.la
|
||||
|
@@ -38,13 +38,17 @@ libgallium_la_SOURCES += \
|
||||
endif
|
||||
|
||||
indices/u_indices_gen.c: $(srcdir)/indices/u_indices_gen.py
|
||||
$(MKDIR_P) indices
|
||||
$(AM_V_GEN) $(PYTHON2) $< > $@
|
||||
|
||||
indices/u_unfilled_gen.c: $(srcdir)/indices/u_unfilled_gen.py
|
||||
$(MKDIR_P) indices
|
||||
$(AM_V_GEN) $(PYTHON2) $< > $@
|
||||
|
||||
util/u_format_srgb.c: $(srcdir)/util/u_format_srgb.py
|
||||
$(MKDIR_P) util
|
||||
$(AM_V_GEN) $(PYTHON2) $< > $@
|
||||
|
||||
util/u_format_table.c: $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format_pack.py $(srcdir)/util/u_format_parse.py $(srcdir)/util/u_format.csv
|
||||
$(MKDIR_P) util
|
||||
$(AM_V_GEN) $(PYTHON2) $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format.csv > $@
|
||||
|
@@ -58,7 +58,7 @@ draw_get_option_use_llvm(void)
|
||||
|
||||
#ifdef PIPE_ARCH_X86
|
||||
util_cpu_detect();
|
||||
/* require SSE2 due to LLVM PR6960. */
|
||||
/* require SSE2 due to LLVM PR6960. XXX Might be fixed by now? */
|
||||
if (!util_cpu_caps.has_sse2)
|
||||
value = FALSE;
|
||||
#endif
|
||||
@@ -78,6 +78,9 @@ draw_create_context(struct pipe_context *pipe, boolean try_llvm)
|
||||
if (draw == NULL)
|
||||
goto err_out;
|
||||
|
||||
/* we need correct cpu caps for disabling denorms in draw_vbo() */
|
||||
util_cpu_detect();
|
||||
|
||||
#if HAVE_LLVM
|
||||
if (try_llvm && draw_get_option_use_llvm()) {
|
||||
draw->llvm = draw_llvm_create(draw);
|
||||
|
@@ -77,6 +77,14 @@ void pp_debug(const char *, ...);
|
||||
struct program *pp_init_prog(struct pp_queue_t *, struct pipe_context *pipe,
|
||||
struct cso_context *);
|
||||
void pp_init_fbos(struct pp_queue_t *, unsigned int, unsigned int);
|
||||
void pp_blit(struct pipe_context *pipe,
|
||||
struct pipe_resource *src_tex,
|
||||
int srcX0, int srcY0,
|
||||
int srcX1, int srcY1,
|
||||
int srcZ0,
|
||||
struct pipe_surface *dst,
|
||||
int dstX0, int dstY0,
|
||||
int dstX1, int dstY1);
|
||||
|
||||
/* The filters */
|
||||
|
||||
|
@@ -31,7 +31,6 @@
|
||||
|
||||
#include "pipe/p_screen.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_blit.h"
|
||||
#include "util/u_math.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_memory.h"
|
||||
@@ -111,13 +110,6 @@ pp_init(struct pipe_context *pipe, const unsigned int *enabled,
|
||||
}
|
||||
}
|
||||
|
||||
ppq->p->blitctx = util_create_blit(ppq->p->pipe, cso);
|
||||
|
||||
if (ppq->p->blitctx == NULL) {
|
||||
pp_debug("Unable to create a blit context.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
ppq->n_filters = curpos;
|
||||
ppq->n_tmp = (curpos > 2 ? 2 : 1);
|
||||
ppq->n_inner_tmp = tmp_req;
|
||||
@@ -180,11 +172,6 @@ pp_free(struct pp_queue_t *ppq)
|
||||
pp_free_fbos(ppq);
|
||||
|
||||
if (ppq && ppq->p) {
|
||||
/* Only destroy created contexts. */
|
||||
if (ppq->p->blitctx) {
|
||||
util_destroy_blit(ppq->p->blitctx);
|
||||
}
|
||||
|
||||
if (ppq->p->pipe && ppq->filters && ppq->shaders) {
|
||||
for (i = 0; i < ppq->n_filters; i++) {
|
||||
unsigned int filter = ppq->filters[i];
|
||||
|
@@ -43,7 +43,6 @@
|
||||
#include "postprocess/postprocess.h"
|
||||
#include "postprocess/pp_mlaa.h"
|
||||
#include "postprocess/pp_filters.h"
|
||||
#include "util/u_blit.h"
|
||||
#include "util/u_box.h"
|
||||
#include "util/u_sampler.h"
|
||||
#include "util/u_inlines.h"
|
||||
@@ -191,10 +190,9 @@ pp_jimenezmlaa_run(struct pp_queue_t *ppq, struct pipe_resource *in,
|
||||
pp_filter_set_fb(p);
|
||||
|
||||
/* Blit the input to the output */
|
||||
util_blit_pixels(p->blitctx, in, 0, 0, 0,
|
||||
w, h, 0, p->framebuffer.cbufs[0],
|
||||
0, 0, w, h, 0, PIPE_TEX_MIPFILTER_NEAREST,
|
||||
TGSI_WRITEMASK_XYZW, 0);
|
||||
pp_blit(p->pipe, in, 0, 0,
|
||||
w, h, 0, p->framebuffer.cbufs[0],
|
||||
0, 0, w, h);
|
||||
|
||||
u_sampler_view_default_template(&v_tmp, in, in->format);
|
||||
arr[0] = p->pipe->create_sampler_view(p->pipe, in, &v_tmp);
|
||||
|
@@ -56,8 +56,6 @@ struct program
|
||||
struct pipe_resource *vbuf;
|
||||
struct pipe_surface surf;
|
||||
struct pipe_sampler_view *view;
|
||||
|
||||
struct blit_state *blitctx;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -28,12 +28,50 @@
|
||||
#include "postprocess.h"
|
||||
|
||||
#include "postprocess/pp_filters.h"
|
||||
#include "util/u_blit.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_sampler.h"
|
||||
|
||||
#include "tgsi/tgsi_parse.h"
|
||||
|
||||
void
|
||||
pp_blit(struct pipe_context *pipe,
|
||||
struct pipe_resource *src_tex,
|
||||
int srcX0, int srcY0,
|
||||
int srcX1, int srcY1,
|
||||
int srcZ0,
|
||||
struct pipe_surface *dst,
|
||||
int dstX0, int dstY0,
|
||||
int dstX1, int dstY1)
|
||||
{
|
||||
struct pipe_blit_info blit;
|
||||
|
||||
memset(&blit, 0, sizeof(blit));
|
||||
|
||||
blit.src.resource = src_tex;
|
||||
blit.src.level = 0;
|
||||
blit.src.format = src_tex->format;
|
||||
blit.src.box.x = srcX0;
|
||||
blit.src.box.y = srcY0;
|
||||
blit.src.box.z = srcZ0;
|
||||
blit.src.box.width = srcX1 - srcX0;
|
||||
blit.src.box.height = srcY1 - srcY0;
|
||||
blit.src.box.depth = 1;
|
||||
|
||||
blit.dst.resource = dst->texture;
|
||||
blit.dst.level = dst->u.tex.level;
|
||||
blit.dst.format = dst->format;
|
||||
blit.dst.box.x = dstX0;
|
||||
blit.dst.box.y = dstY0;
|
||||
blit.dst.box.z = 0;
|
||||
blit.dst.box.width = dstX1 - dstX0;
|
||||
blit.dst.box.height = dstY1 - dstY0;
|
||||
blit.dst.box.depth = 1;
|
||||
|
||||
blit.mask = PIPE_MASK_RGBA;
|
||||
|
||||
pipe->blit(pipe, &blit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main run function of the PP queue. Called on swapbuffers/flush.
|
||||
*
|
||||
@@ -66,10 +104,10 @@ pp_run(struct pp_queue_t *ppq, struct pipe_resource *in,
|
||||
unsigned int w = ppq->p->framebuffer.width;
|
||||
unsigned int h = ppq->p->framebuffer.height;
|
||||
|
||||
util_blit_pixels(ppq->p->blitctx, in, 0, 0, 0,
|
||||
w, h, 0, ppq->tmps[0],
|
||||
0, 0, w, h, 0, PIPE_TEX_MIPFILTER_NEAREST,
|
||||
TGSI_WRITEMASK_XYZW, 0);
|
||||
|
||||
pp_blit(ppq->p->pipe, in, 0, 0,
|
||||
w, h, 0, ppq->tmps[0],
|
||||
0, 0, w, h);
|
||||
|
||||
in = ppq->tmp[0];
|
||||
}
|
||||
@@ -218,8 +256,8 @@ pp_tgsi_to_state(struct pipe_context *pipe, const char *text, bool isvs,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (tgsi_text_translate(text, tokens, Elements(tokens)) == FALSE) {
|
||||
pp_debug("Failed to translate %s\n", name);
|
||||
if (tgsi_text_translate(text, tokens, PP_MAX_TOKENS) == FALSE) {
|
||||
_debug_printf("pp: Failed to translate a shader for %s\n", name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -111,7 +111,6 @@ util_format_s3tc_init(void)
|
||||
util_dl_proc fetch_2d_texel_rgba_dxt3;
|
||||
util_dl_proc fetch_2d_texel_rgba_dxt5;
|
||||
util_dl_proc tx_compress_dxtn;
|
||||
char *force_s3tc_enable;
|
||||
|
||||
if (!first_time)
|
||||
return;
|
||||
@@ -122,15 +121,8 @@ util_format_s3tc_init(void)
|
||||
|
||||
library = util_dl_open(DXTN_LIBNAME);
|
||||
if (!library) {
|
||||
if ((force_s3tc_enable = getenv("force_s3tc_enable")) &&
|
||||
!strcmp(force_s3tc_enable, "true")) {
|
||||
debug_printf("couldn't open " DXTN_LIBNAME ", enabling DXTn due to "
|
||||
"force_s3tc_enable=true environment variable\n");
|
||||
util_format_s3tc_enabled = TRUE;
|
||||
} else {
|
||||
debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
|
||||
"compression/decompression unavailable\n");
|
||||
}
|
||||
debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
|
||||
"compression/decompression unavailable\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -32,8 +32,10 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <X11/Xlib-xcb.h>
|
||||
#include <X11/extensions/dri2tokens.h>
|
||||
#include <xcb/dri2.h>
|
||||
#include <xf86drm.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "pipe/p_screen.h"
|
||||
#include "pipe/p_context.h"
|
||||
@@ -305,6 +307,7 @@ vl_screen_create(Display *display, int screen)
|
||||
xcb_generic_error_t *error = NULL;
|
||||
char *device_name;
|
||||
int fd, device_name_length;
|
||||
unsigned int driverType;
|
||||
|
||||
drm_magic_t magic;
|
||||
|
||||
@@ -332,7 +335,22 @@ vl_screen_create(Display *display, int screen)
|
||||
s = xcb_setup_roots_iterator(xcb_get_setup(scrn->conn));
|
||||
while (screen--)
|
||||
xcb_screen_next(&s);
|
||||
connect_cookie = xcb_dri2_connect_unchecked(scrn->conn, s.data->root, XCB_DRI2_DRIVER_TYPE_DRI);
|
||||
driverType = XCB_DRI2_DRIVER_TYPE_DRI;
|
||||
#ifdef DRI2DriverPrimeShift
|
||||
{
|
||||
char *prime = getenv("DRI_PRIME");
|
||||
if (prime) {
|
||||
unsigned int primeid;
|
||||
errno = 0;
|
||||
primeid = strtoul(prime, NULL, 0);
|
||||
if (errno == 0)
|
||||
driverType |=
|
||||
((primeid & DRI2DriverPrimeMask) << DRI2DriverPrimeShift);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
connect_cookie = xcb_dri2_connect_unchecked(scrn->conn, s.data->root, driverType);
|
||||
connect = xcb_dri2_connect_reply(scrn->conn, connect_cookie, NULL);
|
||||
if (connect == NULL || connect->driver_name_length + connect->device_name_length == 0)
|
||||
goto free_screen;
|
||||
|
@@ -168,6 +168,8 @@ The integer capabilities:
|
||||
since they are linked) a driver can support. Returning 0 is equivalent
|
||||
to returning 1 because every driver has to support at least a single
|
||||
viewport/scissor combination.
|
||||
* ''PIPE_CAP_ENDIANNESS``:: The endianness of the device. Either
|
||||
PIPE_ENDIAN_BIG or PIPE_ENDIAN_LITTLE.
|
||||
|
||||
|
||||
.. _pipe_capf:
|
||||
|
@@ -227,6 +227,9 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_MAX_TEXEL_OFFSET:
|
||||
return 7;
|
||||
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
|
||||
default:
|
||||
DBG("unknown param %d", param);
|
||||
return 0;
|
||||
|
@@ -263,6 +263,8 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
|
||||
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
|
||||
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
|
||||
return 0;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
|
||||
default:
|
||||
debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap);
|
||||
|
@@ -421,6 +421,8 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
return 1 << 27;
|
||||
case PIPE_CAP_MAX_VIEWPORTS:
|
||||
return ILO_MAX_VIEWPORTS;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
|
@@ -836,7 +836,7 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
|
||||
LLVMValueRef stencil_vals = NULL;
|
||||
LLVMValueRef z_bitmask = NULL, stencil_shift = NULL;
|
||||
LLVMValueRef z_pass = NULL, s_pass_mask = NULL;
|
||||
LLVMValueRef orig_mask = lp_build_mask_value(mask);
|
||||
LLVMValueRef current_mask = lp_build_mask_value(mask);
|
||||
LLVMValueRef front_facing = NULL;
|
||||
boolean have_z, have_s;
|
||||
|
||||
@@ -984,7 +984,7 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
|
||||
|
||||
/* apply stencil-fail operator */
|
||||
{
|
||||
LLVMValueRef s_fail_mask = lp_build_andnot(&s_bld, orig_mask, s_pass_mask);
|
||||
LLVMValueRef s_fail_mask = lp_build_andnot(&s_bld, current_mask, s_pass_mask);
|
||||
stencil_vals = lp_build_stencil_op(&s_bld, stencil, S_FAIL_OP,
|
||||
stencil_refs, stencil_vals,
|
||||
s_fail_mask, front_facing);
|
||||
@@ -1032,6 +1032,11 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
|
||||
/* compare src Z to dst Z, returning 'pass' mask */
|
||||
z_pass = lp_build_cmp(&z_bld, depth->func, z_src, z_dst);
|
||||
|
||||
/* mask off bits that failed stencil test */
|
||||
if (s_pass_mask) {
|
||||
current_mask = LLVMBuildAnd(builder, current_mask, s_pass_mask, "");
|
||||
}
|
||||
|
||||
if (!stencil[0].enabled) {
|
||||
/* We can potentially skip all remaining operations here, but only
|
||||
* if stencil is disabled because we still need to update the stencil
|
||||
@@ -1041,25 +1046,19 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
|
||||
|
||||
if (do_branch) {
|
||||
lp_build_mask_check(mask);
|
||||
do_branch = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (depth->writemask) {
|
||||
LLVMValueRef zselectmask;
|
||||
LLVMValueRef z_pass_mask;
|
||||
|
||||
/* mask off bits that failed Z test */
|
||||
zselectmask = LLVMBuildAnd(builder, orig_mask, z_pass, "");
|
||||
|
||||
/* mask off bits that failed stencil test */
|
||||
if (s_pass_mask) {
|
||||
zselectmask = LLVMBuildAnd(builder, zselectmask, s_pass_mask, "");
|
||||
}
|
||||
z_pass_mask = LLVMBuildAnd(builder, current_mask, z_pass, "");
|
||||
|
||||
/* Mix the old and new Z buffer values.
|
||||
* z_dst[i] = zselectmask[i] ? z_src[i] : z_dst[i]
|
||||
*/
|
||||
z_dst = lp_build_select(&z_bld, zselectmask, z_src, z_dst);
|
||||
z_dst = lp_build_select(&z_bld, z_pass_mask, z_src, z_dst);
|
||||
}
|
||||
|
||||
if (stencil[0].enabled) {
|
||||
@@ -1067,13 +1066,13 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
|
||||
LLVMValueRef z_fail_mask, z_pass_mask;
|
||||
|
||||
/* apply Z-fail operator */
|
||||
z_fail_mask = lp_build_andnot(&s_bld, orig_mask, z_pass);
|
||||
z_fail_mask = lp_build_andnot(&s_bld, current_mask, z_pass);
|
||||
stencil_vals = lp_build_stencil_op(&s_bld, stencil, Z_FAIL_OP,
|
||||
stencil_refs, stencil_vals,
|
||||
z_fail_mask, front_facing);
|
||||
|
||||
/* apply Z-pass operator */
|
||||
z_pass_mask = LLVMBuildAnd(builder, orig_mask, z_pass, "");
|
||||
z_pass_mask = LLVMBuildAnd(builder, current_mask, z_pass, "");
|
||||
stencil_vals = lp_build_stencil_op(&s_bld, stencil, Z_PASS_OP,
|
||||
stencil_refs, stencil_vals,
|
||||
z_pass_mask, front_facing);
|
||||
@@ -1083,7 +1082,7 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
|
||||
/* No depth test: apply Z-pass operator to stencil buffer values which
|
||||
* passed the stencil test.
|
||||
*/
|
||||
s_pass_mask = LLVMBuildAnd(builder, orig_mask, s_pass_mask, "");
|
||||
s_pass_mask = LLVMBuildAnd(builder, current_mask, s_pass_mask, "");
|
||||
stencil_vals = lp_build_stencil_op(&s_bld, stencil, Z_PASS_OP,
|
||||
stencil_refs, stencil_vals,
|
||||
s_pass_mask, front_facing);
|
||||
|
@@ -231,6 +231,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
return 0;
|
||||
case PIPE_CAP_MAX_VIEWPORTS:
|
||||
return PIPE_MAX_VIEWPORTS;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_NATIVE;
|
||||
}
|
||||
/* should only get here on unhandled cases */
|
||||
debug_printf("Unexpected PIPE_CAP %d query\n", param);
|
||||
|
@@ -111,9 +111,6 @@ nv30_format_info_table[PIPE_FORMAT_COUNT] = {
|
||||
_(R16G16_SNORM , __V_),
|
||||
_(R16G16B16_SNORM , __V_),
|
||||
_(R16G16B16A16_SNORM , __V_),
|
||||
_(R8_USCALED , __V_),
|
||||
_(R8G8_USCALED , __V_),
|
||||
_(R8G8B8_USCALED , __V_),
|
||||
_(R8G8B8A8_USCALED , __V_),
|
||||
_(R16_FLOAT , __V_),
|
||||
_(R16G16_FLOAT , __V_), //S_V_),
|
||||
@@ -160,9 +157,6 @@ nv30_vtxfmt_table[PIPE_FORMAT_COUNT] = {
|
||||
_(R8G8_UNORM , U8_UNORM , 2),
|
||||
_(R8G8B8_UNORM , U8_UNORM , 3),
|
||||
_(R8G8B8A8_UNORM , U8_UNORM , 4),
|
||||
_(R8_USCALED , U8_USCALED , 1),
|
||||
_(R8G8_USCALED , U8_USCALED , 2),
|
||||
_(R8G8B8_USCALED , U8_USCALED , 3),
|
||||
_(R8G8B8A8_USCALED , U8_USCALED , 4),
|
||||
_(R16_SNORM , V16_SNORM , 1),
|
||||
_(R16G16_SNORM , V16_SNORM , 2),
|
||||
|
@@ -113,6 +113,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_TEXTURE_BARRIER:
|
||||
case PIPE_CAP_SEAMLESS_CUBE_MAP:
|
||||
case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
|
||||
case PIPE_CAP_CUBE_MAP_ARRAY:
|
||||
case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
|
||||
case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
|
||||
case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
|
||||
@@ -130,6 +131,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
|
||||
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
|
||||
return 1;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
default:
|
||||
debug_printf("unknown param %d\n", param);
|
||||
return 0;
|
||||
|
@@ -40,13 +40,15 @@ nv30_emit_vtxattr(struct nv30_context *nv30, struct pipe_vertex_buffer *vb,
|
||||
const unsigned nc = util_format_get_nr_components(ve->src_format);
|
||||
struct nouveau_pushbuf *push = nv30->base.pushbuf;
|
||||
struct nv04_resource *res = nv04_resource(vb->buffer);
|
||||
const struct util_format_description *desc =
|
||||
util_format_description(ve->src_format);
|
||||
const void *data;
|
||||
float v[4];
|
||||
|
||||
data = nouveau_resource_map_offset(&nv30->base, res, vb->buffer_offset +
|
||||
ve->src_offset, NOUVEAU_BO_RD);
|
||||
|
||||
util_format_read_4f(ve->src_format, v, 0, data, 0, 0, 0, 1, 1);
|
||||
desc->unpack_rgba_float(v, 0, data, 0, 1, 1);
|
||||
|
||||
switch (nc) {
|
||||
case 4:
|
||||
|
@@ -189,6 +189,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
return 0;
|
||||
case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
|
||||
return PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
default:
|
||||
NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
|
||||
return 0;
|
||||
|
@@ -40,7 +40,7 @@ struct nv50_constbuf {
|
||||
const uint8_t *data;
|
||||
} u;
|
||||
uint32_t size; /* max 65536 */
|
||||
uint16_t offset;
|
||||
uint32_t offset;
|
||||
boolean user; /* should only be TRUE if u.data is valid and non-NULL */
|
||||
};
|
||||
|
||||
|
@@ -140,10 +140,20 @@ nv50_emit_vtxattr(struct nv50_context *nv50, struct pipe_vertex_buffer *vb,
|
||||
const void *data = (const uint8_t *)vb->user_buffer + ve->src_offset;
|
||||
float v[4];
|
||||
const unsigned nc = util_format_get_nr_components(ve->src_format);
|
||||
const struct util_format_description *desc =
|
||||
util_format_description(ve->src_format);
|
||||
|
||||
assert(vb->user_buffer);
|
||||
|
||||
util_format_read_4f(ve->src_format, v, 0, data, 0, 0, 0, 1, 1);
|
||||
if (desc->channel[0].pure_integer) {
|
||||
if (desc->channel[0].type == UTIL_FORMAT_TYPE_SIGNED) {
|
||||
desc->unpack_rgba_sint((int32_t *)v, 0, data, 0, 1, 1);
|
||||
} else {
|
||||
desc->unpack_rgba_uint((uint32_t *)v, 0, data, 0, 1, 1);
|
||||
}
|
||||
} else {
|
||||
desc->unpack_rgba_float(v, 0, data, 0, 1, 1);
|
||||
}
|
||||
|
||||
switch (nc) {
|
||||
case 4:
|
||||
|
@@ -624,17 +624,13 @@ nv84_video_buffer_create(struct pipe_context *pipe,
|
||||
union nouveau_bo_config cfg;
|
||||
unsigned bo_size;
|
||||
|
||||
if (getenv("XVMC_VL"))
|
||||
if (getenv("XVMC_VL") || template->buffer_format != PIPE_FORMAT_NV12)
|
||||
return vl_video_buffer_create(pipe, template);
|
||||
|
||||
if (!template->interlaced) {
|
||||
debug_printf("Require interlaced video buffers\n");
|
||||
return NULL;
|
||||
}
|
||||
if (template->buffer_format != PIPE_FORMAT_NV12) {
|
||||
debug_printf("Must use NV12 format\n");
|
||||
return NULL;
|
||||
}
|
||||
if (template->chroma_format != PIPE_VIDEO_CHROMA_FORMAT_420) {
|
||||
debug_printf("Must use 4:2:0 format\n");
|
||||
return NULL;
|
||||
|
@@ -136,12 +136,11 @@ nv84_decoder_bsp(struct nv84_decoder *dec,
|
||||
params.iseqparm.chroma_format_idc = 1;
|
||||
|
||||
params.iseqparm.pic_width_in_mbs_minus1 = mb(dec->base.width) - 1;
|
||||
if (desc->field_pic_flag)
|
||||
if (desc->field_pic_flag || desc->mb_adaptive_frame_field_flag)
|
||||
params.iseqparm.pic_height_in_map_units_minus1 = mb_half(dec->base.height) - 1;
|
||||
else
|
||||
params.iseqparm.pic_height_in_map_units_minus1 = mb(dec->base.height) - 1;
|
||||
|
||||
/* TODO: interlaced still doesn't work, maybe due to ref frame management. */
|
||||
if (desc->bottom_field_flag)
|
||||
params.ipicparm.curr_pic_order_cnt = desc->field_order_cnt[1];
|
||||
else
|
||||
|
@@ -39,10 +39,10 @@ struct h264_iparm1 {
|
||||
uint32_t h1; // 1fc
|
||||
uint32_t h2; // 200
|
||||
uint32_t h3; // 204
|
||||
uint32_t unk208;
|
||||
uint32_t field_pic_flag;
|
||||
uint32_t format;
|
||||
uint32_t unk214;
|
||||
uint32_t mb_adaptive_frame_field_flag; // 208
|
||||
uint32_t field_pic_flag; // 20c
|
||||
uint32_t format; // 210
|
||||
uint32_t unk214; // 214
|
||||
};
|
||||
|
||||
struct h264_iparm2 {
|
||||
@@ -56,7 +56,7 @@ struct h264_iparm2 {
|
||||
uint32_t h2; // 1c
|
||||
uint32_t h3; // 20
|
||||
uint32_t unk24;
|
||||
uint32_t unk28;
|
||||
uint32_t mb_adaptive_frame_field_flag; // 28
|
||||
uint32_t top; // 2c
|
||||
uint32_t bottom; // 30
|
||||
uint32_t is_reference; // 34
|
||||
@@ -100,6 +100,7 @@ nv84_decoder_vp_h264(struct nv84_decoder *dec,
|
||||
param1.height = param1.h2 = height;
|
||||
param1.h1 = param1.h3 = align(height, 32);
|
||||
param1.format = 0x3231564e; /* 'NV12' */
|
||||
param1.mb_adaptive_frame_field_flag = desc->mb_adaptive_frame_field_flag;
|
||||
param1.field_pic_flag = desc->field_pic_flag;
|
||||
|
||||
param2.width = width;
|
||||
@@ -115,6 +116,7 @@ nv84_decoder_vp_h264(struct nv84_decoder *dec,
|
||||
param2.top = desc->bottom_field_flag ? 2 : 1;
|
||||
param2.bottom = desc->bottom_field_flag;
|
||||
}
|
||||
param2.mb_adaptive_frame_field_flag = desc->mb_adaptive_frame_field_flag;
|
||||
param2.is_reference = desc->is_reference;
|
||||
|
||||
PUSH_SPACE(push, 5 + 16 + 3 + 2 + 6 + (is_ref ? 2 : 0) + 3 + 2 + 4 + 2);
|
||||
|
@@ -179,6 +179,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
return 1;
|
||||
case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
|
||||
return PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
default:
|
||||
NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
|
||||
return 0;
|
||||
@@ -510,6 +512,7 @@ nvc0_screen_resize_tls_area(struct nvc0_screen *screen,
|
||||
}
|
||||
|
||||
size *= (screen->base.device->chipset >= 0xe0) ? 64 : 48; /* max warps */
|
||||
size = align(size, 0x8000);
|
||||
size *= screen->mp_count;
|
||||
|
||||
size = align(size, 1 << 17);
|
||||
|
@@ -38,7 +38,7 @@ struct nvc0_constbuf {
|
||||
const void *data;
|
||||
} u;
|
||||
uint32_t size;
|
||||
uint16_t offset;
|
||||
uint32_t offset;
|
||||
boolean user; /* should only be TRUE if u.data is valid and non-NULL */
|
||||
};
|
||||
|
||||
|
@@ -153,7 +153,7 @@ static void nvc0_video_getpath(enum pipe_video_profile profile, char *path)
|
||||
break;
|
||||
}
|
||||
case PIPE_VIDEO_CODEC_VC1: {
|
||||
sprintf(path, "/lib/firmware/nouveau/vuc-vc1-%u", profile - PIPE_VIDEO_PROFILE_VC1_SIMPLE);
|
||||
sprintf(path, "/lib/firmware/nouveau/vuc-vc1-0");
|
||||
break;
|
||||
}
|
||||
case PIPE_VIDEO_CODEC_MPEG4_AVC: {
|
||||
|
@@ -78,11 +78,11 @@ nve4_screen_compute_setup(struct nvc0_screen *screen,
|
||||
*/
|
||||
BEGIN_NVC0(push, NVE4_COMPUTE(MP_TEMP_SIZE_HIGH(0)), 3);
|
||||
PUSH_DATAh(push, screen->tls->size / screen->mp_count);
|
||||
PUSH_DATA (push, screen->tls->size / screen->mp_count);
|
||||
PUSH_DATA (push, (screen->tls->size / screen->mp_count) & ~0x7fff);
|
||||
PUSH_DATA (push, 0xff);
|
||||
BEGIN_NVC0(push, NVE4_COMPUTE(MP_TEMP_SIZE_HIGH(1)), 3);
|
||||
PUSH_DATAh(push, screen->tls->size / screen->mp_count);
|
||||
PUSH_DATA (push, screen->tls->size / screen->mp_count);
|
||||
PUSH_DATA (push, (screen->tls->size / screen->mp_count) & ~0x7fff);
|
||||
PUSH_DATA (push, 0xff);
|
||||
|
||||
/* Unified address space ? Who needs that ? Certainly not OpenCL.
|
||||
|
@@ -18,7 +18,8 @@ AM_CFLAGS = \
|
||||
$(RADEON_CFLAGS)
|
||||
|
||||
r300_compiler_tests_LDADD = libr300.la libr300-helper.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgallium.la
|
||||
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
|
||||
$(GALLIUM_DRI_LIB_DEPS)
|
||||
r300_compiler_tests_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/gallium/drivers/r300/compiler
|
||||
r300_compiler_tests_SOURCES = \
|
||||
|
@@ -80,7 +80,7 @@ static void test_runner_rc_optimize(struct test_result * result)
|
||||
|
||||
unsigned radeon_compiler_optimize_run_tests()
|
||||
{
|
||||
struct test tests[] = {
|
||||
static struct test tests[] = {
|
||||
{"rc_optimize() => peephole_mul_omod()", test_runner_rc_optimize},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@@ -91,8 +91,8 @@ static void tex_1d_swizzle(struct test_result *result)
|
||||
|
||||
unsigned radeon_compiler_regalloc_run_tests()
|
||||
{
|
||||
struct test tests[] = {
|
||||
{"rc_pair_regalloc() => TEX 1D Swizzle - r300", tex_1d_swizzle},
|
||||
static struct test tests[] = {
|
||||
{"rc_pair_regalloc() => TEX 1D Swizzle - r300", tex_1d_swizzle },
|
||||
{NULL, NULL}
|
||||
};
|
||||
return run_tests(tests);
|
||||
|
@@ -96,7 +96,7 @@ static void test_runner_rc_inst_can_use_presub(struct test_result * result)
|
||||
|
||||
unsigned radeon_compiler_util_run_tests()
|
||||
{
|
||||
struct test tests[] = {
|
||||
static struct test tests[] = {
|
||||
{"rc_inst_can_use_presub()", test_runner_rc_inst_can_use_presub},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@@ -104,7 +104,6 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
|
||||
case PIPE_CAP_USER_INDEX_BUFFERS:
|
||||
case PIPE_CAP_USER_CONSTANT_BUFFERS:
|
||||
case PIPE_CAP_DEPTH_CLIP_DISABLE: /* XXX implemented, but breaks Regnum Online */
|
||||
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
|
||||
return 1;
|
||||
|
||||
@@ -138,6 +137,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
|
||||
case PIPE_CAP_INDEP_BLEND_ENABLE:
|
||||
case PIPE_CAP_INDEP_BLEND_FUNC:
|
||||
case PIPE_CAP_DEPTH_CLIP_DISABLE:
|
||||
case PIPE_CAP_SHADER_STENCIL_EXPORT:
|
||||
case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
|
||||
case PIPE_CAP_TGSI_INSTANCEID:
|
||||
@@ -190,6 +190,8 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
/* Render targets. */
|
||||
case PIPE_CAP_MAX_RENDER_TARGETS:
|
||||
return 4;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1333,8 +1333,7 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
|
||||
|
||||
if (r300_screen(pipe->screen)->caps.has_tcl) {
|
||||
vap_clip_cntl = (state->clip_plane_enable & 63) |
|
||||
R300_PS_UCP_MODE_CLIP_AS_TRIFAN |
|
||||
(state->depth_clip ? 0 : R300_CLIP_DISABLE);
|
||||
R300_PS_UCP_MODE_CLIP_AS_TRIFAN;
|
||||
} else {
|
||||
vap_clip_cntl = R300_CLIP_DISABLE;
|
||||
}
|
||||
|
@@ -679,6 +679,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
|
||||
case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
|
||||
return PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_R600;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1490,7 +1490,8 @@ unsigned post_scheduler::try_add_instruction(node *n) {
|
||||
|
||||
// FIXME workaround for some problems with MULADD in trans slot on r700,
|
||||
// (is it really needed on r600?)
|
||||
if (a->bc.op == ALU_OP3_MULADD && !ctx.is_egcm()) {
|
||||
if ((a->bc.op == ALU_OP3_MULADD || a->bc.op == ALU_OP3_MULADD_IEEE) &&
|
||||
!ctx.is_egcm()) {
|
||||
allowed_slots &= 0x0F;
|
||||
}
|
||||
|
||||
|
@@ -124,7 +124,7 @@ unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_llvm_binary *binary,
|
||||
r = LLVMTargetMachineEmitToMemoryBuffer(tm, M, LLVMObjectFile, &err,
|
||||
&out_buffer);
|
||||
if (r) {
|
||||
fprintf(stderr, err);
|
||||
fprintf(stderr, "%s", err);
|
||||
FREE(err);
|
||||
return 1;
|
||||
}
|
||||
|
@@ -440,6 +440,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
|
||||
case PIPE_CAP_MAX_TEXEL_OFFSET:
|
||||
return 7;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -198,6 +198,8 @@ static void declare_input_fs(
|
||||
struct si_shader *shader = &si_shader_ctx->shader->shader;
|
||||
struct lp_build_context * base =
|
||||
&si_shader_ctx->radeon_bld.soa.bld_base.base;
|
||||
struct lp_build_context *uint =
|
||||
&si_shader_ctx->radeon_bld.soa.bld_base.uint_bld;
|
||||
struct gallivm_state * gallivm = base->gallivm;
|
||||
LLVMTypeRef input_type = LLVMFloatTypeInContext(gallivm->context);
|
||||
LLVMValueRef main_fn = si_shader_ctx->radeon_bld.main_fn;
|
||||
@@ -341,6 +343,22 @@ static void declare_input_fs(
|
||||
}
|
||||
|
||||
shader->ninterp++;
|
||||
} else if (decl->Semantic.Name == TGSI_SEMANTIC_FOG) {
|
||||
LLVMValueRef args[4];
|
||||
|
||||
args[0] = uint->zero;
|
||||
args[1] = attr_number;
|
||||
args[2] = params;
|
||||
args[3] = interp_param;
|
||||
si_shader_ctx->radeon_bld.inputs[radeon_llvm_reg_index_soa(input_index, 0)] =
|
||||
build_intrinsic(base->gallivm->builder, intr_name,
|
||||
input_type, args, args[3] ? 4 : 3,
|
||||
LLVMReadNoneAttribute | LLVMNoUnwindAttribute);
|
||||
si_shader_ctx->radeon_bld.inputs[radeon_llvm_reg_index_soa(input_index, 1)] =
|
||||
si_shader_ctx->radeon_bld.inputs[radeon_llvm_reg_index_soa(input_index, 2)] =
|
||||
lp_build_const_float(gallivm, 0.0f);
|
||||
si_shader_ctx->radeon_bld.inputs[radeon_llvm_reg_index_soa(input_index, 3)] =
|
||||
lp_build_const_float(gallivm, 1.0f);
|
||||
} else {
|
||||
for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
|
||||
LLVMValueRef args[4];
|
||||
@@ -562,12 +580,11 @@ static void si_alpha_test(struct lp_build_tgsi_context *bld_base,
|
||||
}
|
||||
|
||||
static void si_llvm_emit_clipvertex(struct lp_build_tgsi_context * bld_base,
|
||||
unsigned index)
|
||||
LLVMValueRef (*pos)[9], unsigned index)
|
||||
{
|
||||
struct si_shader_context *si_shader_ctx = si_shader_context(bld_base);
|
||||
struct lp_build_context *base = &bld_base->base;
|
||||
struct lp_build_context *uint = &si_shader_ctx->radeon_bld.soa.bld_base.uint_bld;
|
||||
LLVMValueRef args[9];
|
||||
unsigned reg_index;
|
||||
unsigned chan;
|
||||
unsigned const_chan;
|
||||
@@ -582,6 +599,8 @@ static void si_llvm_emit_clipvertex(struct lp_build_tgsi_context * bld_base,
|
||||
}
|
||||
|
||||
for (reg_index = 0; reg_index < 2; reg_index ++) {
|
||||
LLVMValueRef *args = pos[2 + reg_index];
|
||||
|
||||
args[5] =
|
||||
args[6] =
|
||||
args[7] =
|
||||
@@ -612,10 +631,6 @@ static void si_llvm_emit_clipvertex(struct lp_build_tgsi_context * bld_base,
|
||||
args[3] = lp_build_const_int32(base->gallivm,
|
||||
V_008DFC_SQ_EXP_POS + 2 + reg_index);
|
||||
args[4] = uint->zero;
|
||||
lp_build_intrinsic(base->gallivm->builder,
|
||||
"llvm.SI.export",
|
||||
LLVMVoidTypeInContext(base->gallivm->context),
|
||||
args, 9);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -630,17 +645,18 @@ static void si_llvm_emit_epilogue(struct lp_build_tgsi_context * bld_base)
|
||||
struct tgsi_parse_context *parse = &si_shader_ctx->parse;
|
||||
LLVMValueRef args[9];
|
||||
LLVMValueRef last_args[9] = { 0 };
|
||||
LLVMValueRef pos_args[4][9] = { { 0 } };
|
||||
unsigned semantic_name;
|
||||
unsigned color_count = 0;
|
||||
unsigned param_count = 0;
|
||||
int depth_index = -1, stencil_index = -1;
|
||||
int i;
|
||||
|
||||
while (!tgsi_parse_end_of_tokens(parse)) {
|
||||
struct tgsi_full_declaration *d =
|
||||
&parse->FullToken.FullDeclaration;
|
||||
unsigned target;
|
||||
unsigned index;
|
||||
int i;
|
||||
|
||||
tgsi_parse_token(parse);
|
||||
|
||||
@@ -716,7 +732,7 @@ handle_semantic:
|
||||
target = V_008DFC_SQ_EXP_POS + 2 + d->Semantic.Index;
|
||||
break;
|
||||
case TGSI_SEMANTIC_CLIPVERTEX:
|
||||
si_llvm_emit_clipvertex(bld_base, index);
|
||||
si_llvm_emit_clipvertex(bld_base, pos_args, index);
|
||||
shader->clip_dist_write = 0xFF;
|
||||
continue;
|
||||
case TGSI_SEMANTIC_FOG:
|
||||
@@ -734,9 +750,13 @@ handle_semantic:
|
||||
|
||||
si_llvm_init_export_args(bld_base, d, index, target, args);
|
||||
|
||||
if (si_shader_ctx->type == TGSI_PROCESSOR_VERTEX ?
|
||||
(semantic_name == TGSI_SEMANTIC_POSITION) :
|
||||
(semantic_name == TGSI_SEMANTIC_COLOR)) {
|
||||
if (si_shader_ctx->type == TGSI_PROCESSOR_VERTEX &&
|
||||
target >= V_008DFC_SQ_EXP_POS &&
|
||||
target <= (V_008DFC_SQ_EXP_POS + 3)) {
|
||||
memcpy(pos_args[target - V_008DFC_SQ_EXP_POS],
|
||||
args, sizeof(args));
|
||||
} else if (si_shader_ctx->type == TGSI_PROCESSOR_FRAGMENT &&
|
||||
semantic_name == TGSI_SEMANTIC_COLOR) {
|
||||
if (last_args[0]) {
|
||||
lp_build_intrinsic(base->gallivm->builder,
|
||||
"llvm.SI.export",
|
||||
@@ -784,7 +804,10 @@ handle_semantic:
|
||||
args[7] =
|
||||
args[8] =
|
||||
args[6] = LLVMBuildLoad(base->gallivm->builder, out_ptr, "");
|
||||
mask |= 0x2;
|
||||
/* Only setting the stencil component bit (0x2) here
|
||||
* breaks some stencil piglit tests
|
||||
*/
|
||||
mask |= 0x3;
|
||||
|
||||
if (depth_index < 0)
|
||||
args[5] = args[6];
|
||||
@@ -806,66 +829,87 @@ handle_semantic:
|
||||
memcpy(last_args, args, sizeof(args));
|
||||
}
|
||||
|
||||
if (!last_args[0]) {
|
||||
assert(si_shader_ctx->type == TGSI_PROCESSOR_FRAGMENT);
|
||||
if (si_shader_ctx->type == TGSI_PROCESSOR_VERTEX) {
|
||||
unsigned pos_idx = 0;
|
||||
|
||||
/* Specify which components to enable */
|
||||
last_args[0] = lp_build_const_int32(base->gallivm, 0x0);
|
||||
for (i = 0; i < 4; i++)
|
||||
if (pos_args[i][0])
|
||||
shader->nr_pos_exports++;
|
||||
|
||||
/* Specify the target we are exporting */
|
||||
last_args[3] = lp_build_const_int32(base->gallivm, V_008DFC_SQ_EXP_MRT);
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (!pos_args[i][0])
|
||||
continue;
|
||||
|
||||
/* Set COMPR flag to zero to export data as 32-bit */
|
||||
last_args[4] = uint->zero;
|
||||
|
||||
/* dummy bits */
|
||||
last_args[5]= uint->zero;
|
||||
last_args[6]= uint->zero;
|
||||
last_args[7]= uint->zero;
|
||||
last_args[8]= uint->zero;
|
||||
|
||||
si_shader_ctx->shader->spi_shader_col_format |=
|
||||
V_028714_SPI_SHADER_32_ABGR;
|
||||
si_shader_ctx->shader->cb_shader_mask |= S_02823C_OUTPUT0_ENABLE(0xf);
|
||||
}
|
||||
|
||||
/* Specify whether the EXEC mask represents the valid mask */
|
||||
last_args[1] = lp_build_const_int32(base->gallivm,
|
||||
si_shader_ctx->type == TGSI_PROCESSOR_FRAGMENT);
|
||||
|
||||
if (shader->fs_write_all && shader->nr_cbufs > 1) {
|
||||
int i;
|
||||
|
||||
/* Specify that this is not yet the last export */
|
||||
last_args[2] = lp_build_const_int32(base->gallivm, 0);
|
||||
|
||||
for (i = 1; i < shader->nr_cbufs; i++) {
|
||||
/* Specify the target we are exporting */
|
||||
last_args[3] = lp_build_const_int32(base->gallivm,
|
||||
V_008DFC_SQ_EXP_MRT + i);
|
||||
pos_args[i][3] = lp_build_const_int32(base->gallivm, V_008DFC_SQ_EXP_POS + pos_idx++);
|
||||
|
||||
if (pos_idx == shader->nr_pos_exports)
|
||||
/* Specify that this is the last export */
|
||||
pos_args[i][2] = uint->one;
|
||||
|
||||
lp_build_intrinsic(base->gallivm->builder,
|
||||
"llvm.SI.export",
|
||||
LLVMVoidTypeInContext(base->gallivm->context),
|
||||
last_args, 9);
|
||||
pos_args[i], 9);
|
||||
}
|
||||
} else {
|
||||
if (!last_args[0]) {
|
||||
/* Specify which components to enable */
|
||||
last_args[0] = lp_build_const_int32(base->gallivm, 0x0);
|
||||
|
||||
/* Specify the target we are exporting */
|
||||
last_args[3] = lp_build_const_int32(base->gallivm, V_008DFC_SQ_EXP_MRT);
|
||||
|
||||
/* Set COMPR flag to zero to export data as 32-bit */
|
||||
last_args[4] = uint->zero;
|
||||
|
||||
/* dummy bits */
|
||||
last_args[5]= uint->zero;
|
||||
last_args[6]= uint->zero;
|
||||
last_args[7]= uint->zero;
|
||||
last_args[8]= uint->zero;
|
||||
|
||||
si_shader_ctx->shader->spi_shader_col_format |=
|
||||
si_shader_ctx->shader->spi_shader_col_format << 4;
|
||||
si_shader_ctx->shader->cb_shader_mask |=
|
||||
si_shader_ctx->shader->cb_shader_mask << 4;
|
||||
V_028714_SPI_SHADER_32_ABGR;
|
||||
si_shader_ctx->shader->cb_shader_mask |= S_02823C_OUTPUT0_ENABLE(0xf);
|
||||
}
|
||||
|
||||
last_args[3] = lp_build_const_int32(base->gallivm, V_008DFC_SQ_EXP_MRT);
|
||||
/* Specify whether the EXEC mask represents the valid mask */
|
||||
last_args[1] = uint->one;
|
||||
|
||||
if (shader->fs_write_all && shader->nr_cbufs > 1) {
|
||||
int i;
|
||||
|
||||
/* Specify that this is not yet the last export */
|
||||
last_args[2] = lp_build_const_int32(base->gallivm, 0);
|
||||
|
||||
for (i = 1; i < shader->nr_cbufs; i++) {
|
||||
/* Specify the target we are exporting */
|
||||
last_args[3] = lp_build_const_int32(base->gallivm,
|
||||
V_008DFC_SQ_EXP_MRT + i);
|
||||
|
||||
lp_build_intrinsic(base->gallivm->builder,
|
||||
"llvm.SI.export",
|
||||
LLVMVoidTypeInContext(base->gallivm->context),
|
||||
last_args, 9);
|
||||
|
||||
si_shader_ctx->shader->spi_shader_col_format |=
|
||||
si_shader_ctx->shader->spi_shader_col_format << 4;
|
||||
si_shader_ctx->shader->cb_shader_mask |=
|
||||
si_shader_ctx->shader->cb_shader_mask << 4;
|
||||
}
|
||||
|
||||
last_args[3] = lp_build_const_int32(base->gallivm, V_008DFC_SQ_EXP_MRT);
|
||||
}
|
||||
|
||||
/* Specify that this is the last export */
|
||||
last_args[2] = lp_build_const_int32(base->gallivm, 1);
|
||||
|
||||
lp_build_intrinsic(base->gallivm->builder,
|
||||
"llvm.SI.export",
|
||||
LLVMVoidTypeInContext(base->gallivm->context),
|
||||
last_args, 9);
|
||||
}
|
||||
|
||||
/* Specify that this is the last export */
|
||||
last_args[2] = lp_build_const_int32(base->gallivm, 1);
|
||||
|
||||
lp_build_intrinsic(base->gallivm->builder,
|
||||
"llvm.SI.export",
|
||||
LLVMVoidTypeInContext(base->gallivm->context),
|
||||
last_args, 9);
|
||||
|
||||
/* XXX: Look up what this function does */
|
||||
/* ctx->shader->output[i].spi_sid = r600_spi_sid(&ctx->shader->output[i]);*/
|
||||
}
|
||||
|
@@ -113,6 +113,7 @@ struct si_shader {
|
||||
bool vs_out_misc_write;
|
||||
bool vs_out_point_size;
|
||||
unsigned nr_cbufs;
|
||||
unsigned nr_pos_exports;
|
||||
unsigned clip_dist_write;
|
||||
};
|
||||
|
||||
|
@@ -74,13 +74,13 @@ static void si_pipe_shader_vs(struct pipe_context *ctx, struct si_pipe_shader *s
|
||||
|
||||
si_pm4_set_reg(pm4, R_02870C_SPI_SHADER_POS_FORMAT,
|
||||
S_02870C_POS0_EXPORT_FORMAT(V_02870C_SPI_SHADER_4COMP) |
|
||||
S_02870C_POS1_EXPORT_FORMAT(shader->shader.vs_out_misc_write ?
|
||||
S_02870C_POS1_EXPORT_FORMAT(shader->shader.nr_pos_exports > 1 ?
|
||||
V_02870C_SPI_SHADER_4COMP :
|
||||
V_02870C_SPI_SHADER_NONE) |
|
||||
S_02870C_POS2_EXPORT_FORMAT((shader->shader.clip_dist_write & 0x0F) ?
|
||||
S_02870C_POS2_EXPORT_FORMAT(shader->shader.nr_pos_exports > 2 ?
|
||||
V_02870C_SPI_SHADER_4COMP :
|
||||
V_02870C_SPI_SHADER_NONE) |
|
||||
S_02870C_POS3_EXPORT_FORMAT((shader->shader.clip_dist_write & 0xF0) ?
|
||||
S_02870C_POS3_EXPORT_FORMAT(shader->shader.nr_pos_exports > 3 ?
|
||||
V_02870C_SPI_SHADER_4COMP :
|
||||
V_02870C_SPI_SHADER_NONE));
|
||||
|
||||
@@ -91,10 +91,10 @@ static void si_pipe_shader_vs(struct pipe_context *ctx, struct si_pipe_shader *s
|
||||
|
||||
num_user_sgprs = SI_VS_NUM_USER_SGPR;
|
||||
num_sgprs = shader->num_sgprs;
|
||||
if (num_user_sgprs > num_sgprs)
|
||||
num_sgprs = num_user_sgprs;
|
||||
/* Last 2 reserved SGPRs are used for VCC */
|
||||
num_sgprs += 2;
|
||||
if (num_user_sgprs > num_sgprs) {
|
||||
/* Last 2 reserved SGPRs are used for VCC */
|
||||
num_sgprs = num_user_sgprs + 2;
|
||||
}
|
||||
assert(num_sgprs <= 104);
|
||||
|
||||
vgpr_comp_cnt = shader->shader.uses_instanceid ? 3 : 0;
|
||||
@@ -190,7 +190,8 @@ static void si_pipe_shader_ps(struct pipe_context *ctx, struct si_pipe_shader *s
|
||||
exports_ps = 2;
|
||||
}
|
||||
|
||||
spi_ps_in_control = S_0286D8_NUM_INTERP(shader->shader.ninterp);
|
||||
spi_ps_in_control = S_0286D8_NUM_INTERP(shader->shader.ninterp) |
|
||||
S_0286D8_BC_OPTIMIZE_DISABLE(1);
|
||||
|
||||
spi_baryc_cntl = 0;
|
||||
if (have_perspective)
|
||||
@@ -235,10 +236,10 @@ static void si_pipe_shader_ps(struct pipe_context *ctx, struct si_pipe_shader *s
|
||||
|
||||
num_user_sgprs = SI_PS_NUM_USER_SGPR;
|
||||
num_sgprs = shader->num_sgprs;
|
||||
if (num_user_sgprs > num_sgprs)
|
||||
num_sgprs = num_user_sgprs;
|
||||
/* Last 2 reserved SGPRs are used for VCC */
|
||||
num_sgprs += 2;
|
||||
if (num_user_sgprs > num_sgprs) {
|
||||
/* Last 2 reserved SGPRs are used for VCC */
|
||||
num_sgprs = num_user_sgprs + 2;
|
||||
}
|
||||
assert(num_sgprs <= 104);
|
||||
|
||||
si_pm4_set_reg(pm4, R_00B028_SPI_SHADER_PGM_RSRC1_PS,
|
||||
|
@@ -183,6 +183,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
return 0;
|
||||
case PIPE_CAP_MAX_VIEWPORTS:
|
||||
return 1;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_NATIVE;
|
||||
}
|
||||
/* should only get here on unhandled cases */
|
||||
debug_printf("Unexpected PIPE_CAP %d query\n", param);
|
||||
|
@@ -270,6 +270,8 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
return 1;
|
||||
case PIPE_CAP_MAX_VIEWPORTS:
|
||||
return 1;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
}
|
||||
|
||||
debug_printf("Unexpected PIPE_CAP_ query %u\n", param);
|
||||
|
@@ -507,12 +507,22 @@ enum pipe_cap {
|
||||
PIPE_CAP_QUERY_PIPELINE_STATISTICS = 81,
|
||||
PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK = 82,
|
||||
PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE = 83,
|
||||
PIPE_CAP_MAX_VIEWPORTS = 84
|
||||
PIPE_CAP_MAX_VIEWPORTS = 84,
|
||||
PIPE_CAP_ENDIANNESS = 85
|
||||
};
|
||||
|
||||
#define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
|
||||
#define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_R600 (1 << 1)
|
||||
|
||||
enum pipe_endian {
|
||||
PIPE_ENDIAN_LITTLE = 0,
|
||||
PIPE_ENDIAN_BIG = 1,
|
||||
#if defined(PIPE_ARCH_LITTLE_ENDIAN)
|
||||
PIPE_ENDIAN_NATIVE = PIPE_ENDIAN_LITTLE
|
||||
#elif defined(PIPE_ARCH_BIG_ENDIAN)
|
||||
PIPE_ENDIAN_NATIVE = PIPE_ENDIAN_BIG
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation limits which are queried through
|
||||
|
@@ -239,8 +239,12 @@ struct st_visual
|
||||
*/
|
||||
struct st_config_options
|
||||
{
|
||||
boolean force_glsl_extensions_warn;
|
||||
boolean disable_glsl_line_continuations;
|
||||
boolean disable_blend_func_extended;
|
||||
boolean disable_glsl_line_continuations;
|
||||
boolean disable_shader_bit_encoding;
|
||||
boolean force_glsl_extensions_warn;
|
||||
unsigned force_glsl_version;
|
||||
boolean force_s3tc_enable;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -25,7 +25,7 @@ if HAVE_X11_DRIVER
|
||||
SUBDIRS += glx
|
||||
endif
|
||||
|
||||
if HAVE_OSMESA
|
||||
if HAVE_GALLIUM_OSMESA
|
||||
SUBDIRS += osmesa
|
||||
endif
|
||||
|
||||
|
@@ -192,7 +192,8 @@ clGetDeviceInfo(cl_device_id dev, cl_device_info param,
|
||||
return scalar_property<size_t>(buf, size, size_ret, 0);
|
||||
|
||||
case CL_DEVICE_ENDIAN_LITTLE:
|
||||
return scalar_property<cl_bool>(buf, size, size_ret, CL_TRUE);
|
||||
return scalar_property<cl_bool>(buf, size, size_ret,
|
||||
dev->endianness() == PIPE_ENDIAN_LITTLE);
|
||||
|
||||
case CL_DEVICE_AVAILABLE:
|
||||
case CL_DEVICE_COMPILER_AVAILABLE:
|
||||
|
@@ -192,3 +192,8 @@ _cl_device_id::ir_target() const {
|
||||
PIPE_COMPUTE_CAP_IR_TARGET);
|
||||
return { target.data() };
|
||||
}
|
||||
|
||||
enum pipe_endian
|
||||
_cl_device_id::endianness() const {
|
||||
return (enum pipe_endian)pipe->get_param(pipe, PIPE_CAP_ENDIANNESS);
|
||||
}
|
||||
|
@@ -66,6 +66,7 @@ public:
|
||||
std::string vendor_name() const;
|
||||
enum pipe_shader_ir ir_format() const;
|
||||
std::string ir_target() const;
|
||||
enum pipe_endian endianness() const;
|
||||
|
||||
friend struct _cl_command_queue;
|
||||
friend class clover::root_resource;
|
||||
|
@@ -22,31 +22,32 @@
|
||||
|
||||
#include "core/kernel.hpp"
|
||||
#include "core/resource.hpp"
|
||||
#include "util/u_math.h"
|
||||
#include "pipe/p_context.h"
|
||||
|
||||
using namespace clover;
|
||||
|
||||
_cl_kernel::_cl_kernel(clover::program &prog,
|
||||
const std::string &name,
|
||||
const std::vector<clover::module::argument> &args) :
|
||||
const std::vector<clover::module::argument> &margs) :
|
||||
prog(prog), __name(name), exec(*this) {
|
||||
for (auto arg : args) {
|
||||
if (arg.type == module::argument::scalar)
|
||||
this->args.emplace_back(new scalar_argument(arg.size));
|
||||
else if (arg.type == module::argument::global)
|
||||
this->args.emplace_back(new global_argument(arg.size));
|
||||
else if (arg.type == module::argument::local)
|
||||
this->args.emplace_back(new local_argument());
|
||||
else if (arg.type == module::argument::constant)
|
||||
this->args.emplace_back(new constant_argument());
|
||||
else if (arg.type == module::argument::image2d_rd ||
|
||||
arg.type == module::argument::image3d_rd)
|
||||
this->args.emplace_back(new image_rd_argument());
|
||||
else if (arg.type == module::argument::image2d_wr ||
|
||||
arg.type == module::argument::image3d_wr)
|
||||
this->args.emplace_back(new image_wr_argument());
|
||||
else if (arg.type == module::argument::sampler)
|
||||
this->args.emplace_back(new sampler_argument());
|
||||
for (auto marg : margs) {
|
||||
if (marg.type == module::argument::scalar)
|
||||
args.emplace_back(new scalar_argument(marg.size));
|
||||
else if (marg.type == module::argument::global)
|
||||
args.emplace_back(new global_argument);
|
||||
else if (marg.type == module::argument::local)
|
||||
args.emplace_back(new local_argument);
|
||||
else if (marg.type == module::argument::constant)
|
||||
args.emplace_back(new constant_argument);
|
||||
else if (marg.type == module::argument::image2d_rd ||
|
||||
marg.type == module::argument::image3d_rd)
|
||||
args.emplace_back(new image_rd_argument);
|
||||
else if (marg.type == module::argument::image2d_wr ||
|
||||
marg.type == module::argument::image3d_wr)
|
||||
args.emplace_back(new image_wr_argument);
|
||||
else if (marg.type == module::argument::sampler)
|
||||
args.emplace_back(new sampler_argument);
|
||||
else
|
||||
throw error(CL_INVALID_KERNEL_DEFINITION);
|
||||
}
|
||||
@@ -129,7 +130,6 @@ _cl_kernel::module(const clover::command_queue &q) const {
|
||||
return prog.binaries().find(&q.dev)->second;
|
||||
}
|
||||
|
||||
|
||||
_cl_kernel::exec_context::exec_context(clover::kernel &kern) :
|
||||
kern(kern), q(NULL), mem_local(0), st(NULL) {
|
||||
}
|
||||
@@ -143,8 +143,12 @@ void *
|
||||
_cl_kernel::exec_context::bind(clover::command_queue *__q) {
|
||||
std::swap(q, __q);
|
||||
|
||||
for (auto &arg : kern.args)
|
||||
arg->bind(*this);
|
||||
// Bind kernel arguments.
|
||||
auto margs = kern.module(*q).sym(kern.name()).args;
|
||||
for_each([=](std::unique_ptr<kernel::argument> &karg,
|
||||
const module::argument &marg) {
|
||||
karg->bind(*this, marg);
|
||||
}, kern.args.begin(), kern.args.end(), margs.begin());
|
||||
|
||||
// Create a new compute state if anything changed.
|
||||
if (!st || q != __q ||
|
||||
@@ -176,8 +180,83 @@ _cl_kernel::exec_context::unbind() {
|
||||
mem_local = 0;
|
||||
}
|
||||
|
||||
_cl_kernel::argument::argument(size_t size) :
|
||||
__size(size), __set(false) {
|
||||
namespace {
|
||||
template<typename T>
|
||||
std::vector<uint8_t>
|
||||
bytes(const T& x) {
|
||||
return { (uint8_t *)&x, (uint8_t *)&x + sizeof(x) };
|
||||
}
|
||||
|
||||
///
|
||||
/// Transform buffer \a v from the native byte order into the byte
|
||||
/// order specified by \a e.
|
||||
///
|
||||
template<typename T>
|
||||
void
|
||||
byteswap(T &v, pipe_endian e) {
|
||||
if (PIPE_ENDIAN_NATIVE != e)
|
||||
std::reverse(v.begin(), v.end());
|
||||
}
|
||||
|
||||
///
|
||||
/// Pad buffer \a v to the next multiple of \a n.
|
||||
///
|
||||
template<typename T>
|
||||
void
|
||||
align(T &v, size_t n) {
|
||||
v.resize(util_align_npot(v.size(), n));
|
||||
}
|
||||
|
||||
bool
|
||||
msb(const std::vector<uint8_t> &s) {
|
||||
if (PIPE_ENDIAN_NATIVE == PIPE_ENDIAN_LITTLE)
|
||||
return s.back() & 0x80;
|
||||
else
|
||||
return s.front() & 0x80;
|
||||
}
|
||||
|
||||
///
|
||||
/// Resize buffer \a v to size \a n using sign or zero extension
|
||||
/// according to \a ext.
|
||||
///
|
||||
template<typename T>
|
||||
void
|
||||
extend(T &v, enum clover::module::argument::ext_type ext, size_t n) {
|
||||
const size_t m = std::min(v.size(), n);
|
||||
const bool sign_ext = (ext == module::argument::sign_ext);
|
||||
const uint8_t fill = (sign_ext && msb(v) ? ~0 : 0);
|
||||
T w(n, fill);
|
||||
|
||||
if (PIPE_ENDIAN_NATIVE == PIPE_ENDIAN_LITTLE)
|
||||
std::copy_n(v.begin(), m, w.begin());
|
||||
else
|
||||
std::copy_n(v.end() - m, m, w.end() - m);
|
||||
|
||||
std::swap(v, w);
|
||||
}
|
||||
|
||||
///
|
||||
/// Append buffer \a w to \a v.
|
||||
///
|
||||
template<typename T>
|
||||
void
|
||||
insert(T &v, const T &w) {
|
||||
v.insert(v.end(), w.begin(), w.end());
|
||||
}
|
||||
|
||||
///
|
||||
/// Append \a n elements to the end of buffer \a v.
|
||||
///
|
||||
template<typename T>
|
||||
size_t
|
||||
allocate(T &v, size_t n) {
|
||||
size_t pos = v.size();
|
||||
v.resize(pos + n);
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
|
||||
_cl_kernel::argument::argument() : __set(false) {
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -190,13 +269,12 @@ _cl_kernel::argument::storage() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
_cl_kernel::scalar_argument::scalar_argument(size_t size) :
|
||||
argument(size) {
|
||||
_cl_kernel::scalar_argument::scalar_argument(size_t size) : size(size) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::scalar_argument::set(size_t size, const void *value) {
|
||||
if (size != __size)
|
||||
if (size != this->size)
|
||||
throw error(CL_INVALID_ARG_SIZE);
|
||||
|
||||
v = { (uint8_t *)value, (uint8_t *)value + size };
|
||||
@@ -204,18 +282,20 @@ _cl_kernel::scalar_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::scalar_argument::bind(exec_context &ctx) {
|
||||
ctx.input.insert(ctx.input.end(), v.begin(), v.end());
|
||||
_cl_kernel::scalar_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
auto w = v;
|
||||
|
||||
extend(w, marg.ext_type, marg.target_size);
|
||||
byteswap(w, ctx.q->dev.endianness());
|
||||
align(ctx.input, marg.target_align);
|
||||
insert(ctx.input, w);
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::scalar_argument::unbind(exec_context &ctx) {
|
||||
}
|
||||
|
||||
_cl_kernel::global_argument::global_argument(size_t size) :
|
||||
argument(size) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::global_argument::set(size_t size, const void *value) {
|
||||
if (size != sizeof(cl_mem))
|
||||
@@ -229,27 +309,17 @@ _cl_kernel::global_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::global_argument::bind(exec_context &ctx) {
|
||||
size_t offset = ctx.input.size();
|
||||
size_t idx = ctx.g_buffers.size();
|
||||
|
||||
ctx.input.resize(offset + __size);
|
||||
|
||||
ctx.g_buffers.resize(idx + 1);
|
||||
ctx.g_buffers[idx] = obj->resource(ctx.q).pipe;
|
||||
|
||||
ctx.g_handles.resize(idx + 1);
|
||||
ctx.g_handles[idx] = offset;
|
||||
_cl_kernel::global_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
align(ctx.input, marg.target_align);
|
||||
ctx.g_handles.push_back(allocate(ctx.input, marg.target_size));
|
||||
ctx.g_buffers.push_back(obj->resource(ctx.q).pipe);
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::global_argument::unbind(exec_context &ctx) {
|
||||
}
|
||||
|
||||
_cl_kernel::local_argument::local_argument() :
|
||||
argument(sizeof(uint32_t)) {
|
||||
}
|
||||
|
||||
size_t
|
||||
_cl_kernel::local_argument::storage() const {
|
||||
return __storage;
|
||||
@@ -265,12 +335,14 @@ _cl_kernel::local_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::local_argument::bind(exec_context &ctx) {
|
||||
size_t offset = ctx.input.size();
|
||||
size_t ptr = ctx.mem_local;
|
||||
_cl_kernel::local_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
auto v = bytes(ctx.mem_local);
|
||||
|
||||
ctx.input.resize(offset + sizeof(uint32_t));
|
||||
*(uint32_t *)&ctx.input[offset] = ptr;
|
||||
extend(v, module::argument::zero_ext, marg.target_size);
|
||||
byteswap(v, ctx.q->dev.endianness());
|
||||
align(ctx.input, marg.target_align);
|
||||
insert(ctx.input, v);
|
||||
|
||||
ctx.mem_local += __storage;
|
||||
}
|
||||
@@ -279,10 +351,6 @@ void
|
||||
_cl_kernel::local_argument::unbind(exec_context &ctx) {
|
||||
}
|
||||
|
||||
_cl_kernel::constant_argument::constant_argument() :
|
||||
argument(sizeof(uint32_t)) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::constant_argument::set(size_t size, const void *value) {
|
||||
if (size != sizeof(cl_mem))
|
||||
@@ -296,15 +364,17 @@ _cl_kernel::constant_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::constant_argument::bind(exec_context &ctx) {
|
||||
size_t offset = ctx.input.size();
|
||||
size_t idx = ctx.resources.size();
|
||||
_cl_kernel::constant_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
auto v = bytes(ctx.resources.size() << 24);
|
||||
|
||||
ctx.input.resize(offset + sizeof(uint32_t));
|
||||
*(uint32_t *)&ctx.input[offset] = idx << 24;
|
||||
extend(v, module::argument::zero_ext, marg.target_size);
|
||||
byteswap(v, ctx.q->dev.endianness());
|
||||
align(ctx.input, marg.target_align);
|
||||
insert(ctx.input, v);
|
||||
|
||||
ctx.resources.resize(idx + 1);
|
||||
ctx.resources[idx] = st = obj->resource(ctx.q).bind_surface(*ctx.q, false);
|
||||
st = obj->resource(ctx.q).bind_surface(*ctx.q, false);
|
||||
ctx.resources.push_back(st);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -312,10 +382,6 @@ _cl_kernel::constant_argument::unbind(exec_context &ctx) {
|
||||
obj->resource(ctx.q).unbind_surface(*ctx.q, st);
|
||||
}
|
||||
|
||||
_cl_kernel::image_rd_argument::image_rd_argument() :
|
||||
argument(sizeof(uint32_t)) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::image_rd_argument::set(size_t size, const void *value) {
|
||||
if (size != sizeof(cl_mem))
|
||||
@@ -329,15 +395,17 @@ _cl_kernel::image_rd_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::image_rd_argument::bind(exec_context &ctx) {
|
||||
size_t offset = ctx.input.size();
|
||||
size_t idx = ctx.sviews.size();
|
||||
_cl_kernel::image_rd_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
auto v = bytes(ctx.sviews.size());
|
||||
|
||||
ctx.input.resize(offset + sizeof(uint32_t));
|
||||
*(uint32_t *)&ctx.input[offset] = idx;
|
||||
extend(v, module::argument::zero_ext, marg.target_size);
|
||||
byteswap(v, ctx.q->dev.endianness());
|
||||
align(ctx.input, marg.target_align);
|
||||
insert(ctx.input, v);
|
||||
|
||||
ctx.sviews.resize(idx + 1);
|
||||
ctx.sviews[idx] = st = obj->resource(ctx.q).bind_sampler_view(*ctx.q);
|
||||
st = obj->resource(ctx.q).bind_sampler_view(*ctx.q);
|
||||
ctx.sviews.push_back(st);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -345,10 +413,6 @@ _cl_kernel::image_rd_argument::unbind(exec_context &ctx) {
|
||||
obj->resource(ctx.q).unbind_sampler_view(*ctx.q, st);
|
||||
}
|
||||
|
||||
_cl_kernel::image_wr_argument::image_wr_argument() :
|
||||
argument(sizeof(uint32_t)) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::image_wr_argument::set(size_t size, const void *value) {
|
||||
if (size != sizeof(cl_mem))
|
||||
@@ -362,15 +426,17 @@ _cl_kernel::image_wr_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::image_wr_argument::bind(exec_context &ctx) {
|
||||
size_t offset = ctx.input.size();
|
||||
size_t idx = ctx.resources.size();
|
||||
_cl_kernel::image_wr_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
auto v = bytes(ctx.resources.size());
|
||||
|
||||
ctx.input.resize(offset + sizeof(uint32_t));
|
||||
*(uint32_t *)&ctx.input[offset] = idx;
|
||||
extend(v, module::argument::zero_ext, marg.target_size);
|
||||
byteswap(v, ctx.q->dev.endianness());
|
||||
align(ctx.input, marg.target_align);
|
||||
insert(ctx.input, v);
|
||||
|
||||
ctx.resources.resize(idx + 1);
|
||||
ctx.resources[idx] = st = obj->resource(ctx.q).bind_surface(*ctx.q, true);
|
||||
st = obj->resource(ctx.q).bind_surface(*ctx.q, true);
|
||||
ctx.resources.push_back(st);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -378,10 +444,6 @@ _cl_kernel::image_wr_argument::unbind(exec_context &ctx) {
|
||||
obj->resource(ctx.q).unbind_surface(*ctx.q, st);
|
||||
}
|
||||
|
||||
_cl_kernel::sampler_argument::sampler_argument() :
|
||||
argument(0) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::sampler_argument::set(size_t size, const void *value) {
|
||||
if (size != sizeof(cl_sampler))
|
||||
@@ -392,11 +454,10 @@ _cl_kernel::sampler_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::sampler_argument::bind(exec_context &ctx) {
|
||||
size_t idx = ctx.samplers.size();
|
||||
|
||||
ctx.samplers.resize(idx + 1);
|
||||
ctx.samplers[idx] = st = obj->bind(*ctx.q);
|
||||
_cl_kernel::sampler_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
st = obj->bind(*ctx.q);
|
||||
ctx.samplers.push_back(st);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -68,14 +68,11 @@ private:
|
||||
public:
|
||||
class argument {
|
||||
public:
|
||||
argument(size_t size);
|
||||
argument();
|
||||
|
||||
/// \a true if the argument has been set.
|
||||
bool set() const;
|
||||
|
||||
/// Argument size in the input buffer.
|
||||
size_t size() const;
|
||||
|
||||
/// Storage space required for the referenced object.
|
||||
virtual size_t storage() const;
|
||||
|
||||
@@ -84,19 +81,19 @@ public:
|
||||
|
||||
/// Allocate the necessary resources to bind the specified
|
||||
/// object to this argument, and update \a ctx accordingly.
|
||||
virtual void bind(exec_context &ctx) = 0;
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) = 0;
|
||||
|
||||
/// Free any resources that were allocated in bind().
|
||||
virtual void unbind(exec_context &ctx) = 0;
|
||||
|
||||
protected:
|
||||
size_t __size;
|
||||
bool __set;
|
||||
};
|
||||
|
||||
_cl_kernel(clover::program &prog,
|
||||
const std::string &name,
|
||||
const std::vector<clover::module::argument> &args);
|
||||
const std::vector<clover::module::argument> &margs);
|
||||
|
||||
void launch(clover::command_queue &q,
|
||||
const std::vector<size_t> &grid_offset,
|
||||
@@ -122,19 +119,20 @@ private:
|
||||
scalar_argument(size_t size);
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
size_t size;
|
||||
std::vector<uint8_t> v;
|
||||
};
|
||||
|
||||
class global_argument : public argument {
|
||||
public:
|
||||
global_argument(size_t size);
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
@@ -143,12 +141,11 @@ private:
|
||||
|
||||
class local_argument : public argument {
|
||||
public:
|
||||
local_argument();
|
||||
|
||||
virtual size_t storage() const;
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
@@ -157,10 +154,9 @@ private:
|
||||
|
||||
class constant_argument : public argument {
|
||||
public:
|
||||
constant_argument();
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
@@ -170,10 +166,9 @@ private:
|
||||
|
||||
class image_rd_argument : public argument {
|
||||
public:
|
||||
image_rd_argument();
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
@@ -183,10 +178,9 @@ private:
|
||||
|
||||
class image_wr_argument : public argument {
|
||||
public:
|
||||
image_wr_argument();
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
@@ -196,10 +190,9 @@ private:
|
||||
|
||||
class sampler_argument : public argument {
|
||||
public:
|
||||
sampler_argument();
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
|
@@ -68,11 +68,32 @@ namespace clover {
|
||||
sampler
|
||||
};
|
||||
|
||||
argument(enum type type, size_t size) : type(type), size(size) { }
|
||||
argument() : type(scalar), size(0) { }
|
||||
enum ext_type {
|
||||
zero_ext,
|
||||
sign_ext
|
||||
};
|
||||
|
||||
argument(enum type type, size_t size,
|
||||
size_t target_size, size_t target_align,
|
||||
enum ext_type ext_type) :
|
||||
type(type), size(size),
|
||||
target_size(target_size), target_align(target_align),
|
||||
ext_type(ext_type) { }
|
||||
|
||||
argument(enum type type, size_t size) :
|
||||
type(type), size(size),
|
||||
target_size(size), target_align(1),
|
||||
ext_type(zero_ext) { }
|
||||
|
||||
argument() : type(scalar), size(0),
|
||||
target_size(0), target_align(1),
|
||||
ext_type(zero_ext) { }
|
||||
|
||||
type type;
|
||||
size_t size;
|
||||
size_t target_size;
|
||||
size_t target_align;
|
||||
ext_type ext_type;
|
||||
};
|
||||
|
||||
struct symbol {
|
||||
|
@@ -174,7 +174,7 @@ mapping::mapping(command_queue &q, resource &r,
|
||||
pctx(q.pipe) {
|
||||
unsigned usage = ((flags & CL_MAP_WRITE ? PIPE_TRANSFER_WRITE : 0 ) |
|
||||
(flags & CL_MAP_READ ? PIPE_TRANSFER_READ : 0 ) |
|
||||
(blocking ? PIPE_TRANSFER_UNSYNCHRONIZED : 0));
|
||||
(!blocking ? PIPE_TRANSFER_UNSYNCHRONIZED : 0));
|
||||
|
||||
p = pctx->transfer_map(pctx, r.pipe, 0, usage,
|
||||
box(origin + r.offset, region), &pxfer);
|
||||
|
@@ -304,14 +304,21 @@ namespace {
|
||||
for (llvm::Function::arg_iterator I = kernel_func->arg_begin(),
|
||||
E = kernel_func->arg_end(); I != E; ++I) {
|
||||
llvm::Argument &arg = *I;
|
||||
llvm::Type *arg_type = arg.getType();
|
||||
#if HAVE_LLVM < 0x0302
|
||||
llvm::TargetData TD(kernel_func->getParent());
|
||||
#else
|
||||
llvm::DataLayout TD(kernel_func->getParent()->getDataLayout());
|
||||
#endif
|
||||
|
||||
llvm::Type *arg_type = arg.getType();
|
||||
unsigned arg_size = TD.getTypeStoreSize(arg_type);
|
||||
|
||||
llvm::Type *target_type = arg_type->isIntegerTy() ?
|
||||
TD.getSmallestLegalIntType(mod->getContext(), arg_size * 8) :
|
||||
arg_type;
|
||||
unsigned target_size = TD.getTypeStoreSize(target_type);
|
||||
unsigned target_align = TD.getABITypeAlignment(target_type);
|
||||
|
||||
if (llvm::isa<llvm::PointerType>(arg_type) && arg.hasByValAttr()) {
|
||||
arg_type =
|
||||
llvm::dyn_cast<llvm::PointerType>(arg_type)->getElementType();
|
||||
@@ -324,11 +331,24 @@ namespace {
|
||||
unsigned address_space = llvm::cast<llvm::PointerType>(arg_type)->getAddressSpace();
|
||||
switch (address_space) {
|
||||
default:
|
||||
args.push_back(module::argument(module::argument::global, arg_size));
|
||||
args.push_back(
|
||||
module::argument(module::argument::global, arg_size,
|
||||
target_size, target_align,
|
||||
module::argument::zero_ext));
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
args.push_back(module::argument(module::argument::scalar, arg_size));
|
||||
llvm::AttributeSet attrs = kernel_func->getAttributes();
|
||||
enum module::argument::ext_type ext_type =
|
||||
(attrs.hasAttribute(arg.getArgNo() + 1,
|
||||
llvm::Attribute::SExt) ?
|
||||
module::argument::sign_ext :
|
||||
module::argument::zero_ext);
|
||||
|
||||
args.push_back(
|
||||
module::argument(module::argument::scalar, arg_size,
|
||||
target_size, target_align, ext_type));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -52,10 +52,18 @@ dri_pp_query(struct dri_context *ctx)
|
||||
static void dri_fill_st_options(struct st_config_options *options,
|
||||
const struct driOptionCache * optionCache)
|
||||
{
|
||||
options->force_glsl_extensions_warn =
|
||||
driQueryOptionb(optionCache, "force_glsl_extensions_warn");
|
||||
options->disable_blend_func_extended =
|
||||
driQueryOptionb(optionCache, "disable_blend_func_extended");
|
||||
options->disable_glsl_line_continuations =
|
||||
driQueryOptionb(optionCache, "disable_glsl_line_continuations");
|
||||
options->disable_shader_bit_encoding =
|
||||
driQueryOptionb(optionCache, "disable_shader_bit_encoding");
|
||||
options->force_glsl_extensions_warn =
|
||||
driQueryOptionb(optionCache, "force_glsl_extensions_warn");
|
||||
options->force_glsl_version =
|
||||
driQueryOptioni(optionCache, "force_glsl_version");
|
||||
options->force_s3tc_enable =
|
||||
driQueryOptionb(optionCache, "force_s3tc_enable");
|
||||
}
|
||||
|
||||
GLboolean
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include "state_tracker/drm_driver.h"
|
||||
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_format_s3tc.h"
|
||||
|
||||
#define MSAA_VISUAL_MAX_SAMPLES 32
|
||||
|
||||
@@ -48,14 +49,8 @@
|
||||
|
||||
PUBLIC const char __driConfigOptions[] =
|
||||
DRI_CONF_BEGIN
|
||||
DRI_CONF_SECTION_PERFORMANCE
|
||||
DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
|
||||
DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
|
||||
DRI_CONF_SECTION_END
|
||||
|
||||
DRI_CONF_SECTION_QUALITY
|
||||
/* DRI_CONF_FORCE_S3TC_ENABLE("false") */
|
||||
DRI_CONF_ALLOW_LARGE_TEXTURES(1)
|
||||
DRI_CONF_FORCE_S3TC_ENABLE("false")
|
||||
DRI_CONF_PP_CELSHADE(0)
|
||||
DRI_CONF_PP_NORED(0)
|
||||
DRI_CONF_PP_NOGREEN(0)
|
||||
@@ -67,6 +62,9 @@ PUBLIC const char __driConfigOptions[] =
|
||||
DRI_CONF_SECTION_DEBUG
|
||||
DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN("false")
|
||||
DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
|
||||
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
|
||||
DRI_CONF_DISABLE_SHADER_BIT_ENCODING("false")
|
||||
DRI_CONF_FORCE_GLSL_VERSION(0)
|
||||
DRI_CONF_SECTION_END
|
||||
|
||||
DRI_CONF_SECTION_MISCELLANEOUS
|
||||
@@ -76,7 +74,7 @@ PUBLIC const char __driConfigOptions[] =
|
||||
|
||||
#define false 0
|
||||
|
||||
static const uint __driNConfigOptions = 12;
|
||||
static const uint __driNConfigOptions = 13;
|
||||
|
||||
static const __DRIconfig **
|
||||
dri_fill_in_modes(struct dri_screen *screen)
|
||||
@@ -416,6 +414,20 @@ dri_init_screen_helper(struct dri_screen *screen,
|
||||
screen->sPriv->myNum,
|
||||
driver_descriptor.name);
|
||||
|
||||
/* Handle force_s3tc_enable. */
|
||||
if (!util_format_s3tc_enabled &&
|
||||
driQueryOptionb(&screen->optionCache, "force_s3tc_enable")) {
|
||||
/* Ensure libtxc_dxtn has been loaded if available.
|
||||
* Forcing S3TC on before calling this would prevent loading
|
||||
* the library.
|
||||
* This is just a precaution, the driver should have called it
|
||||
* already.
|
||||
*/
|
||||
util_format_s3tc_init();
|
||||
|
||||
util_format_s3tc_enabled = TRUE;
|
||||
}
|
||||
|
||||
return dri_fill_in_modes(screen);
|
||||
}
|
||||
|
||||
|
@@ -543,6 +543,11 @@ OSMesaCreateContextExt(GLenum format, GLint depthBits, GLint stencilBits,
|
||||
attribs.minor = 1;
|
||||
attribs.flags = 0; /* ST_CONTEXT_FLAG_x */
|
||||
attribs.options.force_glsl_extensions_warn = FALSE;
|
||||
attribs.options.disable_blend_func_extended = FALSE;
|
||||
attribs.options.disable_glsl_line_continuations = FALSE;
|
||||
attribs.options.disable_shader_bit_encoding = FALSE;
|
||||
attribs.options.force_s3tc_enable = FALSE;
|
||||
attribs.options.force_glsl_version = 0;
|
||||
|
||||
osmesa_init_st_visual(&attribs.visual,
|
||||
PIPE_FORMAT_R8G8B8A8_UNORM,
|
||||
@@ -611,10 +616,11 @@ OSMesaMakeCurrent(OSMesaContext osmesa, void *buffer, GLenum type,
|
||||
struct osmesa_buffer *osbuffer;
|
||||
enum pipe_format color_format;
|
||||
|
||||
if (osmesa->format == OSMESA_RGB_565 && type != GL_UNSIGNED_SHORT_5_6_5) {
|
||||
if (!osmesa || !buffer || width < 1 || height < 1) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
if (width < 1 || height < 1) {
|
||||
|
||||
if (osmesa->format == OSMESA_RGB_565 && type != GL_UNSIGNED_SHORT_5_6_5) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ if HAVE_X11_DRIVER
|
||||
SUBDIRS += libgl-xlib
|
||||
endif
|
||||
|
||||
if HAVE_OSMESA
|
||||
if HAVE_GALLIUM_OSMESA
|
||||
SUBDIRS += osmesa
|
||||
endif
|
||||
|
||||
|
@@ -40,10 +40,9 @@ lib@OSMESA_LIB@_la_SOURCES = target.c
|
||||
|
||||
lib@OSMESA_LIB@_la_LDFLAGS = -module -version-number @OSMESA_VERSION@ -no-undefined
|
||||
|
||||
if HAVE_SHARED_GLAPI
|
||||
GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la
|
||||
else
|
||||
GLAPI_LIB = $(top_builddir)/src/mapi/glapi/libglapi.la
|
||||
if HAVE_SHARED_GLAPI
|
||||
GLAPI_LIB += $(top_builddir)/src/mapi/shared-glapi/libglapi.la
|
||||
endif
|
||||
|
||||
lib@OSMESA_LIB@_la_LIBADD = \
|
||||
@@ -58,19 +57,12 @@ lib@OSMESA_LIB@_la_LIBADD = \
|
||||
$(CLOCK_LIB)
|
||||
|
||||
|
||||
nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy.cpp
|
||||
|
||||
if HAVE_MESA_LLVM
|
||||
lib@OSMESA_LIB@_la_LINK = $(CXXLINK) $(lib@OSMESA_LIB@_la_LDFLAGS)
|
||||
# Mention a dummy pure C++ file to trigger generation of the $(LINK) variable
|
||||
nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy-cpp.cpp
|
||||
|
||||
lib@OSMESA_LIB@_la_LIBADD += $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
|
||||
AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
|
||||
lib@OSMESA_LIB@_la_LDFLAGS += $(LLVM_LDFLAGS)
|
||||
else
|
||||
lib@OSMESA_LIB@_la_LINK = $(CXXLINK) $(lib@OSMESA_LIB@_la_LDFLAGS)
|
||||
# Mention a dummy pure C file to trigger generation of the $(LINK) variable
|
||||
nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy-c.c
|
||||
lib@OSMESA_LIB@_la_LIBADD += $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
|
||||
endif
|
||||
|
||||
|
||||
@@ -83,9 +75,8 @@ all-local: lib@OSMESA_LIB@.la
|
||||
$(MKDIR_P) $(top_builddir)/$(LIB_DIR)/gallium;
|
||||
ln -f .libs/lib@OSMESA_LIB@.so $(top_builddir)/$(LIB_DIR)/gallium/lib@OSMESA_LIB@.so;
|
||||
ln -f .libs/lib@OSMESA_LIB@.so.@OSMESA_VERSION@ $(top_builddir)/$(LIB_DIR)/gallium/lib@OSMESA_LIB@.so.@OSMESA_VERSION@;
|
||||
cp .libs/lib@OSMESA_LIB@.so.@OSMESA_VERSION@.0.0 $(top_builddir)/$(LIB_DIR)/gallium/
|
||||
ln -f .libs/lib@OSMESA_LIB@.so.@OSMESA_VERSION@.0.0 $(top_builddir)/$(LIB_DIR)/gallium/
|
||||
endif
|
||||
|
||||
# XXX fix-up?
|
||||
#pkgconfigdir = $(libdir)/pkgconfig
|
||||
#pkgconfig_DATA = osmesa.pc
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = osmesa.pc
|
||||
|
12
src/gallium/targets/osmesa/osmesa.pc.in
Normal file
12
src/gallium/targets/osmesa/osmesa.pc.in
Normal file
@@ -0,0 +1,12 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=${prefix}
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: osmesa
|
||||
Description: Mesa Off-screen Rendering library
|
||||
Requires: @OSMESA_PC_REQ@
|
||||
Version: @OSMESA_VERSION@
|
||||
Libs: -L${libdir} -l@OSMESA_LIB@
|
||||
Libs.private: @OSMESA_PC_LIB_PRIV@
|
||||
Cflags: -I${includedir}
|
@@ -404,7 +404,7 @@ static boolean do_winsys_init(struct radeon_drm_winsys *ws)
|
||||
&ws->info.r600_ib_vm_max_size))
|
||||
ws->info.r600_virtual_address = FALSE;
|
||||
}
|
||||
if (ws->gen == DRV_R600 && !debug_get_bool_option("RADEON_VA", TRUE))
|
||||
if (ws->gen == DRV_R600 && !debug_get_bool_option("RADEON_VA", FALSE))
|
||||
ws->info.r600_virtual_address = FALSE;
|
||||
}
|
||||
|
||||
|
@@ -24,6 +24,7 @@ libgbm_la_LIBADD = $(LIBUDEV_LIBS) $(LIBKMS_LIBS) $(DLOPEN_LIBS)
|
||||
if HAVE_EGL_PLATFORM_WAYLAND
|
||||
AM_CPPFLAGS = -DHAVE_WAYLAND_PLATFORM
|
||||
AM_CFLAGS += $(WAYLAND_CFLAGS)
|
||||
libgbm_la_LIBADD += $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la $(WAYLAND_LIBS)
|
||||
endif
|
||||
|
||||
if HAVE_DRI
|
||||
@@ -38,7 +39,7 @@ libgbm_dri_la_CFLAGS = \
|
||||
$(LIBDRM_CFLAGS)
|
||||
|
||||
libgbm_la_LIBADD += \
|
||||
libgbm_dri.la $(top_builddir)/src/mapi/shared-glapi/libglapi.la
|
||||
libgbm_dri.la $(top_builddir)/src/mapi/shared-glapi/libglapi.la $(LIBDRM_LIBS)
|
||||
endif
|
||||
|
||||
all-local: libgbm.la
|
||||
|
@@ -598,6 +598,10 @@ public:
|
||||
virtual void print(void) const;
|
||||
bool has_qualifiers() const;
|
||||
|
||||
const struct glsl_type *glsl_type(const char **name,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
const;
|
||||
|
||||
ast_type_qualifier qualifier;
|
||||
ast_type_specifier *specifier;
|
||||
};
|
||||
@@ -623,12 +627,6 @@ public:
|
||||
* is used to note these cases when no type is specified.
|
||||
*/
|
||||
int invariant;
|
||||
|
||||
/**
|
||||
* Flag indicating that these declarators are in a uniform block,
|
||||
* allowing UBO type qualifiers.
|
||||
*/
|
||||
bool ubo_qualifiers_valid;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -1771,12 +1771,6 @@ process_array_type(YYLTYPE *loc, const glsl_type *base, ast_node *array_size,
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (state->es_shader) {
|
||||
/* Section 10.17 of the GLSL ES 1.00 specification states that unsized
|
||||
* array declarations have been removed from the language.
|
||||
*/
|
||||
_mesa_glsl_error(loc, state, "unsized array declarations are not "
|
||||
"allowed in GLSL ES 1.00.");
|
||||
}
|
||||
|
||||
const glsl_type *array_type = glsl_type::get_array_instance(base, length);
|
||||
@@ -1801,6 +1795,28 @@ ast_type_specifier::glsl_type(const char **name,
|
||||
return type;
|
||||
}
|
||||
|
||||
const glsl_type *
|
||||
ast_fully_specified_type::glsl_type(const char **name,
|
||||
struct _mesa_glsl_parse_state *state) const
|
||||
{
|
||||
const struct glsl_type *type = this->specifier->glsl_type(name, state);
|
||||
|
||||
if (type == NULL)
|
||||
return NULL;
|
||||
|
||||
if (type->base_type == GLSL_TYPE_FLOAT
|
||||
&& state->es_shader
|
||||
&& state->target == fragment_shader
|
||||
&& this->qualifier.precision == ast_precision_none
|
||||
&& state->symbols->get_variable("#default precision") == NULL) {
|
||||
YYLTYPE loc = this->get_location();
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"no precision specified this scope for type `%s'",
|
||||
type->name);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether a toplevel variable declaration declares a varying. This
|
||||
@@ -1831,13 +1847,28 @@ is_varying_var(ir_variable *var, _mesa_glsl_parser_targets target)
|
||||
static void
|
||||
validate_matrix_layout_for_type(struct _mesa_glsl_parse_state *state,
|
||||
YYLTYPE *loc,
|
||||
const glsl_type *type)
|
||||
const glsl_type *type,
|
||||
ir_variable *var)
|
||||
{
|
||||
if (!type->is_matrix() && !type->is_record()) {
|
||||
if (var && !var->is_in_uniform_block()) {
|
||||
/* Layout qualifiers may only apply to interface blocks and fields in
|
||||
* them.
|
||||
*/
|
||||
_mesa_glsl_error(loc, state,
|
||||
"uniform block layout qualifiers row_major and "
|
||||
"column_major can only be applied to matrix and "
|
||||
"structure types");
|
||||
"column_major may not be applied to variables "
|
||||
"outside of uniform blocks");
|
||||
} else if (!type->is_matrix()) {
|
||||
/* The OpenGL ES 3.0 conformance tests did not originally allow
|
||||
* matrix layout qualifiers on non-matrices. However, the OpenGL
|
||||
* 4.4 and OpenGL ES 3.0 (revision TBD) specifications were
|
||||
* amended to specifically allow these layouts on all types. Emit
|
||||
* a warning so that people know their code may not be portable.
|
||||
*/
|
||||
_mesa_glsl_warning(loc, state,
|
||||
"uniform block layout qualifiers row_major and "
|
||||
"column_major applied to non-matrix types may "
|
||||
"be rejected by older compilers");
|
||||
} else if (type->is_record()) {
|
||||
/* We allow 'layout(row_major)' on structure types because it's the only
|
||||
* way to get row-major layouts on matrices contained in structures.
|
||||
@@ -1845,7 +1876,7 @@ validate_matrix_layout_for_type(struct _mesa_glsl_parse_state *state,
|
||||
_mesa_glsl_warning(loc, state,
|
||||
"uniform block layout qualifiers row_major and "
|
||||
"column_major applied to structure types is not "
|
||||
"strictly conformant and my be rejected by other "
|
||||
"strictly conformant and may be rejected by other "
|
||||
"compilers");
|
||||
}
|
||||
}
|
||||
@@ -1933,7 +1964,6 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
|
||||
ir_variable *var,
|
||||
struct _mesa_glsl_parse_state *state,
|
||||
YYLTYPE *loc,
|
||||
bool ubo_qualifiers_valid,
|
||||
bool is_parameter)
|
||||
{
|
||||
if (qual->flags.q.invariant) {
|
||||
@@ -1963,6 +1993,21 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
|
||||
_mesa_glsl_shader_target_name(state->target));
|
||||
}
|
||||
|
||||
/* Section 6.1.1 (Function Calling Conventions) of the GLSL 1.10 spec says:
|
||||
*
|
||||
* "However, the const qualifier cannot be used with out or inout."
|
||||
*
|
||||
* The same section of the GLSL 4.40 spec further clarifies this saying:
|
||||
*
|
||||
* "The const qualifier cannot be used with out or inout, or a
|
||||
* compile-time error results."
|
||||
*/
|
||||
if (is_parameter && qual->flags.q.constant && qual->flags.q.out) {
|
||||
_mesa_glsl_error(loc, state,
|
||||
"`const' may not be applied to `out' or `inout' "
|
||||
"function parameters");
|
||||
}
|
||||
|
||||
/* If there is no qualifier that changes the mode of the variable, leave
|
||||
* the setting alone.
|
||||
*/
|
||||
@@ -2251,13 +2296,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
|
||||
}
|
||||
|
||||
if (qual->flags.q.row_major || qual->flags.q.column_major) {
|
||||
if (!ubo_qualifiers_valid) {
|
||||
_mesa_glsl_error(loc, state,
|
||||
"uniform block layout qualifiers row_major and "
|
||||
"column_major can only be applied to uniform block "
|
||||
"members");
|
||||
} else
|
||||
validate_matrix_layout_for_type(state, loc, var->type);
|
||||
validate_matrix_layout_for_type(state, loc, var->type, var);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2593,7 +2632,7 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
*/
|
||||
(void) this->type->specifier->hir(instructions, state);
|
||||
|
||||
decl_type = this->type->specifier->glsl_type(& type_name, state);
|
||||
decl_type = this->type->glsl_type(& type_name, state);
|
||||
if (this->declarations.is_empty()) {
|
||||
/* If there is no structure involved in the program text, there are two
|
||||
* possible scenarios:
|
||||
@@ -2605,6 +2644,11 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
* name of a known structure type. This is both invalid and weird.
|
||||
* Emit an error.
|
||||
*
|
||||
* - The program text contained something like 'mediump float;'
|
||||
* when the programmer probably meant 'precision mediump
|
||||
* float;' Emit a warning with a description of what they
|
||||
* probably meant to do.
|
||||
*
|
||||
* Note that if decl_type is NULL and there is a structure involved,
|
||||
* there must have been some sort of error with the structure. In this
|
||||
* case we assume that an error was already generated on this line of
|
||||
@@ -2613,20 +2657,33 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
*/
|
||||
assert(this->type->specifier->structure == NULL || decl_type != NULL
|
||||
|| state->error);
|
||||
if (this->type->specifier->structure == NULL) {
|
||||
if (decl_type != NULL) {
|
||||
_mesa_glsl_warning(&loc, state, "empty declaration");
|
||||
} else {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"invalid type `%s' in empty declaration",
|
||||
type_name);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->type->qualifier.precision != ast_precision_none &&
|
||||
this->type->specifier->structure != NULL) {
|
||||
_mesa_glsl_error(&loc, state, "Precision qualifiers can't be applied "
|
||||
"to structures.\n");
|
||||
if (decl_type == NULL) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"invalid type `%s' in empty declaration",
|
||||
type_name);
|
||||
} else if (this->type->qualifier.precision != ast_precision_none) {
|
||||
if (this->type->specifier->structure != NULL) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"precision qualifiers can't be applied "
|
||||
"to structures");
|
||||
} else {
|
||||
static const char *const precision_names[] = {
|
||||
"highp",
|
||||
"highp",
|
||||
"mediump",
|
||||
"lowp"
|
||||
};
|
||||
|
||||
_mesa_glsl_warning(&loc, state,
|
||||
"empty declaration with precision qualifier, "
|
||||
"to set the default precision, use "
|
||||
"`precision %s %s;'",
|
||||
precision_names[this->type->qualifier.precision],
|
||||
type_name);
|
||||
}
|
||||
} else {
|
||||
_mesa_glsl_warning(&loc, state, "empty declaration");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2692,7 +2749,7 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
}
|
||||
|
||||
apply_type_qualifier_to_variable(& this->type->qualifier, var, state,
|
||||
& loc, this->ubo_qualifiers_valid, false);
|
||||
& loc, false);
|
||||
|
||||
if (this->type->qualifier.flags.q.invariant) {
|
||||
if ((state->target == vertex_shader) &&
|
||||
@@ -2927,6 +2984,20 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
"'centroid in' cannot be used in a vertex shader");
|
||||
}
|
||||
|
||||
/* Section 4.3.6 of the GLSL 1.30 specification states:
|
||||
* "It is an error to use centroid out in a fragment shader."
|
||||
*
|
||||
* The GL_ARB_shading_language_420pack extension specification states:
|
||||
* "It is an error to use auxiliary storage qualifiers or interpolation
|
||||
* qualifiers on an output in a fragment shader."
|
||||
*/
|
||||
if (state->target == fragment_shader &&
|
||||
this->type->qualifier.flags.q.out &&
|
||||
this->type->qualifier.has_auxiliary_storage()) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"auxiliary storage qualifiers cannot be used on "
|
||||
"fragment shader outputs");
|
||||
}
|
||||
|
||||
/* Precision qualifiers exists only in GLSL versions 1.00 and >= 1.30.
|
||||
*/
|
||||
@@ -3001,6 +3072,33 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
decl->identifier);
|
||||
}
|
||||
|
||||
if (state->es_shader) {
|
||||
const glsl_type *const t = (earlier == NULL)
|
||||
? var->type : earlier->type;
|
||||
|
||||
if (t->is_array() && t->length == 0)
|
||||
/* Section 10.17 of the GLSL ES 1.00 specification states that
|
||||
* unsized array declarations have been removed from the language.
|
||||
* Arrays that are sized using an initializer are still explicitly
|
||||
* sized. However, GLSL ES 1.00 does not allow array
|
||||
* initializers. That is only allowed in GLSL ES 3.00.
|
||||
*
|
||||
* Section 4.1.9 (Arrays) of the GLSL ES 3.00 spec says:
|
||||
*
|
||||
* "An array type can also be formed without specifying a size
|
||||
* if the definition includes an initializer:
|
||||
*
|
||||
* float x[] = float[2] (1.0, 2.0); // declares an array of size 2
|
||||
* float y[] = float[] (1.0, 2.0, 3.0); // declares an array of size 3
|
||||
*
|
||||
* float a[5];
|
||||
* float b[] = a;"
|
||||
*/
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"unsized array declarations are not allowed in "
|
||||
"GLSL ES");
|
||||
}
|
||||
|
||||
/* If the declaration is not a redeclaration, there are a few additional
|
||||
* semantic checks that must be applied. In addition, variable that was
|
||||
* created for the declaration should be added to the IR stream.
|
||||
@@ -3083,7 +3181,7 @@ ast_parameter_declarator::hir(exec_list *instructions,
|
||||
const char *name = NULL;
|
||||
YYLTYPE loc = this->get_location();
|
||||
|
||||
type = this->type->specifier->glsl_type(& name, state);
|
||||
type = this->type->glsl_type(& name, state);
|
||||
|
||||
if (type == NULL) {
|
||||
if (name != NULL) {
|
||||
@@ -3146,7 +3244,7 @@ ast_parameter_declarator::hir(exec_list *instructions,
|
||||
* for function parameters the default mode is 'in'.
|
||||
*/
|
||||
apply_type_qualifier_to_variable(& this->type->qualifier, var, state, & loc,
|
||||
false, true);
|
||||
true);
|
||||
|
||||
/* From page 17 (page 23 of the PDF) of the GLSL 1.20 spec:
|
||||
*
|
||||
@@ -3290,7 +3388,7 @@ ast_function::hir(exec_list *instructions,
|
||||
|
||||
const char *return_type_name;
|
||||
const glsl_type *return_type =
|
||||
this->return_type->specifier->glsl_type(& return_type_name, state);
|
||||
this->return_type->glsl_type(& return_type_name, state);
|
||||
|
||||
if (!return_type) {
|
||||
YYLTYPE loc = this->get_location();
|
||||
@@ -3309,6 +3407,18 @@ ast_function::hir(exec_list *instructions,
|
||||
"function `%s' return type has qualifiers", name);
|
||||
}
|
||||
|
||||
/* Section 6.1 (Function Definitions) of the GLSL 1.20 spec says:
|
||||
*
|
||||
* "Arrays are allowed as arguments and as the return type. In both
|
||||
* cases, the array must be explicitly sized."
|
||||
*/
|
||||
if (return_type->is_array() && return_type->length == 0) {
|
||||
YYLTYPE loc = this->get_location();
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"function `%s' return type array must be explicitly "
|
||||
"sized", name);
|
||||
}
|
||||
|
||||
/* From page 17 (page 23 of the PDF) of the GLSL 1.20 spec:
|
||||
*
|
||||
* "[Sampler types] can only be declared as function parameters
|
||||
@@ -4019,10 +4129,8 @@ ast_iteration_statement::hir(exec_list *instructions,
|
||||
* version.
|
||||
*/
|
||||
static bool
|
||||
is_valid_default_precision_type(const struct _mesa_glsl_parse_state *state,
|
||||
const char *type_name)
|
||||
is_valid_default_precision_type(const struct glsl_type *const type)
|
||||
{
|
||||
const struct glsl_type *type = state->symbols->get_type(type_name);
|
||||
if (type == NULL)
|
||||
return false;
|
||||
|
||||
@@ -4074,13 +4182,54 @@ ast_type_specifier::hir(exec_list *instructions,
|
||||
"arrays");
|
||||
return NULL;
|
||||
}
|
||||
if (!is_valid_default_precision_type(state, this->type_name)) {
|
||||
|
||||
const struct glsl_type *const type =
|
||||
state->symbols->get_type(this->type_name);
|
||||
if (!is_valid_default_precision_type(type)) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"default precision statements apply only to types "
|
||||
"float, int, and sampler types");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (type->base_type == GLSL_TYPE_FLOAT
|
||||
&& state->es_shader
|
||||
&& state->target == fragment_shader) {
|
||||
/* Section 4.5.3 (Default Precision Qualifiers) of the GLSL ES 1.00
|
||||
* spec says:
|
||||
*
|
||||
* "The fragment language has no default precision qualifier for
|
||||
* floating point types."
|
||||
*
|
||||
* As a result, we have to track whether or not default precision has
|
||||
* been specified for float in GLSL ES fragment shaders.
|
||||
*
|
||||
* Earlier in that same section, the spec says:
|
||||
*
|
||||
* "Non-precision qualified declarations will use the precision
|
||||
* qualifier specified in the most recent precision statement
|
||||
* that is still in scope. The precision statement has the same
|
||||
* scoping rules as variable declarations. If it is declared
|
||||
* inside a compound statement, its effect stops at the end of
|
||||
* the innermost statement it was declared in. Precision
|
||||
* statements in nested scopes override precision statements in
|
||||
* outer scopes. Multiple precision statements for the same basic
|
||||
* type can appear inside the same scope, with later statements
|
||||
* overriding earlier statements within that scope."
|
||||
*
|
||||
* Default precision specifications follow the same scope rules as
|
||||
* variables. So, we can track the state of the default float
|
||||
* precision in the symbol table, and the rules will just work. This
|
||||
* is a slight abuse of the symbol table, but it has the semantics
|
||||
* that we want.
|
||||
*/
|
||||
ir_variable *const junk =
|
||||
new(state) ir_variable(type, "#default precision",
|
||||
ir_var_temporary);
|
||||
|
||||
state->symbols->add_variable(junk);
|
||||
}
|
||||
|
||||
/* FINISHME: Translate precision statements into IR. */
|
||||
return NULL;
|
||||
}
|
||||
@@ -4161,7 +4310,7 @@ ast_process_structure_or_interface_block(exec_list *instructions,
|
||||
}
|
||||
|
||||
const glsl_type *decl_type =
|
||||
decl_list->type->specifier->glsl_type(& type_name, state);
|
||||
decl_list->type->glsl_type(& type_name, state);
|
||||
|
||||
foreach_list_typed (ast_declaration, decl, link,
|
||||
&decl_list->declarations) {
|
||||
@@ -4208,14 +4357,9 @@ ast_process_structure_or_interface_block(exec_list *instructions,
|
||||
if (!qual->flags.q.uniform) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"row_major and column_major can only be "
|
||||
"applied to uniform interface blocks.");
|
||||
} else if (!field_type->is_matrix() && !field_type->is_record()) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"uniform block layout qualifiers row_major and "
|
||||
"column_major can only be applied to matrix and "
|
||||
"structure types");
|
||||
"applied to uniform interface blocks");
|
||||
} else
|
||||
validate_matrix_layout_for_type(state, &loc, field_type);
|
||||
validate_matrix_layout_for_type(state, &loc, field_type, NULL);
|
||||
}
|
||||
|
||||
if (qual->flags.q.uniform && qual->has_interpolation()) {
|
||||
@@ -4249,6 +4393,34 @@ ast_struct_specifier::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
YYLTYPE loc = this->get_location();
|
||||
|
||||
/* Section 4.1.8 (Structures) of the GLSL 1.10 spec says:
|
||||
*
|
||||
* "Anonymous structures are not supported; so embedded structures must
|
||||
* have a declarator. A name given to an embedded struct is scoped at
|
||||
* the same level as the struct it is embedded in."
|
||||
*
|
||||
* The same section of the GLSL 1.20 spec says:
|
||||
*
|
||||
* "Anonymous structures are not supported. Embedded structures are not
|
||||
* supported.
|
||||
*
|
||||
* struct S { float f; };
|
||||
* struct T {
|
||||
* S; // Error: anonymous structures disallowed
|
||||
* struct { ... }; // Error: embedded structures disallowed
|
||||
* S s; // Okay: nested structures with name are allowed
|
||||
* };"
|
||||
*
|
||||
* The GLSL ES 1.00 and 3.00 specs have similar langauge and examples. So,
|
||||
* we allow embedded structures in 1.10 only.
|
||||
*/
|
||||
if (state->language_version != 110 && state->struct_specifier_depth != 0)
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"embedded structure declartions are not allowed");
|
||||
|
||||
state->struct_specifier_depth++;
|
||||
|
||||
glsl_struct_field *fields;
|
||||
unsigned decl_count =
|
||||
ast_process_structure_or_interface_block(instructions,
|
||||
@@ -4275,6 +4447,8 @@ ast_struct_specifier::hir(exec_list *instructions,
|
||||
}
|
||||
}
|
||||
|
||||
state->struct_specifier_depth--;
|
||||
|
||||
/* Structure type definitions do not have r-values.
|
||||
*/
|
||||
return NULL;
|
||||
|
@@ -149,6 +149,9 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc,
|
||||
if (q.flags.q.explicit_binding)
|
||||
this->binding = q.binding;
|
||||
|
||||
if (q.precision != ast_precision_none)
|
||||
this->precision = q.precision;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,6 @@
|
||||
#version 100
|
||||
precision highp float;
|
||||
|
||||
vec4 texture2D (sampler2D sampler, vec2 coord, float bias);
|
||||
vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias);
|
||||
vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#version 300 es
|
||||
precision highp float;
|
||||
|
||||
/* texture - bias variants */
|
||||
vec4 texture( sampler2D sampler, vec2 P, float bias);
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#version 100
|
||||
#extension GL_OES_EGL_image_external : enable
|
||||
precision highp float;
|
||||
|
||||
vec4 texture2D(samplerExternalOES sampler, vec2 coord);
|
||||
vec4 texture2DProj(samplerExternalOES sampler, vec3 coord);
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#version 100
|
||||
#extension GL_OES_standard_derivatives : enable
|
||||
precision highp float;
|
||||
|
||||
/*
|
||||
* 8.8 - Fragment Processing Functions
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#version 100
|
||||
#extension GL_OES_texture_3D : enable
|
||||
precision highp float;
|
||||
|
||||
vec4 texture3D (sampler3D sampler, vec3 coord);
|
||||
vec4 texture3DProj (sampler3D sampler, vec4 coord);
|
||||
|
@@ -149,7 +149,7 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state,
|
||||
%option bison-bridge bison-locations reentrant noyywrap
|
||||
%option nounput noyy_top_state
|
||||
%option never-interactive
|
||||
%option prefix="_mesa_glsl_"
|
||||
%option prefix="_mesa_glsl_lexer_"
|
||||
%option extra-type="struct _mesa_glsl_parse_state *"
|
||||
|
||||
%x PP PRAGMA
|
||||
@@ -324,30 +324,11 @@ sampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multi
|
||||
isampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMSARRAY);
|
||||
usampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMSARRAY);
|
||||
|
||||
samplerCubeArray {
|
||||
if (yyextra->ARB_texture_cube_map_array_enable)
|
||||
return SAMPLERCUBEARRAY;
|
||||
else
|
||||
return IDENTIFIER;
|
||||
}
|
||||
isamplerCubeArray {
|
||||
if (yyextra->ARB_texture_cube_map_array_enable)
|
||||
return ISAMPLERCUBEARRAY;
|
||||
else
|
||||
return IDENTIFIER;
|
||||
}
|
||||
usamplerCubeArray {
|
||||
if (yyextra->ARB_texture_cube_map_array_enable)
|
||||
return USAMPLERCUBEARRAY;
|
||||
else
|
||||
return IDENTIFIER;
|
||||
}
|
||||
samplerCubeArrayShadow {
|
||||
if (yyextra->ARB_texture_cube_map_array_enable)
|
||||
return SAMPLERCUBEARRAYSHADOW;
|
||||
else
|
||||
return IDENTIFIER;
|
||||
}
|
||||
/* keywords available with ARB_texture_cube_map_array_enable extension on desktop GLSL */
|
||||
samplerCubeArray KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAY);
|
||||
isamplerCubeArray KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, ISAMPLERCUBEARRAY);
|
||||
usamplerCubeArray KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, USAMPLERCUBEARRAY);
|
||||
samplerCubeArrayShadow KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAYSHADOW);
|
||||
|
||||
samplerExternalOES {
|
||||
if (yyextra->OES_EGL_image_external_enable)
|
||||
@@ -371,7 +352,7 @@ layout {
|
||||
return LAYOUT_TOK;
|
||||
} else {
|
||||
yylval->identifier = strdup(yytext);
|
||||
return IDENTIFIER;
|
||||
return classify_identifier(yyextra, yytext);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -31,14 +31,18 @@
|
||||
#include "glsl_types.h"
|
||||
#include "main/context.h"
|
||||
|
||||
#define YYLEX_PARAM state->scanner
|
||||
|
||||
#undef yyerror
|
||||
|
||||
static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg)
|
||||
{
|
||||
_mesa_glsl_error(loc, st, "%s", msg);
|
||||
}
|
||||
|
||||
static int
|
||||
_mesa_glsl_lex(YYSTYPE *val, YYLTYPE *loc, _mesa_glsl_parse_state *state)
|
||||
{
|
||||
return _mesa_glsl_lexer_lex(val, loc, state->scanner);
|
||||
}
|
||||
%}
|
||||
|
||||
%expect 0
|
||||
@@ -55,7 +59,7 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg)
|
||||
@$.source = 0;
|
||||
}
|
||||
|
||||
%lex-param {void *scanner}
|
||||
%lex-param {struct _mesa_glsl_parse_state *state}
|
||||
%parse-param {struct _mesa_glsl_parse_state *state}
|
||||
|
||||
%union {
|
||||
@@ -2247,7 +2251,6 @@ member_declaration:
|
||||
|
||||
$$ = new(ctx) ast_declarator_list(type);
|
||||
$$->set_location(yylloc);
|
||||
$$->ubo_qualifiers_valid = true;
|
||||
|
||||
$$->declarations.push_degenerate_list_at_head(& $2->link);
|
||||
}
|
||||
|
@@ -71,10 +71,12 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
|
||||
this->loop_nesting_ast = NULL;
|
||||
this->switch_state.switch_nesting_ast = NULL;
|
||||
|
||||
this->struct_specifier_depth = 0;
|
||||
this->num_builtins_to_link = 0;
|
||||
|
||||
/* Set default language version and extensions */
|
||||
this->language_version = 110;
|
||||
this->language_version = ctx->Const.ForceGLSLVersion ?
|
||||
ctx->Const.ForceGLSLVersion : 110;
|
||||
this->es_shader = false;
|
||||
this->ARB_texture_rectangle_enable = true;
|
||||
|
||||
@@ -1197,7 +1199,6 @@ ast_declarator_list::ast_declarator_list(ast_fully_specified_type *type)
|
||||
{
|
||||
this->type = type;
|
||||
this->invariant = false;
|
||||
this->ubo_qualifiers_valid = false;
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -158,6 +158,13 @@ struct _mesa_glsl_parse_state {
|
||||
unsigned language_version;
|
||||
enum _mesa_glsl_parser_targets target;
|
||||
|
||||
/**
|
||||
* Number of nested struct_specifier levels
|
||||
*
|
||||
* Outside a struct_specifer, this is zero.
|
||||
*/
|
||||
unsigned struct_specifier_depth;
|
||||
|
||||
/**
|
||||
* Default uniform layout qualifiers tracked during parsing.
|
||||
* Currently affects uniform blocks and uniform buffer variables in
|
||||
@@ -337,8 +344,8 @@ extern void _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state,
|
||||
extern void _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state);
|
||||
|
||||
union YYSTYPE;
|
||||
extern int _mesa_glsl_lex(union YYSTYPE *yylval, YYLTYPE *yylloc,
|
||||
void *scanner);
|
||||
extern int _mesa_glsl_lexer_lex(union YYSTYPE *yylval, YYLTYPE *yylloc,
|
||||
void *scanner);
|
||||
|
||||
extern int _mesa_glsl_parse(struct _mesa_glsl_parse_state *);
|
||||
|
||||
|
@@ -281,7 +281,7 @@ glsl_type::glsl_type(const glsl_type *array, unsigned length) :
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *const
|
||||
const glsl_type *
|
||||
glsl_type::vec(unsigned components)
|
||||
{
|
||||
if (components == 0 || components > 4)
|
||||
@@ -294,7 +294,7 @@ glsl_type::vec(unsigned components)
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *const
|
||||
const glsl_type *
|
||||
glsl_type::ivec(unsigned components)
|
||||
{
|
||||
if (components == 0 || components > 4)
|
||||
@@ -307,7 +307,7 @@ glsl_type::ivec(unsigned components)
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *const
|
||||
const glsl_type *
|
||||
glsl_type::uvec(unsigned components)
|
||||
{
|
||||
if (components == 0 || components > 4)
|
||||
@@ -320,7 +320,7 @@ glsl_type::uvec(unsigned components)
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *const
|
||||
const glsl_type *
|
||||
glsl_type::bvec(unsigned components)
|
||||
{
|
||||
if (components == 0 || components > 4)
|
||||
|
@@ -170,10 +170,10 @@ struct glsl_type {
|
||||
* Convenience accessors for vector types (shorter than get_instance()).
|
||||
* @{
|
||||
*/
|
||||
static const glsl_type *const vec(unsigned components);
|
||||
static const glsl_type *const ivec(unsigned components);
|
||||
static const glsl_type *const uvec(unsigned components);
|
||||
static const glsl_type *const bvec(unsigned components);
|
||||
static const glsl_type *vec(unsigned components);
|
||||
static const glsl_type *ivec(unsigned components);
|
||||
static const glsl_type *uvec(unsigned components);
|
||||
static const glsl_type *bvec(unsigned components);
|
||||
/**@}*/
|
||||
|
||||
/**
|
||||
|
@@ -77,7 +77,7 @@ bool do_copy_propagation(exec_list *instructions);
|
||||
bool do_copy_propagation_elements(exec_list *instructions);
|
||||
bool do_constant_propagation(exec_list *instructions);
|
||||
void do_dead_builtin_varyings(struct gl_context *ctx,
|
||||
exec_list *producer, exec_list *consumer,
|
||||
gl_shader *producer, gl_shader *consumer,
|
||||
unsigned num_tfeedback_decls,
|
||||
class tfeedback_decl *tfeedback_decls);
|
||||
bool do_dead_code(exec_list *instructions, bool uniform_locations_assigned);
|
||||
|
@@ -58,6 +58,15 @@ public:
|
||||
private:
|
||||
virtual void visit_field(const glsl_type *type, const char *name,
|
||||
bool row_major)
|
||||
{
|
||||
(void) type;
|
||||
(void) name;
|
||||
(void) row_major;
|
||||
assert(!"Should not get here.");
|
||||
}
|
||||
|
||||
virtual void visit_field(const glsl_type *type, const char *name,
|
||||
bool row_major, const glsl_type *record_type)
|
||||
{
|
||||
assert(this->index < this->num_variables);
|
||||
|
||||
@@ -85,7 +94,9 @@ private:
|
||||
v->IndexName = v->Name;
|
||||
}
|
||||
|
||||
unsigned alignment = type->std140_base_alignment(v->RowMajor);
|
||||
const unsigned alignment = record_type
|
||||
? record_type->std140_base_alignment(v->RowMajor)
|
||||
: type->std140_base_alignment(v->RowMajor);
|
||||
unsigned size = type->std140_size(v->RowMajor);
|
||||
|
||||
this->offset = glsl_align(this->offset, alignment);
|
||||
@@ -107,6 +118,10 @@ private:
|
||||
|
||||
virtual void visit_field(const glsl_struct_field *field)
|
||||
{
|
||||
/* FINISHME: When support for doubles (dvec4, etc.) is added to the
|
||||
* FINISHME: compiler, this may be incorrect for a structure in a UBO
|
||||
* FINISHME: like struct s { struct { float f } s1; dvec4 v; };.
|
||||
*/
|
||||
this->offset = glsl_align(this->offset,
|
||||
field->type->std140_base_alignment(false));
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ program_resource_visitor::process(const glsl_type *type, const char *name)
|
||||
|| (type->is_array() && type->fields.array->is_interface()));
|
||||
|
||||
char *name_copy = ralloc_strdup(NULL, name);
|
||||
recursion(type, &name_copy, strlen(name), false);
|
||||
recursion(type, &name_copy, strlen(name), false, NULL);
|
||||
ralloc_free(name_copy);
|
||||
}
|
||||
|
||||
@@ -77,24 +77,25 @@ program_resource_visitor::process(ir_variable *var)
|
||||
/* Only strdup the name if we actually will need to modify it. */
|
||||
if (t->is_record() || (t->is_array() && t->fields.array->is_record())) {
|
||||
char *name = ralloc_strdup(NULL, var->name);
|
||||
recursion(var->type, &name, strlen(name), false);
|
||||
recursion(var->type, &name, strlen(name), false, NULL);
|
||||
ralloc_free(name);
|
||||
} else if (t->is_interface()) {
|
||||
char *name = ralloc_strdup(NULL, var->type->name);
|
||||
recursion(var->type, &name, strlen(name), false);
|
||||
recursion(var->type, &name, strlen(name), false, NULL);
|
||||
ralloc_free(name);
|
||||
} else if (t->is_array() && t->fields.array->is_interface()) {
|
||||
char *name = ralloc_strdup(NULL, var->type->fields.array->name);
|
||||
recursion(var->type, &name, strlen(name), false);
|
||||
recursion(var->type, &name, strlen(name), false, NULL);
|
||||
ralloc_free(name);
|
||||
} else {
|
||||
this->visit_field(t, var->name, false);
|
||||
this->visit_field(t, var->name, false, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
program_resource_visitor::recursion(const glsl_type *t, char **name,
|
||||
size_t name_length, bool row_major)
|
||||
size_t name_length, bool row_major,
|
||||
const glsl_type *record_type)
|
||||
{
|
||||
/* Records need to have each field processed individually.
|
||||
*
|
||||
@@ -103,6 +104,9 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
|
||||
* individually.
|
||||
*/
|
||||
if (t->is_record() || t->is_interface()) {
|
||||
if (record_type == NULL && t->is_record())
|
||||
record_type = t;
|
||||
|
||||
for (unsigned i = 0; i < t->length; i++) {
|
||||
const char *field = t->fields.structure[i].name;
|
||||
size_t new_length = name_length;
|
||||
@@ -118,10 +122,18 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
|
||||
}
|
||||
|
||||
recursion(t->fields.structure[i].type, name, new_length,
|
||||
t->fields.structure[i].row_major);
|
||||
t->fields.structure[i].row_major, record_type);
|
||||
|
||||
/* Only the first leaf-field of the record gets called with the
|
||||
* record type pointer.
|
||||
*/
|
||||
record_type = NULL;
|
||||
}
|
||||
} else if (t->is_array() && (t->fields.array->is_record()
|
||||
|| t->fields.array->is_interface())) {
|
||||
if (record_type == NULL && t->fields.array->is_record())
|
||||
record_type = t->fields.array;
|
||||
|
||||
for (unsigned i = 0; i < t->length; i++) {
|
||||
size_t new_length = name_length;
|
||||
|
||||
@@ -129,13 +141,26 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
|
||||
ralloc_asprintf_rewrite_tail(name, &new_length, "[%u]", i);
|
||||
|
||||
recursion(t->fields.array, name, new_length,
|
||||
t->fields.structure[i].row_major);
|
||||
t->fields.structure[i].row_major, record_type);
|
||||
|
||||
/* Only the first leaf-field of the record gets called with the
|
||||
* record type pointer.
|
||||
*/
|
||||
record_type = NULL;
|
||||
}
|
||||
} else {
|
||||
this->visit_field(t, *name, row_major);
|
||||
this->visit_field(t, *name, row_major, record_type);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
program_resource_visitor::visit_field(const glsl_type *type, const char *name,
|
||||
bool row_major,
|
||||
const glsl_type *record_type)
|
||||
{
|
||||
visit_field(type, name, row_major);
|
||||
}
|
||||
|
||||
void
|
||||
program_resource_visitor::visit_field(const glsl_struct_field *field)
|
||||
{
|
||||
@@ -376,6 +401,15 @@ private:
|
||||
|
||||
virtual void visit_field(const glsl_type *type, const char *name,
|
||||
bool row_major)
|
||||
{
|
||||
(void) type;
|
||||
(void) name;
|
||||
(void) row_major;
|
||||
assert(!"Should not get here.");
|
||||
}
|
||||
|
||||
virtual void visit_field(const glsl_type *type, const char *name,
|
||||
bool row_major, const glsl_type *record_type)
|
||||
{
|
||||
assert(!type->is_record());
|
||||
assert(!(type->is_array() && type->fields.array->is_record()));
|
||||
@@ -421,7 +455,9 @@ private:
|
||||
if (this->ubo_block_index != -1) {
|
||||
this->uniforms[id].block_index = this->ubo_block_index;
|
||||
|
||||
unsigned alignment = type->std140_base_alignment(ubo_row_major);
|
||||
const unsigned alignment = record_type
|
||||
? record_type->std140_base_alignment(ubo_row_major)
|
||||
: type->std140_base_alignment(ubo_row_major);
|
||||
this->ubo_byte_offset = glsl_align(this->ubo_byte_offset, alignment);
|
||||
this->uniforms[id].offset = this->ubo_byte_offset;
|
||||
this->ubo_byte_offset += type->std140_size(ubo_row_major);
|
||||
|
@@ -1906,7 +1906,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
goto done;
|
||||
}
|
||||
|
||||
do_dead_builtin_varyings(ctx, sh->ir, NULL,
|
||||
do_dead_builtin_varyings(ctx, sh, NULL,
|
||||
num_tfeedback_decls, tfeedback_decls);
|
||||
|
||||
demote_shader_inputs_and_outputs(sh, ir_var_shader_out);
|
||||
@@ -1921,7 +1921,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
*/
|
||||
gl_shader *const sh = prog->_LinkedShaders[first];
|
||||
|
||||
do_dead_builtin_varyings(ctx, NULL, sh->ir,
|
||||
do_dead_builtin_varyings(ctx, NULL, sh,
|
||||
num_tfeedback_decls, tfeedback_decls);
|
||||
|
||||
demote_shader_inputs_and_outputs(sh, ir_var_shader_in);
|
||||
@@ -1943,7 +1943,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
tfeedback_decls))
|
||||
goto done;
|
||||
|
||||
do_dead_builtin_varyings(ctx, sh_i->ir, sh_next->ir,
|
||||
do_dead_builtin_varyings(ctx, sh_i, sh_next,
|
||||
next == MESA_SHADER_FRAGMENT ? num_tfeedback_decls : 0,
|
||||
tfeedback_decls);
|
||||
|
||||
|
@@ -118,6 +118,19 @@ public:
|
||||
void process(const glsl_type *type, const char *name);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Method invoked for each leaf of the variable
|
||||
*
|
||||
* \param type Type of the field.
|
||||
* \param name Fully qualified name of the field.
|
||||
* \param row_major For a matrix type, is it stored row-major.
|
||||
* \param record_type Type of the record containing the field.
|
||||
*
|
||||
* The default implementation just calls the other \c visit_field method.
|
||||
*/
|
||||
virtual void visit_field(const glsl_type *type, const char *name,
|
||||
bool row_major, const glsl_type *record_type);
|
||||
|
||||
/**
|
||||
* Method invoked for each leaf of the variable
|
||||
*
|
||||
@@ -144,7 +157,7 @@ private:
|
||||
* terminating \c NUL character.
|
||||
*/
|
||||
void recursion(const glsl_type *t, char **name, size_t name_length,
|
||||
bool row_major);
|
||||
bool row_major, const glsl_type *record_type);
|
||||
};
|
||||
|
||||
void
|
||||
|
@@ -503,7 +503,8 @@ is_loop_terminator(ir_if *ir)
|
||||
|
||||
ir_instruction *const inst =
|
||||
(ir_instruction *) ir->then_instructions.get_head();
|
||||
assert(inst != NULL);
|
||||
if (inst == NULL)
|
||||
return false;
|
||||
|
||||
if (inst->ir_type != ir_type_loop_jump)
|
||||
return false;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user