Compare commits
196 Commits
mesa-19.0.
...
mesa-10.0.
Author | SHA1 | Date | |
---|---|---|---|
|
d8225ac67a | ||
|
3eac4b550d | ||
|
cb7caac053 | ||
|
0461451dcd | ||
|
0657a6a6ae | ||
|
559d9b894e | ||
|
765e3d373b | ||
|
ae286af09d | ||
|
ed437df208 | ||
|
f7848574b3 | ||
|
319d6d6067 | ||
|
6f27353c20 | ||
|
99f695f716 | ||
|
ef75bf0777 | ||
|
0cd3d50f07 | ||
|
31b2e73a2d | ||
|
df62691a02 | ||
|
fe2678accd | ||
|
83e9eb81be | ||
|
8c467b825f | ||
|
79ef990ef8 | ||
|
b1694c9f87 | ||
|
e2b6834c87 | ||
|
04e5f2e94f | ||
|
a3f259e404 | ||
|
705da42130 | ||
|
b646441307 | ||
|
0ec1ae90ef | ||
|
0fd4cf4bf8 | ||
|
45f0736aa5 | ||
|
b513c66a4e | ||
|
dbc0ae1079 | ||
|
9ca4c8f6a2 | ||
|
502d89b260 | ||
|
3a6271890c | ||
|
9b3ed4c8c2 | ||
|
38235d2923 | ||
|
0df489f0e0 | ||
|
31e2824d99 | ||
|
700b916da1 | ||
|
c24489b0ef | ||
|
2b205f2864 | ||
|
b1ff3f6270 | ||
|
5310a8cc20 | ||
|
108e50c3bc | ||
|
44dfcf6e88 | ||
|
e833368e04 | ||
|
3efc2bbf07 | ||
|
d46a58703a | ||
|
8eee788bd6 | ||
|
9ccb6cc7b7 | ||
|
4d7961e95e | ||
|
b8be00e5f2 | ||
|
347f149332 | ||
|
49c865180a | ||
|
765ceb6a36 | ||
|
7a7166f832 | ||
|
a4a2f239d7 | ||
|
23d290d102 | ||
|
2a20bf3ed2 | ||
|
87cdd13324 | ||
|
b2ea582679 | ||
|
0057a2b0e7 | ||
|
8518b6360d | ||
|
ffd89b27a7 | ||
|
b0ee1b1748 | ||
|
8dd89b8ad8 | ||
|
ec80a279a5 | ||
|
f6ea5b7bd7 | ||
|
db0dc5c008 | ||
|
c2940d11d0 | ||
|
27623f2645 | ||
|
6f7da0188a | ||
|
12484d2582 | ||
|
d573899b93 | ||
|
142144e7fd | ||
|
a717ae1b2d | ||
|
a876ea4b76 | ||
|
d7a71b7181 | ||
|
2776a496d4 | ||
|
1919ec6ba4 | ||
|
188c60143b | ||
|
d0f606ffbd | ||
|
fdede18275 | ||
|
4cbd424631 | ||
|
331a8a3586 | ||
|
f528981f1a | ||
|
d5f1a270ef | ||
|
f4f1159716 | ||
|
b531dcaec4 | ||
|
b160fea306 | ||
|
05d2a796a0 | ||
|
de517d2bb3 | ||
|
8991193f70 | ||
|
6c00504a8a | ||
|
e6710f4217 | ||
|
31751bd40b | ||
|
edca52e6e7 | ||
|
2457b5bfa4 | ||
|
edb4956932 | ||
|
643f986942 | ||
|
724c07ff12 | ||
|
56d1ba17f1 | ||
|
44e38a878a | ||
|
93dfd0522f | ||
|
a5f78c4025 | ||
|
9ec00c187c | ||
|
5ec641bbc9 | ||
|
444a621e55 | ||
|
756b4f9a8c | ||
|
d963daa380 | ||
|
bab6f40b29 | ||
|
c0c3fa564b | ||
|
ec013f809b | ||
|
866ce39ca0 | ||
|
48e4daf977 | ||
|
1efe2ef620 | ||
|
47ff55fa86 | ||
|
8f4d95d41c | ||
|
79d727e063 | ||
|
7f99ae72c4 | ||
|
e934782b2a | ||
|
ffa073ec72 | ||
|
620d11aed4 | ||
|
c8cf5dc401 | ||
|
a645df0134 | ||
|
3470916d6a | ||
|
320f2fa45d | ||
|
2747e72036 | ||
|
d4b7ff7fe0 | ||
|
63b02533f0 | ||
|
19f05b26ba | ||
|
11da04e1bb | ||
|
989d650090 | ||
|
9495fb4fff | ||
|
521c59f132 | ||
|
eafb9f6756 | ||
|
5af1fb5324 | ||
|
0040edcf9d | ||
|
defff44e1c | ||
|
8f78b06dca | ||
|
367241ec64 | ||
|
15118b45a0 | ||
|
3fd32619d7 | ||
|
7a87dc278e | ||
|
f843604b6a | ||
|
e9f8b78278 | ||
|
dfff838429 | ||
|
11982ca08d | ||
|
713966c82f | ||
|
3a98fc6abe | ||
|
531637feee | ||
|
02807c06b8 | ||
|
9ed0452740 | ||
|
ef8fcfc9cf | ||
|
1b45f255b5 | ||
|
1a163c0b34 | ||
|
53e681f2fe | ||
|
10c25e58ca | ||
|
0558e10160 | ||
|
1e51d3a668 | ||
|
e5839c2397 | ||
|
7d2187176a | ||
|
329a75511f | ||
|
76434775e0 | ||
|
2365244302 | ||
|
3e6f200250 | ||
|
99c62ff2ea | ||
|
a5a6ef9702 | ||
|
6640147463 | ||
|
229ee20460 | ||
|
dbddd86cc2 | ||
|
c702f5eead | ||
|
c4cc166abc | ||
|
2a3dcece72 | ||
|
accc276df2 | ||
|
afbdcdcaaf | ||
|
6f2877c40d | ||
|
02d9e1be87 | ||
|
095d583e52 | ||
|
8af132fca9 | ||
|
ade312cd8a | ||
|
f9a74a0b4c | ||
|
0e3f5999b9 | ||
|
ebc460bc5f | ||
|
0010bdd54a | ||
|
b8a631295a | ||
|
c94ed272eb | ||
|
47139b0233 | ||
|
94251281b4 | ||
|
03a29306b5 | ||
|
d37ea6dfec | ||
|
84ee00c1b2 | ||
|
3ffcc96abc | ||
|
bc94bf08c4 | ||
|
ce904c4caf |
@@ -36,7 +36,6 @@ PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
|
|||||||
EXTRA_FILES = \
|
EXTRA_FILES = \
|
||||||
aclocal.m4 \
|
aclocal.m4 \
|
||||||
configure \
|
configure \
|
||||||
VERSION \
|
|
||||||
bin/ar-lib \
|
bin/ar-lib \
|
||||||
bin/compile \
|
bin/compile \
|
||||||
bin/config.sub \
|
bin/config.sub \
|
||||||
@@ -46,6 +45,7 @@ EXTRA_FILES = \
|
|||||||
bin/ltmain.sh \
|
bin/ltmain.sh \
|
||||||
bin/missing \
|
bin/missing \
|
||||||
bin/ylwrap \
|
bin/ylwrap \
|
||||||
|
bin/test-driver \
|
||||||
src/glsl/glsl_parser.cpp \
|
src/glsl/glsl_parser.cpp \
|
||||||
src/glsl/glsl_parser.h \
|
src/glsl/glsl_parser.h \
|
||||||
src/glsl/glsl_lexer.cpp \
|
src/glsl/glsl_lexer.cpp \
|
||||||
|
30
bin/.cherry-ignore
Normal file
30
bin/.cherry-ignore
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# Since we've disabled DRI3 completely in 10.0, this commit is no longer
|
||||||
|
# necessary.
|
||||||
|
f0f202e6b764be803470e27cba9102f14361ae22 glx: conditionaly build dri3 and present loader (v3)
|
||||||
|
|
||||||
|
# This patch makes bug #71870 worse, so it won't be cherry picked until that
|
||||||
|
# issue can be resolved. See
|
||||||
|
# http://lists.freedesktop.org/archives/mesa-dev/2013-November/048899.html
|
||||||
|
068a073c1d4853b5c8f33efdeb481026f42e23a5 meta: fix meta clear of layered framebuffers
|
||||||
|
|
||||||
|
# This patch isn't actually necessary because that bug that it fixes isn't in
|
||||||
|
# the 10.0 branch. See
|
||||||
|
# http://lists.freedesktop.org/archives/mesa-stable/2013-December/000500.html
|
||||||
|
a057b837ddd1c725a7504eedc53c6df05a012773 egl: add HAVE_LIBDRM define, fix EGL X11 platform
|
||||||
|
|
||||||
|
# Author requested skipping due to regressions
|
||||||
|
# Picking it would require at least also picking:
|
||||||
|
# 73c3c7e3, 3e0e9e3b, c59a605c
|
||||||
|
b2d1c579bb84a88179072a6a783f8827e218db55 glcpp: Set extension defines after resolving the GLSL version.
|
||||||
|
|
||||||
|
# These patches depend on other code not in stable branch.
|
||||||
|
# (at least 3b22146dc714b6090f7423abbc4df53d7d1fdaa9)
|
||||||
|
e190709119d8eb85c67bfbad5be699d39ad0118e mesa: Ensure that transform feedback refers to the correct program.
|
||||||
|
43e77215b13b2f86e461cd8a62b542fc6854dd1c i965/gen7: Use to the correct program when uploading transform feedback state.
|
||||||
|
|
||||||
|
# Author requested to ignore these four (since they depend on commits not in
|
||||||
|
# stable).
|
||||||
|
3313cc269bd428ca96a132d86da5fddc0f27386a i965: Add an option to ignore sample qualifier
|
||||||
|
a92e5f7cf63d496ad7830b5cea4bbab287c25b8e i965: Use sample barycentric coordinates with per sample shading
|
||||||
|
f5cfb4ae21df8eebfc6b86c0ce858b1c0a9160dd i965: Ignore 'centroid' interpolation qualifier in case of persample shading
|
||||||
|
dc2f94bc786768329973403248820a2e5249f102 i965: Ignore 'centroid' interpolation qualifier in case of persample shading
|
@@ -100,4 +100,4 @@ def AddOptions(opts):
|
|||||||
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
|
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
|
||||||
opts.Add(BoolOption('texture_float', 'enable floating-point textures and renderbuffers', 'no'))
|
opts.Add(BoolOption('texture_float', 'enable floating-point textures and renderbuffers', 'no'))
|
||||||
if host_platform == 'windows':
|
if host_platform == 'windows':
|
||||||
opts.Add(EnumOption('MSVC_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0', '10.0', '11.0')))
|
opts.Add(EnumOption('MSVC_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0', '10.0', '11.0', '12.0')))
|
||||||
|
30
configure.ac
30
configure.ac
@@ -29,14 +29,11 @@ AC_SUBST([OSMESA_VERSION])
|
|||||||
dnl Versions for external dependencies
|
dnl Versions for external dependencies
|
||||||
LIBDRM_REQUIRED=2.4.24
|
LIBDRM_REQUIRED=2.4.24
|
||||||
LIBDRM_RADEON_REQUIRED=2.4.46
|
LIBDRM_RADEON_REQUIRED=2.4.46
|
||||||
LIBDRM_INTEL_REQUIRED=2.4.38
|
LIBDRM_INTEL_REQUIRED=2.4.49
|
||||||
LIBDRM_NVVIEUX_REQUIRED=2.4.33
|
LIBDRM_NVVIEUX_REQUIRED=2.4.33
|
||||||
LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
|
LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
|
||||||
LIBDRM_FREEDRENO_REQUIRED=2.4.39
|
LIBDRM_FREEDRENO_REQUIRED=2.4.39
|
||||||
DRI2PROTO_REQUIRED=2.6
|
DRI2PROTO_REQUIRED=2.6
|
||||||
DRI3PROTO_REQUIRED=1.0
|
|
||||||
PRESENTPROTO_REQUIRED=1.0
|
|
||||||
LIBUDEV_REQUIRED=151
|
|
||||||
GLPROTO_REQUIRED=1.4.14
|
GLPROTO_REQUIRED=1.4.14
|
||||||
|
|
||||||
dnl Check for progs
|
dnl Check for progs
|
||||||
@@ -230,6 +227,12 @@ esac
|
|||||||
AC_SUBST([VISIBILITY_CFLAGS])
|
AC_SUBST([VISIBILITY_CFLAGS])
|
||||||
AC_SUBST([VISIBILITY_CXXFLAGS])
|
AC_SUBST([VISIBILITY_CXXFLAGS])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Optional flags, check for compiler support
|
||||||
|
dnl
|
||||||
|
AX_CHECK_COMPILE_FLAG([-msse4.1], [SSE41_SUPPORTED=1], [SSE41_SUPPORTED=0])
|
||||||
|
AM_CONDITIONAL([SSE41_SUPPORTED], [test x$SSE41_SUPPORTED = x1])
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Hacks to enable 32 or 64 bit build
|
dnl Hacks to enable 32 or 64 bit build
|
||||||
dnl
|
dnl
|
||||||
@@ -811,13 +814,10 @@ xyesno)
|
|||||||
fi
|
fi
|
||||||
PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
|
PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
|
||||||
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
|
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
|
||||||
PKG_CHECK_MODULES([DRI3PROTO], [dri3proto >= $DRI3PROTO_REQUIRED])
|
|
||||||
PKG_CHECK_MODULES([PRESENTPROTO], [presentproto >= $PRESENTPROTO_REQUIRED])
|
|
||||||
PKG_CHECK_MODULES([LIBUDEV], [libudev >= $LIBUDEV_REQUIRED])
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# find the DRI deps for libGL
|
# find the DRI deps for libGL
|
||||||
dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8 xcb-dri3 xcb-present xcb-sync xshmfence"
|
dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8"
|
||||||
|
|
||||||
# add xf86vidmode if available
|
# add xf86vidmode if available
|
||||||
PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
|
PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
|
||||||
@@ -827,8 +827,8 @@ xyesno)
|
|||||||
|
|
||||||
PKG_CHECK_MODULES([DRIGL], [$dri_modules])
|
PKG_CHECK_MODULES([DRIGL], [$dri_modules])
|
||||||
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
|
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
|
||||||
X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS $LIBUDEV_CFLAGS"
|
X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
|
||||||
GL_LIB_DEPS="$DRIGL_LIBS $LIBUDEV_LIBS"
|
GL_LIB_DEPS="$DRIGL_LIBS"
|
||||||
|
|
||||||
# need DRM libs, $PTHREAD_LIBS, etc.
|
# need DRM libs, $PTHREAD_LIBS, etc.
|
||||||
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
|
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
|
||||||
@@ -1500,12 +1500,6 @@ AC_ARG_WITH([llvm-shared-libs],
|
|||||||
[link with LLVM shared libraries @<:@default=disabled@:>@])],
|
[link with LLVM shared libraries @<:@default=disabled@:>@])],
|
||||||
[],
|
[],
|
||||||
[with_llvm_shared_libs=no])
|
[with_llvm_shared_libs=no])
|
||||||
AS_IF([test x$enable_opencl = xyes],
|
|
||||||
[
|
|
||||||
if test "x$with_llvm_shared_libs" != xyes; then
|
|
||||||
AC_MSG_ERROR([OpenCL requires LLVM shared libraries])
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_ARG_WITH([llvm-prefix],
|
AC_ARG_WITH([llvm-prefix],
|
||||||
[AS_HELP_STRING([--with-llvm-prefix],
|
[AS_HELP_STRING([--with-llvm-prefix],
|
||||||
@@ -1539,9 +1533,9 @@ if test "x$enable_gallium_llvm" = xauto; then
|
|||||||
fi
|
fi
|
||||||
if test "x$enable_gallium_llvm" = xyes; then
|
if test "x$enable_gallium_llvm" = xyes; then
|
||||||
if test "x$llvm_prefix" != x; then
|
if test "x$llvm_prefix" != x; then
|
||||||
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
|
AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
|
||||||
else
|
else
|
||||||
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
|
AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$LLVM_CONFIG" != xno; then
|
if test "x$LLVM_CONFIG" != xno; then
|
||||||
|
150
docs/relnotes/10.0.1.html
Normal file
150
docs/relnotes/10.0.1.html
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
<!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 10.0.1 Release Notes / (December 12, 2013)</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Mesa 10.0.1 is a bug fix release which fixes bugs found since the 10.0 release.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Mesa 10.0.1 implements the OpenGL 3.3 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.3. OpenGL
|
||||||
|
3.3 is <strong>only</strong> available if requested at context creation
|
||||||
|
because compatibility contexts not supported.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>MD5 checksums</h2>
|
||||||
|
<pre>
|
||||||
|
0a72ca5b36046a658bf6038326ff32ed MesaLib-10.0.1.tar.bz2
|
||||||
|
01bde35c912e504ba62caf1ef9f7022c MesaLib-10.0.1.tar.gz
|
||||||
|
59a174a11a89e6b1b8ee9c3f7e3c388c MesaLib-10.0.1.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=64323">Bug 64323</a> - Severe misrendering in Left 4 Dead 2</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68838">Bug 68838</a> - GLSL: struct declarations produce a "empty declaration warning" in 9.2</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69155">Bug 69155</a> - [NV50 gallium] [piglit] bin/varying-packing-simple triggers memory corruption/failures</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70250">Bug 70250</a> - weston-terminal rendering corrupted with output transform 90 and 270</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70601">Bug 70601</a> - [SNB Bisected]Piglit spec/ARB_texture_float/multisample-formats 2 GL_ARB_texture_float fails</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72230">Bug 72230</a> - Unable to extract MesaLib-10.0.0.tar.{gz,bz2} with bsdtar</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72325">Bug 72325</a> - [swrast] piglit glean fbo regression</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72327">Bug 72327</a> - [swrast] piglit glean pointSprite regression</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-10.0..mesa-10.0.1
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<p>Axel Davy (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>egl/wayland: Flush the wl_display at the end of SwapBuffers</li>
|
||||||
|
<li>Enable throttling in SwapBuffers</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Chad Versace (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>i965/hsw: Apply non-msrt fast color clear w/a to all HSW GTs</li>
|
||||||
|
<li>i965: Add extra-alignment for non-msrt fast color clear for all hw (v2)</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Dave Airlie (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>swrast: fix readback regression since inversion fix</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Emil Velikov (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>automake: include only one copy VERSION in tarball</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Ian Romanick (3):</p>
|
||||||
|
<ul>
|
||||||
|
<li>docs: Add 10.0 release md5sums</li>
|
||||||
|
<li>Remove a057b83 from the pick list</li>
|
||||||
|
<li>glsl: Don't emit empty declaration warning for a struct specifier</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Ilia Mirkin (8):</p>
|
||||||
|
<ul>
|
||||||
|
<li>mesa: don't leak performance monitors on context destroy</li>
|
||||||
|
<li>nv50: Fix GPU_READING/WRITING bit removal</li>
|
||||||
|
<li>nouveau: avoid leaking fences while waiting</li>
|
||||||
|
<li>nv50: wait on the buf's fence before sticking it into pushbuf</li>
|
||||||
|
<li>nv50: enable h264 and mpeg4 for nv98+ (vp3, vp4.0)</li>
|
||||||
|
<li>nouveau/video: update h264 picparm field names based on usage</li>
|
||||||
|
<li>nouveau/video: update a few more h264 picparm field names</li>
|
||||||
|
<li>nv50: report 15 max inputs for fragment programs</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Jordan Justen (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>dri megadriver_stub: add compatibility for older DRI loaders</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Kristian Høgsberg (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>egl/wayland: Damage INT32_MAX x INT32_MAX region for eglSwapBuffers</li>
|
||||||
|
<li>egl/wayland: Send commit after flushing the driver context</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Maarten Lankhorst (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>nouveau: Fix compiler warning regression</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Paul Berry (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>i965/gen6: Fix multisample resolve blits for luminance/intensity 32F formats.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Thomas Hellstrom (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>st/xa: Bump major version number to 2</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Tom Stellard (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>r300/compiler/tests: Fix segfault</li>
|
||||||
|
<li>r300/compiler/tests: Fix line length check in test parser</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
161
docs/relnotes/10.0.2.html
Normal file
161
docs/relnotes/10.0.2.html
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
<!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 10.0.2 Release Notes / (January 9, 2014)</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Mesa 10.0.2 is a bug fix release which fixes bugs found since the 10.0.1 release.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Mesa 10.0.2 implements the OpenGL 3.3 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.3. OpenGL
|
||||||
|
3.3 is <strong>only</strong> available if requested at context creation
|
||||||
|
because compatibility contexts not supported.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>MD5 checksums</h2>
|
||||||
|
<pre>
|
||||||
|
de7d14baf0101b697c140d2f47ef27e9 MesaLib-10.0.2.tar.gz
|
||||||
|
8544c0ab3e438a08b5103421ea15b6d2 MesaLib-10.0.2.tar.bz2
|
||||||
|
181b0d6c1afca38e98a930d0e564ed90 MesaLib-10.0.2.zip
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>New features</h2>
|
||||||
|
<p>None</p>
|
||||||
|
|
||||||
|
<h2>Bug fixes</h2>
|
||||||
|
|
||||||
|
<p>This list is likely incomplete.</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70740">Bug 70740</a> - HiZ on SNB causes GPU hang with WebGL web app</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72026">Bug 72026</a> - SIGSEGV in fs_visitor::visit(ir_dereference_variable*)</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72264">Bug 72264</a> - GLSL error reporting</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72369">Bug 72369</a> - glitches in serious sam 3 with the sb shader backend</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-10.0.1..mesa-10.0.2
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<p>Aaron Watry (8):</p>
|
||||||
|
<ul>
|
||||||
|
<li>clover: Remove unused variable</li>
|
||||||
|
<li>pipe_loader/sw: close dev->lib when initialization fails</li>
|
||||||
|
<li>radeon/compute: Stop leaking LLVMContexts in radeon_llvm_parse_bitcode</li>
|
||||||
|
<li>r600/compute: Free compiled kernels when deleting compute state</li>
|
||||||
|
<li>r600/compute: Use the correct FREE macro when deleting compute state</li>
|
||||||
|
<li>radeon/llvm: Free target data at end of optimization</li>
|
||||||
|
<li>st/vdpau: Destroy context when initialization fails</li>
|
||||||
|
<li>r600/pipe: Stop leaking context->start_compute_cs_cmd.buf on EG/CM</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Alex Deucher (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>r600g: fix SUMO2 pci id</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Alexander von Gluck IV (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>Haiku: Add in public GL kit headers</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Anuj Phogat (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>mesa: Fix error code generation in glBeginConditionalRender()</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Carl Worth (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>docs: Add md5sums for the 10.0.1 release.</li>
|
||||||
|
<li>Update version to 10.0.2</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Chad Versace (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>i965/gen6: Fix HiZ hang in WebGL Google Maps</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Erik Faye-Lund (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>glcpp: error on multiple #else/#elif directives</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Henri Verbeet (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>i915: Add support for gl_FragData[0] reads.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Ilia Mirkin (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>nv50: fix a small leak on context destroy</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Jonathan Liu (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>st/mesa: use pipe_sampler_view_release()</li>
|
||||||
|
<li>llvmpipe: use pipe_sampler_view_release() to avoid segfault</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Kenneth Graunke (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>i965: Fix 3DSTATE_PUSH_CONSTANT_ALLOC_PS packet creation.</li>
|
||||||
|
<li>Revert "mesa: Remove GLXContextID typedef from glx.h."</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Kevin Rogovin (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>Use line number information from entire function expression</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Kristian Høgsberg (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>dri_util: Don't assume __DRIcontext->driverPrivate is a gl_context</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Marek Olšák (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>mesa: fix interpretation of glClearBuffer(drawbuffer)</li>
|
||||||
|
<li>st/mesa: fix glClear with multiple colorbuffers and different formats</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Paul Berry (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>glsl: Teach ir_variable_refcount about ir_loop::counter variables.</li>
|
||||||
|
<li>glsl: Fix inconsistent assumptions about ir_loop::counter.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Vadim Girlin (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>r600g/sb: fix stack size computation on evergreen</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
203
docs/relnotes/10.0.3.html
Normal file
203
docs/relnotes/10.0.3.html
Normal file
@@ -0,0 +1,203 @@
|
|||||||
|
<!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 10.0.3 Release Notes / (February 3, 2014)</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Mesa 10.0.3 is a bug fix release which fixes bugs found since the 10.0.2 release.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Mesa 10.0.3 implements the OpenGL 3.3 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.3. OpenGL
|
||||||
|
3.3 is <strong>only</strong> available if requested at context creation
|
||||||
|
because compatibility contexts not supported.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>MD5 checksums</h2>
|
||||||
|
<pre>
|
||||||
|
</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=72708">Bug 72708</a> - Master fails to build with older gcc due to -msse4.1</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72926">Bug 72926</a> - [REGRESSION,swrast] Memory-related crash with anti-aliasing enabled</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73096">Bug 73096</a> - Query GL_RGBA_SIGNED_COMPONENTS_EXT missing</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73100">Bug 73100</a> - Please use AC_PATH_TOOL instead of AC_PATH_PROG for llvm-config</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73418">Bug 73418</a> - OpenCL hangs graphics on CAYMAN</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73473">Bug 73473</a> - Potential crash bug in src/gallium/auxiliary/rtasm/rtasm_execmem.c</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73915">Bug 73915</a> - sample shading + centroid broken since f5cfb4a</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73956">Bug 73956</a> - SIGSEGV when passing GL_NONE to glReadBuffer</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74026">Bug 74026</a> - Compiler rejects chained assignments involving array dereferences</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-10.0.2..mesa-10.0.3
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<p>Aaron Watry (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>radeon: Move gfx/dma cs cleanup to r600_common_context_cleanup</li>
|
||||||
|
<li>st/dri: prevent leak of dri option default values</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Andreas Fänger (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>swrast: fix delayed texel buffer allocation regression for OpenMP</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Anuj Phogat (3):</p>
|
||||||
|
<ul>
|
||||||
|
<li>glsl: Disable ARB_texture_rectangle in shader version 100.</li>
|
||||||
|
<li>i965: Use sample barycentric coordinates with per sample shading</li>
|
||||||
|
<li>i965: Ignore 'centroid' interpolation qualifier in case of persample shading</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Brian Paul (3):</p>
|
||||||
|
<ul>
|
||||||
|
<li>mesa: implement missing glGet(GL_RGBA_SIGNED_COMPONENTS_EXT) query</li>
|
||||||
|
<li>st/mesa: fix glReadBuffer(GL_NONE) segfault</li>
|
||||||
|
<li>draw: fix incorrect vertex size computation in LLVM drawing code</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Carl Worth (5):</p>
|
||||||
|
<ul>
|
||||||
|
<li>Add md5sums for 10.0.2. release.</li>
|
||||||
|
<li>cherry-ignore: Ignore several patches not yet ready for the stable branch</li>
|
||||||
|
<li>Drop another couple of patches.</li>
|
||||||
|
<li>cherry-ignore: Ignore 4 patches at teh request of the author, (Anuj).</li>
|
||||||
|
<li>Update version to 10.0.3</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Chad Versace (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>i965/gen6/blorp: Emit more flushes to workaround hangs</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Chris Forbes (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>i965: fold offset into coord for textureOffset(gsampler2DRect)</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Emil Velikov (5):</p>
|
||||||
|
<ul>
|
||||||
|
<li>mesa: use signed temporary variable to store _ColorDrawBufferIndexes</li>
|
||||||
|
<li>st/mesa: use signed temporary variable to store _ColorDrawBufferIndexes</li>
|
||||||
|
<li>nv50: access only the available amount of textures</li>
|
||||||
|
<li>nv50: access only the available amount of constbuf</li>
|
||||||
|
<li>gallium/rtasm: handle mmap failures appropriately</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Eric Anholt (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>i965: Fix handling of MESA_pack_invert in blit (PBO) readpixels.</li>
|
||||||
|
<li>i965: Don't do the temporary-and-blit-copy for INVALIDATE_RANGE maps.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Ian Romanick (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>mesa: Add COMPRESSED_RGBA_S3TC_DXT1_EXT to COMPRESSED_TEXTURE_FORMATS for GLES</li>
|
||||||
|
<li>radeon / r200: Pass the API into _mesa_initialize_context</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Ilia Mirkin (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>mesa: fix GL_COLOR_SUM enum for drivers without ARB_vertex_program</li>
|
||||||
|
<li>st/vdpau: don't return a device if the screen doesn't support NPOT</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>José Fonseca (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>mesa: Use IROUND instead of roundf.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Kenneth Graunke (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>glsl: Rename "expr" to "lhs_expr" in vector_extract munging code.</li>
|
||||||
|
<li>glsl: Fix chained assignments of vector channels.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Lauri Kasanen (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>mesa: Fix build to properly check for supported compiler flags</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Marek Olšák (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>st/mesa: use sRGB formats for MSAA resolving if destination is sRGB</li>
|
||||||
|
<li>gallium/util: util_format_srgb should not return FORMAT_NONE for sRGB formats</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Matt Turner (2):</p>
|
||||||
|
<ul>
|
||||||
|
<li>glcpp: Define GL_EXT_shader_integer_mix in both GL and ES.</li>
|
||||||
|
<li>glx: Update glxext.h to revision 24777.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Michał Górny (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>Use AC_PATH_TOOL instead of AC_PATH_PROG for llvm-config.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Paul Berry (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>i965: Ensure that all necessary state is re-emitted if we run out of aperture.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Paul Seidler (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>build: move ARCH_LIBS definition outside of ASM definition</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Thomas Sondergaard (4):</p>
|
||||||
|
<ul>
|
||||||
|
<li>mesa: Preliminary support for MSVC_VERSION=12.0</li>
|
||||||
|
<li>mesa: Fix compile error with MSVC 2013</li>
|
||||||
|
<li>mesa: Work around internal compiler error</li>
|
||||||
|
<li>mesa: Namespace qualify fma to override ambiguity with fma from math.h</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Tom Stellard (1):</p>
|
||||||
|
<ul>
|
||||||
|
<li>r600g/compute: Emit DEALLOC_STATE on cayman after dispatching a compute shader.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -14,7 +14,7 @@
|
|||||||
<iframe src="../contents.html"></iframe>
|
<iframe src="../contents.html"></iframe>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
||||||
<h1>Mesa 10.0 Release Notes / TBD</h1>
|
<h1>Mesa 10.0 Release Notes / (November 30th, 2013)</h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Mesa 10.0 is a new development release.
|
Mesa 10.0 is a new development release.
|
||||||
@@ -33,7 +33,9 @@ because compatibility contexts are not supported.
|
|||||||
|
|
||||||
<h2>MD5 checksums</h2>
|
<h2>MD5 checksums</h2>
|
||||||
<pre>
|
<pre>
|
||||||
TBD.
|
b38626b96c664db67a534d7859682436 MesaLib-10.0.0.tar.gz
|
||||||
|
f3fe55d9735bea158bbe97ed9a0da819 MesaLib-10.0.0.tar.bz2
|
||||||
|
c6ee1ce51e3bf35947d2978b872daf51 MesaLib-10.0.0.zip
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
@@ -55,16 +57,89 @@ Note: some of the new features are only available with certain drivers.
|
|||||||
<li>GL_ARB_vertex_attrib_binding</li>
|
<li>GL_ARB_vertex_attrib_binding</li>
|
||||||
<li>GL_ARB_vertex_type_10f_11f_11f_rev on i965 and r600g</li>
|
<li>GL_ARB_vertex_type_10f_11f_11f_rev on i965 and r600g</li>
|
||||||
<li>GL_KHR_debug</li>
|
<li>GL_KHR_debug</li>
|
||||||
|
<li>GLX_MESA_query_renderer</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<h2>Bug fixes</h2>
|
<h2>Bug fixes</h2>
|
||||||
|
|
||||||
TBD.
|
<p>Attempts have been made to <b>not</b> include bugs fixed in previous 9.2
|
||||||
|
releases or bugs that were regressions during 10.0 development. This list is
|
||||||
|
likely incomplete.</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47755">Bug 47755</a> - [glsl-compiler] no error checking when Interpolation qualifier for built-in variable is different in vertex and fragment shader</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=52171">Bug 52171</a> - [gallium/r600/clover] Simple benchmarks failed to run</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53077">Bug 53077</a> - [IVB] Output error with msaa when both of framebuffer and source color's alpha are not 1</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=54867">Bug 54867</a> - bug in r300 compiler</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60929">Bug 60929</a> - [r600-llvm] mono games with opengl are blocking on start</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62142">Bug 62142</a> - Mesa/demo mipmap_limits upside down with running by SOFTWARE</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62698">Bug 62698</a> - [bisected] WebGL demo "Consumed": texstate.c:628: update_texture_state: Assertion „__builtin_popcount(enabledTargets) == 1“ failed.</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64225">Bug 64225</a> - bfgminer --scyte generates Segmentation Fault on Northern Island</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64226">Bug 64226</a> - python-opencl package generate segmentation fault at pipe_r600.so</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64261">Bug 64261</a> - [SNB Bisected]Ogles3conform GL3Tests_color_buffer_float_color_buffer_float_clamp_fixed.test fail</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66213">Bug 66213</a> - Certain Mesa Demos Rendering Inverted (vertically)</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66806">Bug 66806</a> - [softpipe] glxgears floating point exception</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67921">Bug 67921</a> - [bisected commit 883987] crosscompiling fails with util/u_cpu_detect.c:247:4: error: 'asm' undeclared (first use in this function)</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=68451">Bug 68451</a> - Texture flicker in native Dota2 in mesa 9.2.0rc1</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68503">Bug 68503</a> - Graphical glitches in Serious Sam 3 when SB is enabled</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68792">Bug 68792</a> - Problems during playback of h264 files using UVD and VLC on AMD E-350 CPU</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68845">Bug 68845</a> - VDPAU/UVD regression</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69078">Bug 69078</a> - Modern Warfare (1, 2 and 3) broken in Wine on SNB</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69321">Bug 69321</a> - starting openCL crashes/boots system</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70042">Bug 70042</a> - Major texture flickering in Dota 2 (r600g on HD 6950)</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70088">Bug 70088</a> - Glamor on r600g crashes Xserver</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70123">Bug 70123</a> - Freeze caused by 'winsys/radeon: remove cs_queue_empty' commit</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70327">Bug 70327</a> - Casting floating point variable to integer not working properly while constant gets converted properly</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70891">Bug 70891</a> - CL_INVALID_BUILD_OPTIONS results in CL_INVALID_DEVICE when asking for build log</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70913">Bug 70913</a> - [PIGLIT,radeonsi] crash in "spec/EXT_framebuffer_multisample/sample-alpha-to-coverage 4 depth" (buffer overflow)</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71022">Bug 71022</a> - configure: error: Expat required for DRI.</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71110">Bug 71110</a> - xorg_driver.c:1030:2: error: too many arguments to function ‘DamageUnregister’</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71172">Bug 71172</a> - Segfault when running glxinfo. NV25GL [Quadro4 900 XGL]</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71512">Bug 71512</a> - dlopen.h:54: undefined reference to `dlopen'</li>
|
||||||
|
|
||||||
|
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71870">Bug 71870</a> - Metro: Last Light rendering issues</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
<h2>Changes</h2>
|
<h2>Changes</h2>
|
||||||
|
|
||||||
TBD.
|
<ul>
|
||||||
|
<li>Removed X.Org state tracker (unmaintained and broken)</li>
|
||||||
|
<li>Removed the video-accel r300 targets</li>
|
||||||
|
<li>Removed the video-accel softpipe targets</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@@ -168,6 +168,7 @@ typedef XID GLXDrawable;
|
|||||||
/* GLX 1.3 and later */
|
/* GLX 1.3 and later */
|
||||||
typedef struct __GLXFBConfigRec *GLXFBConfig;
|
typedef struct __GLXFBConfigRec *GLXFBConfig;
|
||||||
typedef XID GLXFBConfigID;
|
typedef XID GLXFBConfigID;
|
||||||
|
typedef XID GLXContextID;
|
||||||
typedef XID GLXWindow;
|
typedef XID GLXWindow;
|
||||||
typedef XID GLXPbuffer;
|
typedef XID GLXPbuffer;
|
||||||
|
|
||||||
|
@@ -33,10 +33,10 @@ extern "C" {
|
|||||||
** used to make the header, and the header can be found at
|
** used to make the header, and the header can be found at
|
||||||
** http://www.opengl.org/registry/
|
** http://www.opengl.org/registry/
|
||||||
**
|
**
|
||||||
** Khronos $Revision: 23422 $ on $Date: 2013-10-08 15:40:45 -0700 (Tue, 08 Oct 2013) $
|
** Khronos $Revision: 24777 $ on $Date: 2014-01-14 14:02:32 -0800 (Tue, 14 Jan 2014) $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define GLX_GLXEXT_VERSION 20131008
|
#define GLX_GLXEXT_VERSION 20140114
|
||||||
|
|
||||||
/* Generated C header for:
|
/* Generated C header for:
|
||||||
* API: glx
|
* API: glx
|
||||||
@@ -49,6 +49,7 @@ extern "C" {
|
|||||||
|
|
||||||
#ifndef GLX_VERSION_1_3
|
#ifndef GLX_VERSION_1_3
|
||||||
#define GLX_VERSION_1_3 1
|
#define GLX_VERSION_1_3 1
|
||||||
|
typedef XID GLXContextID;
|
||||||
typedef struct __GLXFBConfigRec *GLXFBConfig;
|
typedef struct __GLXFBConfigRec *GLXFBConfig;
|
||||||
typedef XID GLXWindow;
|
typedef XID GLXWindow;
|
||||||
typedef XID GLXPbuffer;
|
typedef XID GLXPbuffer;
|
||||||
@@ -272,7 +273,6 @@ __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName);
|
|||||||
|
|
||||||
#ifndef GLX_EXT_import_context
|
#ifndef GLX_EXT_import_context
|
||||||
#define GLX_EXT_import_context 1
|
#define GLX_EXT_import_context 1
|
||||||
typedef XID GLXContextID;
|
|
||||||
#define GLX_SHARE_CONTEXT_EXT 0x800A
|
#define GLX_SHARE_CONTEXT_EXT 0x800A
|
||||||
#define GLX_VISUAL_ID_EXT 0x800B
|
#define GLX_VISUAL_ID_EXT 0x800B
|
||||||
#define GLX_SCREEN_EXT 0x800C
|
#define GLX_SCREEN_EXT 0x800C
|
||||||
@@ -433,6 +433,14 @@ void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLe
|
|||||||
#endif
|
#endif
|
||||||
#endif /* GLX_NV_copy_image */
|
#endif /* GLX_NV_copy_image */
|
||||||
|
|
||||||
|
#ifndef GLX_NV_delay_before_swap
|
||||||
|
#define GLX_NV_delay_before_swap 1
|
||||||
|
typedef Bool ( *PFNGLXDELAYBEFORESWAPNVPROC) (Display *dpy, GLXDrawable drawable, GLfloat seconds);
|
||||||
|
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||||
|
Bool glXDelayBeforeSwapNV (Display *dpy, GLXDrawable drawable, GLfloat seconds);
|
||||||
|
#endif
|
||||||
|
#endif /* GLX_NV_delay_before_swap */
|
||||||
|
|
||||||
#ifndef GLX_NV_float_buffer
|
#ifndef GLX_NV_float_buffer
|
||||||
#define GLX_NV_float_buffer 1
|
#define GLX_NV_float_buffer 1
|
||||||
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
|
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
|
||||||
|
@@ -782,12 +782,6 @@ typedef __DRIdrawable *
|
|||||||
const __DRIconfig *config,
|
const __DRIconfig *config,
|
||||||
void *loaderPrivate);
|
void *loaderPrivate);
|
||||||
|
|
||||||
typedef __DRIcontext *
|
|
||||||
(*__DRIcreateNewContextFunc)(__DRIscreen *screen,
|
|
||||||
const __DRIconfig *config,
|
|
||||||
__DRIcontext *shared,
|
|
||||||
void *loaderPrivate);
|
|
||||||
|
|
||||||
typedef __DRIcontext *
|
typedef __DRIcontext *
|
||||||
(*__DRIcreateContextAttribsFunc)(__DRIscreen *screen,
|
(*__DRIcreateContextAttribsFunc)(__DRIscreen *screen,
|
||||||
int api,
|
int api,
|
||||||
@@ -949,7 +943,10 @@ struct __DRIdri2ExtensionRec {
|
|||||||
void *loaderPrivate);
|
void *loaderPrivate);
|
||||||
|
|
||||||
__DRIcreateNewDrawableFunc createNewDrawable;
|
__DRIcreateNewDrawableFunc createNewDrawable;
|
||||||
__DRIcreateNewContextFunc createNewContext;
|
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
|
||||||
|
const __DRIconfig *config,
|
||||||
|
__DRIcontext *shared,
|
||||||
|
void *loaderPrivate);
|
||||||
|
|
||||||
/* Since version 2 */
|
/* Since version 2 */
|
||||||
__DRIgetAPIMaskFunc getAPIMask;
|
__DRIgetAPIMaskFunc getAPIMask;
|
||||||
@@ -1405,7 +1402,6 @@ struct __DRIimageDriverExtensionRec {
|
|||||||
/* Common DRI functions, shared with DRI2 */
|
/* Common DRI functions, shared with DRI2 */
|
||||||
__DRIcreateNewScreen2Func createNewScreen2;
|
__DRIcreateNewScreen2Func createNewScreen2;
|
||||||
__DRIcreateNewDrawableFunc createNewDrawable;
|
__DRIcreateNewDrawableFunc createNewDrawable;
|
||||||
__DRIcreateNewContextFunc createNewContext;
|
|
||||||
__DRIcreateContextAttribsFunc createContextAttribs;
|
__DRIcreateContextAttribsFunc createContextAttribs;
|
||||||
__DRIgetAPIMaskFunc getAPIMask;
|
__DRIgetAPIMaskFunc getAPIMask;
|
||||||
};
|
};
|
||||||
|
76
include/HaikuGL/GLRenderer.h
Normal file
76
include/HaikuGL/GLRenderer.h
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2006, Philippe Houdoin. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
|
||||||
|
* This header defines BGLRenderer, the base class making up
|
||||||
|
* the Haiku GL renderer add-ons (essentially selfcontained C++
|
||||||
|
* shared libraries that do the actual rendering such as
|
||||||
|
* libswpipe.so and libswrast.so)
|
||||||
|
*/
|
||||||
|
#ifndef GLRENDERER_H
|
||||||
|
#define GLRENDERER_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <BeBuild.h>
|
||||||
|
#include <GLView.h>
|
||||||
|
|
||||||
|
|
||||||
|
class BGLDispatcher;
|
||||||
|
class GLRendererRoster;
|
||||||
|
|
||||||
|
typedef unsigned long renderer_id;
|
||||||
|
|
||||||
|
class BGLRenderer
|
||||||
|
{
|
||||||
|
// Private unimplemented copy constructors
|
||||||
|
BGLRenderer(const BGLRenderer &);
|
||||||
|
BGLRenderer & operator=(const BGLRenderer &);
|
||||||
|
|
||||||
|
public:
|
||||||
|
BGLRenderer(BGLView *view, ulong bgl_options,
|
||||||
|
BGLDispatcher *dispatcher);
|
||||||
|
virtual ~BGLRenderer();
|
||||||
|
|
||||||
|
void Acquire();
|
||||||
|
void Release();
|
||||||
|
|
||||||
|
virtual void LockGL();
|
||||||
|
virtual void UnlockGL();
|
||||||
|
|
||||||
|
virtual void SwapBuffers(bool VSync = false);
|
||||||
|
virtual void Draw(BRect updateRect);
|
||||||
|
virtual status_t CopyPixelsOut(BPoint source, BBitmap *dest);
|
||||||
|
virtual status_t CopyPixelsIn(BBitmap *source, BPoint dest);
|
||||||
|
|
||||||
|
virtual void FrameResized(float width, float height);
|
||||||
|
|
||||||
|
virtual void DirectConnected(direct_buffer_info *info);
|
||||||
|
virtual void EnableDirectMode(bool enabled);
|
||||||
|
|
||||||
|
inline int32 ReferenceCount() const { return fRefCount; };
|
||||||
|
inline ulong Options() const { return fOptions; };
|
||||||
|
inline BGLView* GLView() { return fView; };
|
||||||
|
inline BGLDispatcher* GLDispatcher() { return fDispatcher; };
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class GLRendererRoster;
|
||||||
|
|
||||||
|
virtual status_t _Reserved_Renderer_0(int32, void *);
|
||||||
|
virtual status_t _Reserved_Renderer_1(int32, void *);
|
||||||
|
virtual status_t _Reserved_Renderer_2(int32, void *);
|
||||||
|
virtual status_t _Reserved_Renderer_3(int32, void *);
|
||||||
|
virtual status_t _Reserved_Renderer_4(int32, void *);
|
||||||
|
|
||||||
|
volatile int32 fRefCount; // How much we're still usefull?
|
||||||
|
BGLView* fView; // Never forget who is the boss!
|
||||||
|
ulong fOptions; // Keep that tune in memory
|
||||||
|
BGLDispatcher* fDispatcher;// Our personal GL API call dispatcher
|
||||||
|
|
||||||
|
GLRendererRoster* fOwningRoster;
|
||||||
|
renderer_id fID;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern "C" _EXPORT BGLRenderer* instantiate_gl_renderer(BGLView *view, ulong options, BGLDispatcher *dispatcher);
|
||||||
|
|
||||||
|
|
||||||
|
#endif // GLRENDERER_H
|
193
include/HaikuGL/GLView.h
Normal file
193
include/HaikuGL/GLView.h
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2008-2013, Haiku, Inc. All Rights Reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* This header defines BGLView, the base class making up
|
||||||
|
* the Haiku GL Kit.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifndef BGLVIEW_H
|
||||||
|
#define BGLVIEW_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <GL/gl.h>
|
||||||
|
|
||||||
|
#define BGL_RGB 0
|
||||||
|
#define BGL_INDEX 1
|
||||||
|
#define BGL_SINGLE 0
|
||||||
|
#define BGL_DOUBLE 2
|
||||||
|
#define BGL_DIRECT 0
|
||||||
|
#define BGL_INDIRECT 4
|
||||||
|
#define BGL_ACCUM 8
|
||||||
|
#define BGL_ALPHA 16
|
||||||
|
#define BGL_DEPTH 32
|
||||||
|
#define BGL_OVERLAY 64
|
||||||
|
#define BGL_UNDERLAY 128
|
||||||
|
#define BGL_STENCIL 512
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
#include <AppKit.h>
|
||||||
|
#include <Bitmap.h>
|
||||||
|
#include <DirectWindow.h>
|
||||||
|
#include <View.h>
|
||||||
|
#include <Window.h>
|
||||||
|
#include <WindowScreen.h>
|
||||||
|
|
||||||
|
|
||||||
|
struct glview_direct_info;
|
||||||
|
class BGLRenderer;
|
||||||
|
class GLRendererRoster;
|
||||||
|
|
||||||
|
class BGLView : public BView {
|
||||||
|
public:
|
||||||
|
BGLView(BRect rect, const char* name,
|
||||||
|
ulong resizingMode, ulong mode,
|
||||||
|
ulong options);
|
||||||
|
virtual ~BGLView();
|
||||||
|
|
||||||
|
void LockGL();
|
||||||
|
void UnlockGL();
|
||||||
|
void SwapBuffers();
|
||||||
|
void SwapBuffers(bool vSync);
|
||||||
|
|
||||||
|
BView* EmbeddedView(); // deprecated, returns NULL
|
||||||
|
void* GetGLProcAddress(const char* procName);
|
||||||
|
|
||||||
|
status_t CopyPixelsOut(BPoint source, BBitmap *dest);
|
||||||
|
status_t CopyPixelsIn(BBitmap *source, BPoint dest);
|
||||||
|
|
||||||
|
// Mesa's GLenum is uint where Be's ones was ulong!
|
||||||
|
virtual void ErrorCallback(unsigned long errorCode);
|
||||||
|
|
||||||
|
virtual void Draw(BRect updateRect);
|
||||||
|
virtual void AttachedToWindow();
|
||||||
|
virtual void AllAttached();
|
||||||
|
virtual void DetachedFromWindow();
|
||||||
|
virtual void AllDetached();
|
||||||
|
|
||||||
|
virtual void FrameResized(float newWidth, float newHeight);
|
||||||
|
virtual status_t Perform(perform_code d, void *arg);
|
||||||
|
|
||||||
|
virtual status_t Archive(BMessage *data, bool deep = true) const;
|
||||||
|
|
||||||
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
virtual void SetResizingMode(uint32 mode);
|
||||||
|
|
||||||
|
virtual void Show();
|
||||||
|
virtual void Hide();
|
||||||
|
|
||||||
|
virtual BHandler* ResolveSpecifier(BMessage *msg, int32 index,
|
||||||
|
BMessage *specifier, int32 form,
|
||||||
|
const char *property);
|
||||||
|
virtual status_t GetSupportedSuites(BMessage *data);
|
||||||
|
|
||||||
|
void DirectConnected(direct_buffer_info *info);
|
||||||
|
void EnableDirectMode(bool enabled);
|
||||||
|
|
||||||
|
void* getGC() { return fGc; } // ???
|
||||||
|
|
||||||
|
virtual void GetPreferredSize(float* width, float* height);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
virtual void _ReservedGLView1();
|
||||||
|
virtual void _ReservedGLView2();
|
||||||
|
virtual void _ReservedGLView3();
|
||||||
|
virtual void _ReservedGLView4();
|
||||||
|
virtual void _ReservedGLView5();
|
||||||
|
virtual void _ReservedGLView6();
|
||||||
|
virtual void _ReservedGLView7();
|
||||||
|
virtual void _ReservedGLView8();
|
||||||
|
|
||||||
|
BGLView(const BGLView &);
|
||||||
|
BGLView &operator=(const BGLView &);
|
||||||
|
|
||||||
|
void _DitherFront();
|
||||||
|
bool _ConfirmDither();
|
||||||
|
void _Draw(BRect rect);
|
||||||
|
void _CallDirectConnected();
|
||||||
|
|
||||||
|
void* fGc;
|
||||||
|
uint32 fOptions;
|
||||||
|
uint32 fDitherCount;
|
||||||
|
BLocker fDrawLock;
|
||||||
|
BLocker fDisplayLock;
|
||||||
|
glview_direct_info* fClipInfo;
|
||||||
|
|
||||||
|
BGLRenderer* fRenderer;
|
||||||
|
GLRendererRoster* fRoster;
|
||||||
|
|
||||||
|
BBitmap* fDitherMap;
|
||||||
|
BRect fBounds;
|
||||||
|
int16* fErrorBuffer[2];
|
||||||
|
uint64 _reserved[8];
|
||||||
|
|
||||||
|
void _LockDraw();
|
||||||
|
void _UnlockDraw();
|
||||||
|
|
||||||
|
// BeOS compatibility
|
||||||
|
private:
|
||||||
|
BGLView(BRect rect, char* name,
|
||||||
|
ulong resizingMode, ulong mode,
|
||||||
|
ulong options);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class BGLScreen : public BWindowScreen {
|
||||||
|
public:
|
||||||
|
BGLScreen(char* name,
|
||||||
|
ulong screenMode, ulong options,
|
||||||
|
status_t *error, bool debug=false);
|
||||||
|
~BGLScreen();
|
||||||
|
|
||||||
|
void LockGL();
|
||||||
|
void UnlockGL();
|
||||||
|
void SwapBuffers();
|
||||||
|
// Mesa's GLenum is uint where Be's ones was ulong!
|
||||||
|
virtual void ErrorCallback(unsigned long errorCode);
|
||||||
|
|
||||||
|
virtual void ScreenConnected(bool connected);
|
||||||
|
virtual void FrameResized(float width, float height);
|
||||||
|
virtual status_t Perform(perform_code code, void *arg);
|
||||||
|
|
||||||
|
virtual status_t Archive(BMessage *data, bool deep = true) const;
|
||||||
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
|
||||||
|
virtual void Show();
|
||||||
|
virtual void Hide();
|
||||||
|
|
||||||
|
virtual BHandler* ResolveSpecifier(BMessage *message,
|
||||||
|
int32 index,
|
||||||
|
BMessage *specifier,
|
||||||
|
int32 form,
|
||||||
|
const char *property);
|
||||||
|
virtual status_t GetSupportedSuites(BMessage *data);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
virtual void _ReservedGLScreen1();
|
||||||
|
virtual void _ReservedGLScreen2();
|
||||||
|
virtual void _ReservedGLScreen3();
|
||||||
|
virtual void _ReservedGLScreen4();
|
||||||
|
virtual void _ReservedGLScreen5();
|
||||||
|
virtual void _ReservedGLScreen6();
|
||||||
|
virtual void _ReservedGLScreen7();
|
||||||
|
virtual void _ReservedGLScreen8();
|
||||||
|
|
||||||
|
BGLScreen(const BGLScreen &);
|
||||||
|
BGLScreen &operator=(const BGLScreen &);
|
||||||
|
|
||||||
|
void* fGc;
|
||||||
|
long fOptions;
|
||||||
|
BLocker fDrawLock;
|
||||||
|
|
||||||
|
int32 fColorSpace;
|
||||||
|
uint32 fScreenMode;
|
||||||
|
|
||||||
|
uint64 _reserved[7];
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
#endif // BGLVIEW_H
|
10
include/HaikuGL/OpenGLKit.h
Normal file
10
include/HaikuGL/OpenGLKit.h
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* Master include file for the Haiku OpenGL Kit.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GLView.h>
|
||||||
|
|
||||||
|
// Projects needing GL/glu.h and GL/glut.h should now
|
||||||
|
// include these headers independently as glu and glut
|
||||||
|
// are no longe core parts of mesa
|
28
include/HaikuGL/README
Normal file
28
include/HaikuGL/README
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
These headers make up the Haiku Op*nGL kit.
|
||||||
|
|
||||||
|
Headers in this directory preserve some BeOS™ compatibility
|
||||||
|
compatibility, so changes should be mentioned to the Haiku
|
||||||
|
project mailing list.
|
||||||
|
|
||||||
|
http://haiku-os.org
|
||||||
|
|
||||||
|
Normal Haiku Op*enGL layout:
|
||||||
|
|
||||||
|
* headers/os/OpenGLKit.h
|
||||||
|
* headers/os/opengl/GLView.h
|
||||||
|
* headers/os/opengl/GLRenderer.h
|
||||||
|
* headers/os/opengl/GL/gl.h
|
||||||
|
* headers/os/opengl/GL/gl_mangle.h
|
||||||
|
* headers/os/opengl/GL/glext.h
|
||||||
|
* headers/os/opengl/GL/osmesa.h (needed?)
|
||||||
|
|
||||||
|
Extras:
|
||||||
|
|
||||||
|
* headers/os/opengl/GL/glu.h
|
||||||
|
* headers/os/opengl/GL/glut.h
|
||||||
|
|
||||||
|
OpenGL™ is a trademark of SGI. The usage of this trademark
|
||||||
|
in the Haiku GL Kit is not a sign of any certification or
|
||||||
|
endorsement by SGI or its affiliates. Usage is purely to
|
||||||
|
allow legacy compatibility with the BeOS™ and its 3D GL
|
||||||
|
rendering subsystem.
|
@@ -208,7 +208,7 @@ CHIPSET(0x9644, SUMO2_9644, SUMO2)
|
|||||||
CHIPSET(0x9645, SUMO2_9645, SUMO2)
|
CHIPSET(0x9645, SUMO2_9645, SUMO2)
|
||||||
CHIPSET(0x9647, SUMO_9647, SUMO)
|
CHIPSET(0x9647, SUMO_9647, SUMO)
|
||||||
CHIPSET(0x9648, SUMO_9648, SUMO)
|
CHIPSET(0x9648, SUMO_9648, SUMO)
|
||||||
CHIPSET(0x9649, SUMO_9649, SUMO)
|
CHIPSET(0x9649, SUMO2_9649, SUMO2)
|
||||||
CHIPSET(0x964a, SUMO_964A, SUMO)
|
CHIPSET(0x964a, SUMO_964A, SUMO)
|
||||||
CHIPSET(0x964b, SUMO_964B, SUMO)
|
CHIPSET(0x964b, SUMO_964B, SUMO)
|
||||||
CHIPSET(0x964c, SUMO_964C, SUMO)
|
CHIPSET(0x964c, SUMO_964C, SUMO)
|
||||||
|
72
m4/ax_check_compile_flag.m4
Normal file
72
m4/ax_check_compile_flag.m4
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
# ===========================================================================
|
||||||
|
# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
|
||||||
|
# ===========================================================================
|
||||||
|
#
|
||||||
|
# SYNOPSIS
|
||||||
|
#
|
||||||
|
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
|
||||||
|
#
|
||||||
|
# DESCRIPTION
|
||||||
|
#
|
||||||
|
# Check whether the given FLAG works with the current language's compiler
|
||||||
|
# or gives an error. (Warnings, however, are ignored)
|
||||||
|
#
|
||||||
|
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
||||||
|
# success/failure.
|
||||||
|
#
|
||||||
|
# If EXTRA-FLAGS is defined, it is added to the current language's default
|
||||||
|
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
|
||||||
|
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
|
||||||
|
# force the compiler to issue an error when a bad flag is given.
|
||||||
|
#
|
||||||
|
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
|
||||||
|
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
|
||||||
|
#
|
||||||
|
# LICENSE
|
||||||
|
#
|
||||||
|
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
||||||
|
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License as published by the
|
||||||
|
# Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
# option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but
|
||||||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||||
|
# Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along
|
||||||
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||||
|
# gives unlimited permission to copy, distribute and modify the configure
|
||||||
|
# scripts that are the output of Autoconf when processing the Macro. You
|
||||||
|
# need not follow the terms of the GNU General Public License when using
|
||||||
|
# or distributing such scripts, even though portions of the text of the
|
||||||
|
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||||
|
# all other use of the material that constitutes the Autoconf Macro.
|
||||||
|
#
|
||||||
|
# This special exception to the GPL applies to versions of the Autoconf
|
||||||
|
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||||
|
# modified version of the Autoconf Macro, you may extend this special
|
||||||
|
# exception to the GPL to apply to your modified version as well.
|
||||||
|
|
||||||
|
#serial 2
|
||||||
|
|
||||||
|
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
||||||
|
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
|
||||||
|
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
||||||
|
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
||||||
|
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||||
|
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
|
||||||
|
[AS_VAR_SET(CACHEVAR,[yes])],
|
||||||
|
[AS_VAR_SET(CACHEVAR,[no])])
|
||||||
|
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
|
||||||
|
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
|
||||||
|
[m4_default([$2], :)],
|
||||||
|
[m4_default([$3], :)])
|
||||||
|
AS_VAR_POPDEF([CACHEVAR])dnl
|
||||||
|
])dnl AX_CHECK_COMPILE_FLAGS
|
@@ -117,7 +117,7 @@ struct dri2_egl_display
|
|||||||
|
|
||||||
__DRIdri2LoaderExtension dri2_loader_extension;
|
__DRIdri2LoaderExtension dri2_loader_extension;
|
||||||
__DRIswrastLoaderExtension swrast_loader_extension;
|
__DRIswrastLoaderExtension swrast_loader_extension;
|
||||||
const __DRIextension *extensions[4];
|
const __DRIextension *extensions[5];
|
||||||
const __DRIextension **driver_extensions;
|
const __DRIextension **driver_extensions;
|
||||||
|
|
||||||
#ifdef HAVE_X11_PLATFORM
|
#ifdef HAVE_X11_PLATFORM
|
||||||
@@ -189,7 +189,6 @@ struct dri2_egl_surface
|
|||||||
#ifdef HAVE_WAYLAND_PLATFORM
|
#ifdef HAVE_WAYLAND_PLATFORM
|
||||||
struct wl_buffer *wl_buffer;
|
struct wl_buffer *wl_buffer;
|
||||||
__DRIimage *dri_image;
|
__DRIimage *dri_image;
|
||||||
int pitch, name;
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_DRM_PLATFORM
|
#ifdef HAVE_DRM_PLATFORM
|
||||||
struct gbm_bo *bo;
|
struct gbm_bo *bo;
|
||||||
|
@@ -175,13 +175,12 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
|
get_back_bo(struct dri2_egl_surface *dri2_surf)
|
||||||
{
|
{
|
||||||
struct dri2_egl_display *dri2_dpy =
|
struct dri2_egl_display *dri2_dpy =
|
||||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||||
struct gbm_dri_bo *bo;
|
|
||||||
struct gbm_dri_surface *surf = dri2_surf->gbm_surf;
|
struct gbm_dri_surface *surf = dri2_surf->gbm_surf;
|
||||||
int i, name, pitch;
|
int i;
|
||||||
|
|
||||||
if (dri2_surf->back == NULL) {
|
if (dri2_surf->back == NULL) {
|
||||||
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
|
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
|
||||||
@@ -201,6 +200,17 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
|
|||||||
if (dri2_surf->back->bo == NULL)
|
if (dri2_surf->back->bo == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
back_bo_to_dri_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
|
||||||
|
{
|
||||||
|
struct dri2_egl_display *dri2_dpy =
|
||||||
|
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||||
|
struct gbm_dri_bo *bo;
|
||||||
|
int name, pitch;
|
||||||
|
|
||||||
bo = (struct gbm_dri_bo *) dri2_surf->back->bo;
|
bo = (struct gbm_dri_bo *) dri2_surf->back->bo;
|
||||||
|
|
||||||
dri2_dpy->image->queryImage(bo->image, __DRI_IMAGE_ATTRIB_NAME, &name);
|
dri2_dpy->image->queryImage(bo->image, __DRI_IMAGE_ATTRIB_NAME, &name);
|
||||||
@@ -211,8 +221,6 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
|
|||||||
buffer->pitch = pitch;
|
buffer->pitch = pitch;
|
||||||
buffer->cpp = 4;
|
buffer->cpp = 4;
|
||||||
buffer->flags = 0;
|
buffer->flags = 0;
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -254,10 +262,11 @@ dri2_get_buffers_with_format(__DRIdrawable *driDrawable,
|
|||||||
|
|
||||||
switch (attachments[i]) {
|
switch (attachments[i]) {
|
||||||
case __DRI_BUFFER_BACK_LEFT:
|
case __DRI_BUFFER_BACK_LEFT:
|
||||||
if (get_back_bo(dri2_surf, &dri2_surf->buffers[j]) < 0) {
|
if (get_back_bo(dri2_surf) < 0) {
|
||||||
_eglError(EGL_BAD_ALLOC, "failed to allocate color buffer");
|
_eglError(EGL_BAD_ALLOC, "failed to allocate color buffer");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
back_bo_to_dri_buffer(dri2_surf, &dri2_surf->buffers[j]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (get_aux_bo(dri2_surf, attachments[i], attachments[i + 1],
|
if (get_aux_bo(dri2_surf, attachments[i], attachments[i + 1],
|
||||||
@@ -312,6 +321,27 @@ dri2_get_buffers(__DRIdrawable * driDrawable,
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
dri_image_get_buffers(__DRIdrawable *driDrawable,
|
||||||
|
unsigned int format,
|
||||||
|
uint32_t *stamp,
|
||||||
|
void *loaderPrivate,
|
||||||
|
uint32_t buffer_mask,
|
||||||
|
struct __DRIimageList *buffers)
|
||||||
|
{
|
||||||
|
struct dri2_egl_surface *dri2_surf = loaderPrivate;
|
||||||
|
struct gbm_dri_bo *bo;
|
||||||
|
|
||||||
|
if (get_back_bo(dri2_surf) < 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
bo = (struct gbm_dri_bo *) dri2_surf->back->bo;
|
||||||
|
buffers->image_mask = __DRI_IMAGE_BUFFER_BACK;
|
||||||
|
buffers->back = bo->image;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
|
dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
|
||||||
{
|
{
|
||||||
@@ -348,9 +378,8 @@ dri2_query_buffer_age(_EGLDriver *drv,
|
|||||||
_EGLDisplay *disp, _EGLSurface *surface)
|
_EGLDisplay *disp, _EGLSurface *surface)
|
||||||
{
|
{
|
||||||
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
|
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
|
||||||
__DRIbuffer buffer;
|
|
||||||
|
|
||||||
if (get_back_bo(dri2_surf, &buffer) < 0) {
|
if (get_back_bo(dri2_surf) < 0) {
|
||||||
_eglError(EGL_BAD_ALLOC, "dri2_query_buffer_age");
|
_eglError(EGL_BAD_ALLOC, "dri2_query_buffer_age");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -469,6 +498,7 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
|
|||||||
dri2_dpy->gbm_dri->get_buffers = dri2_get_buffers;
|
dri2_dpy->gbm_dri->get_buffers = dri2_get_buffers;
|
||||||
dri2_dpy->gbm_dri->flush_front_buffer = dri2_flush_front_buffer;
|
dri2_dpy->gbm_dri->flush_front_buffer = dri2_flush_front_buffer;
|
||||||
dri2_dpy->gbm_dri->get_buffers_with_format = dri2_get_buffers_with_format;
|
dri2_dpy->gbm_dri->get_buffers_with_format = dri2_get_buffers_with_format;
|
||||||
|
dri2_dpy->gbm_dri->image_get_buffers = dri_image_get_buffers;
|
||||||
|
|
||||||
dri2_dpy->gbm_dri->base.base.surface_lock_front_buffer = lock_front_buffer;
|
dri2_dpy->gbm_dri->base.base.surface_lock_front_buffer = lock_front_buffer;
|
||||||
dri2_dpy->gbm_dri->base.base.surface_release_buffer = release_buffer;
|
dri2_dpy->gbm_dri->base.base.surface_release_buffer = release_buffer;
|
||||||
|
@@ -257,12 +257,11 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
|
get_back_bo(struct dri2_egl_surface *dri2_surf)
|
||||||
{
|
{
|
||||||
struct dri2_egl_display *dri2_dpy =
|
struct dri2_egl_display *dri2_dpy =
|
||||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||||
__DRIimage *image;
|
int i;
|
||||||
int i, name, pitch;
|
|
||||||
|
|
||||||
/* There might be a buffer release already queued that wasn't processed */
|
/* There might be a buffer release already queued that wasn't processed */
|
||||||
wl_display_dispatch_queue_pending(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
|
wl_display_dispatch_queue_pending(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
|
||||||
@@ -295,23 +294,30 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
|
|||||||
if (dri2_surf->back->dri_image == NULL)
|
if (dri2_surf->back->dri_image == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
dri2_surf->back->locked = 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
back_bo_to_dri_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
|
||||||
|
{
|
||||||
|
struct dri2_egl_display *dri2_dpy =
|
||||||
|
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||||
|
__DRIimage *image;
|
||||||
|
int name, pitch;
|
||||||
|
|
||||||
image = dri2_surf->back->dri_image;
|
image = dri2_surf->back->dri_image;
|
||||||
|
|
||||||
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_NAME, &name);
|
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_NAME, &name);
|
||||||
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &pitch);
|
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &pitch);
|
||||||
|
|
||||||
dri2_surf->back->name = name;
|
|
||||||
dri2_surf->back->pitch = pitch;
|
|
||||||
|
|
||||||
buffer->attachment = __DRI_BUFFER_BACK_LEFT;
|
buffer->attachment = __DRI_BUFFER_BACK_LEFT;
|
||||||
buffer->name = name;
|
buffer->name = name;
|
||||||
buffer->pitch = pitch;
|
buffer->pitch = pitch;
|
||||||
buffer->cpp = 4;
|
buffer->cpp = 4;
|
||||||
buffer->flags = 0;
|
buffer->flags = 0;
|
||||||
|
|
||||||
dri2_surf->back->locked = 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -337,16 +343,12 @@ get_aux_bo(struct dri2_egl_surface *dri2_surf,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __DRIbuffer *
|
static int
|
||||||
dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
|
update_buffers(struct dri2_egl_surface *dri2_surf)
|
||||||
int *width, int *height,
|
|
||||||
unsigned int *attachments, int count,
|
|
||||||
int *out_count, void *loaderPrivate)
|
|
||||||
{
|
{
|
||||||
struct dri2_egl_surface *dri2_surf = loaderPrivate;
|
|
||||||
struct dri2_egl_display *dri2_dpy =
|
struct dri2_egl_display *dri2_dpy =
|
||||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||||
int i, j;
|
int i;
|
||||||
|
|
||||||
if (dri2_surf->base.Type == EGL_WINDOW_BIT &&
|
if (dri2_surf->base.Type == EGL_WINDOW_BIT &&
|
||||||
(dri2_surf->base.Width != dri2_surf->wl_win->width ||
|
(dri2_surf->base.Width != dri2_surf->wl_win->width ||
|
||||||
@@ -360,22 +362,9 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
|
|||||||
dri2_surf->dy = dri2_surf->wl_win->dy;
|
dri2_surf->dy = dri2_surf->wl_win->dy;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0, j = 0; i < 2 * count; i += 2, j++) {
|
if (get_back_bo(dri2_surf) < 0) {
|
||||||
switch (attachments[i]) {
|
_eglError(EGL_BAD_ALLOC, "failed to allocate color buffer");
|
||||||
case __DRI_BUFFER_BACK_LEFT:
|
return -1;
|
||||||
if (get_back_bo(dri2_surf, &dri2_surf->buffers[j]) < 0) {
|
|
||||||
_eglError(EGL_BAD_ALLOC, "failed to allocate color buffer");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (get_aux_bo(dri2_surf, attachments[i], attachments[i + 1],
|
|
||||||
&dri2_surf->buffers[j]) < 0) {
|
|
||||||
_eglError(EGL_BAD_ALLOC, "failed to allocate aux buffer");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we have an extra unlocked buffer at this point, we had to do triple
|
/* If we have an extra unlocked buffer at this point, we had to do triple
|
||||||
@@ -391,6 +380,36 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __DRIbuffer *
|
||||||
|
dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
|
||||||
|
int *width, int *height,
|
||||||
|
unsigned int *attachments, int count,
|
||||||
|
int *out_count, void *loaderPrivate)
|
||||||
|
{
|
||||||
|
struct dri2_egl_surface *dri2_surf = loaderPrivate;
|
||||||
|
int i, j;
|
||||||
|
|
||||||
|
if (update_buffers(dri2_surf) < 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
for (i = 0, j = 0; i < 2 * count; i += 2, j++) {
|
||||||
|
switch (attachments[i]) {
|
||||||
|
case __DRI_BUFFER_BACK_LEFT:
|
||||||
|
back_bo_to_dri_buffer(dri2_surf, &dri2_surf->buffers[j]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (get_aux_bo(dri2_surf, attachments[i], attachments[i + 1],
|
||||||
|
&dri2_surf->buffers[j]) < 0) {
|
||||||
|
_eglError(EGL_BAD_ALLOC, "failed to allocate aux buffer");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
*out_count = j;
|
*out_count = j;
|
||||||
if (j == 0)
|
if (j == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -434,6 +453,25 @@ dri2_get_buffers(__DRIdrawable * driDrawable,
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
image_get_buffers(__DRIdrawable *driDrawable,
|
||||||
|
unsigned int format,
|
||||||
|
uint32_t *stamp,
|
||||||
|
void *loaderPrivate,
|
||||||
|
uint32_t buffer_mask,
|
||||||
|
struct __DRIimageList *buffers)
|
||||||
|
{
|
||||||
|
struct dri2_egl_surface *dri2_surf = loaderPrivate;
|
||||||
|
|
||||||
|
if (update_buffers(dri2_surf) < 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
buffers->image_mask = __DRI_IMAGE_BUFFER_BACK;
|
||||||
|
buffers->back = dri2_surf->back->dri_image;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
|
dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
|
||||||
{
|
{
|
||||||
@@ -441,6 +479,12 @@ dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
|
|||||||
(void) loaderPrivate;
|
(void) loaderPrivate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const __DRIimageLoaderExtension image_loader_extension = {
|
||||||
|
{ __DRI_IMAGE_LOADER, 1 },
|
||||||
|
image_get_buffers,
|
||||||
|
dri2_flush_front_buffer
|
||||||
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wayland_frame_callback(void *data, struct wl_callback *callback, uint32_t time)
|
wayland_frame_callback(void *data, struct wl_callback *callback, uint32_t time)
|
||||||
{
|
{
|
||||||
@@ -459,7 +503,7 @@ create_wl_buffer(struct dri2_egl_surface *dri2_surf)
|
|||||||
{
|
{
|
||||||
struct dri2_egl_display *dri2_dpy =
|
struct dri2_egl_display *dri2_dpy =
|
||||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||||
int fd;
|
int fd, stride, name;
|
||||||
|
|
||||||
if (dri2_surf->current->wl_buffer != NULL)
|
if (dri2_surf->current->wl_buffer != NULL)
|
||||||
return;
|
return;
|
||||||
@@ -467,6 +511,8 @@ create_wl_buffer(struct dri2_egl_surface *dri2_surf)
|
|||||||
if (dri2_dpy->capabilities & WL_DRM_CAPABILITY_PRIME) {
|
if (dri2_dpy->capabilities & WL_DRM_CAPABILITY_PRIME) {
|
||||||
dri2_dpy->image->queryImage(dri2_surf->current->dri_image,
|
dri2_dpy->image->queryImage(dri2_surf->current->dri_image,
|
||||||
__DRI_IMAGE_ATTRIB_FD, &fd);
|
__DRI_IMAGE_ATTRIB_FD, &fd);
|
||||||
|
dri2_dpy->image->queryImage(dri2_surf->current->dri_image,
|
||||||
|
__DRI_IMAGE_ATTRIB_STRIDE, &stride);
|
||||||
|
|
||||||
dri2_surf->current->wl_buffer =
|
dri2_surf->current->wl_buffer =
|
||||||
wl_drm_create_prime_buffer(dri2_dpy->wl_drm,
|
wl_drm_create_prime_buffer(dri2_dpy->wl_drm,
|
||||||
@@ -474,17 +520,22 @@ create_wl_buffer(struct dri2_egl_surface *dri2_surf)
|
|||||||
dri2_surf->base.Width,
|
dri2_surf->base.Width,
|
||||||
dri2_surf->base.Height,
|
dri2_surf->base.Height,
|
||||||
dri2_surf->format,
|
dri2_surf->format,
|
||||||
0, dri2_surf->current->pitch,
|
0, stride,
|
||||||
0, 0,
|
0, 0,
|
||||||
0, 0);
|
0, 0);
|
||||||
close(fd);
|
close(fd);
|
||||||
} else {
|
} else {
|
||||||
|
dri2_dpy->image->queryImage(dri2_surf->current->dri_image,
|
||||||
|
__DRI_IMAGE_ATTRIB_NAME, &name);
|
||||||
|
dri2_dpy->image->queryImage(dri2_surf->current->dri_image,
|
||||||
|
__DRI_IMAGE_ATTRIB_STRIDE, &stride);
|
||||||
|
|
||||||
dri2_surf->current->wl_buffer =
|
dri2_surf->current->wl_buffer =
|
||||||
wl_drm_create_buffer(dri2_dpy->wl_drm,
|
wl_drm_create_buffer(dri2_dpy->wl_drm,
|
||||||
dri2_surf->current->name,
|
name,
|
||||||
dri2_surf->base.Width,
|
dri2_surf->base.Width,
|
||||||
dri2_surf->base.Height,
|
dri2_surf->base.Height,
|
||||||
dri2_surf->current->pitch,
|
stride,
|
||||||
dri2_surf->format);
|
dri2_surf->format);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -506,7 +557,8 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
|
|||||||
{
|
{
|
||||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||||
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
|
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
|
||||||
__DRIbuffer buffer;
|
struct dri2_egl_context *dri2_ctx;
|
||||||
|
_EGLContext *ctx;
|
||||||
int i, ret = 0;
|
int i, ret = 0;
|
||||||
|
|
||||||
while (dri2_surf->frame_callback && ret != -1)
|
while (dri2_surf->frame_callback && ret != -1)
|
||||||
@@ -526,7 +578,7 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
|
|||||||
|
|
||||||
/* Make sure we have a back buffer in case we're swapping without ever
|
/* Make sure we have a back buffer in case we're swapping without ever
|
||||||
* rendering. */
|
* rendering. */
|
||||||
if (get_back_bo(dri2_surf, &buffer) < 0) {
|
if (get_back_bo(dri2_surf) < 0) {
|
||||||
_eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
|
_eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
|
||||||
return EGL_FALSE;
|
return EGL_FALSE;
|
||||||
}
|
}
|
||||||
@@ -548,8 +600,8 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
|
|||||||
dri2_surf->dy = 0;
|
dri2_surf->dy = 0;
|
||||||
|
|
||||||
if (n_rects == 0) {
|
if (n_rects == 0) {
|
||||||
wl_surface_damage(dri2_surf->wl_win->surface, 0, 0,
|
wl_surface_damage(dri2_surf->wl_win->surface,
|
||||||
dri2_surf->base.Width, dri2_surf->base.Height);
|
0, 0, INT32_MAX, INT32_MAX);
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < n_rects; i++) {
|
for (i = 0; i < n_rects; i++) {
|
||||||
const int *rect = &rects[i * 4];
|
const int *rect = &rects[i * 4];
|
||||||
@@ -560,11 +612,22 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wl_surface_commit(dri2_surf->wl_win->surface);
|
if (dri2_dpy->flush->base.version >= 4) {
|
||||||
|
ctx = _eglGetCurrentContext();
|
||||||
|
dri2_ctx = dri2_egl_context(ctx);
|
||||||
|
(*dri2_dpy->flush->flush_with_flags)(dri2_ctx->dri_context,
|
||||||
|
dri2_surf->dri_drawable,
|
||||||
|
__DRI2_FLUSH_DRAWABLE,
|
||||||
|
__DRI2_THROTTLE_SWAPBUFFER);
|
||||||
|
} else {
|
||||||
|
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
|
||||||
|
}
|
||||||
|
|
||||||
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
|
|
||||||
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
|
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
|
||||||
|
|
||||||
|
wl_surface_commit(dri2_surf->wl_win->surface);
|
||||||
|
wl_display_flush(dri2_dpy->wl_dpy);
|
||||||
|
|
||||||
return EGL_TRUE;
|
return EGL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -573,9 +636,8 @@ dri2_query_buffer_age(_EGLDriver *drv,
|
|||||||
_EGLDisplay *disp, _EGLSurface *surface)
|
_EGLDisplay *disp, _EGLSurface *surface)
|
||||||
{
|
{
|
||||||
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
|
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
|
||||||
__DRIbuffer buffer;
|
|
||||||
|
|
||||||
if (get_back_bo(dri2_surf, &buffer) < 0) {
|
if (get_back_bo(dri2_surf) < 0) {
|
||||||
_eglError(EGL_BAD_ALLOC, "dri2_query_buffer_age");
|
_eglError(EGL_BAD_ALLOC, "dri2_query_buffer_age");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -799,11 +861,12 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
|
|||||||
dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
|
dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
|
||||||
dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
|
dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
|
||||||
dri2_get_buffers_with_format;
|
dri2_get_buffers_with_format;
|
||||||
|
|
||||||
dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
|
dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
|
||||||
dri2_dpy->extensions[1] = &image_lookup_extension.base;
|
dri2_dpy->extensions[1] = &image_loader_extension.base;
|
||||||
dri2_dpy->extensions[2] = &use_invalidate.base;
|
dri2_dpy->extensions[2] = &image_lookup_extension.base;
|
||||||
dri2_dpy->extensions[3] = NULL;
|
dri2_dpy->extensions[3] = &use_invalidate.base;
|
||||||
|
dri2_dpy->extensions[4] = NULL;
|
||||||
|
|
||||||
if (!dri2_create_screen(disp))
|
if (!dri2_create_screen(disp))
|
||||||
goto cleanup_driver;
|
goto cleanup_driver;
|
||||||
|
@@ -72,8 +72,8 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle,
|
|||||||
|
|
||||||
const unsigned gs_out_prim = (gs ? gs->output_primitive :
|
const unsigned gs_out_prim = (gs ? gs->output_primitive :
|
||||||
u_assembled_prim(prim));
|
u_assembled_prim(prim));
|
||||||
unsigned nr = MAX2( vs->info.num_inputs,
|
unsigned nr_vs_outputs = draw_total_vs_outputs(draw);
|
||||||
draw_total_vs_outputs(draw) );
|
unsigned nr = MAX2(vs->info.num_inputs, nr_vs_outputs);
|
||||||
|
|
||||||
if (gs) {
|
if (gs) {
|
||||||
nr = MAX2(nr, gs->info.num_outputs + 1);
|
nr = MAX2(nr, gs->info.num_outputs + 1);
|
||||||
@@ -129,6 +129,9 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle,
|
|||||||
/* No need to prepare the shader.
|
/* No need to prepare the shader.
|
||||||
*/
|
*/
|
||||||
vs->prepare(vs, draw);
|
vs->prepare(vs, draw);
|
||||||
|
|
||||||
|
/* Make sure that the vertex size didn't change at any point above */
|
||||||
|
assert(nr_vs_outputs == draw_total_vs_outputs(draw));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -141,19 +141,11 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
|
|||||||
struct draw_geometry_shader *gs = draw->gs.geometry_shader;
|
struct draw_geometry_shader *gs = draw->gs.geometry_shader;
|
||||||
const unsigned out_prim = gs ? gs->output_primitive :
|
const unsigned out_prim = gs ? gs->output_primitive :
|
||||||
u_assembled_prim(in_prim);
|
u_assembled_prim(in_prim);
|
||||||
const unsigned nr = MAX2(vs->info.num_inputs,
|
unsigned nr;
|
||||||
draw_total_vs_outputs(draw));
|
|
||||||
|
|
||||||
fpme->input_prim = in_prim;
|
fpme->input_prim = in_prim;
|
||||||
fpme->opt = opt;
|
fpme->opt = opt;
|
||||||
|
|
||||||
/* Always leave room for the vertex header whether we need it or
|
|
||||||
* not. It's hard to get rid of it in particular because of the
|
|
||||||
* viewport code in draw_pt_post_vs.c.
|
|
||||||
*/
|
|
||||||
fpme->vertex_size = sizeof(struct vertex_header) + nr * 4 * sizeof(float);
|
|
||||||
|
|
||||||
|
|
||||||
draw_pt_post_vs_prepare( fpme->post_vs,
|
draw_pt_post_vs_prepare( fpme->post_vs,
|
||||||
draw->clip_xy,
|
draw->clip_xy,
|
||||||
draw->clip_z,
|
draw->clip_z,
|
||||||
@@ -177,6 +169,30 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
|
|||||||
*max_vertices = 4096;
|
*max_vertices = 4096;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get the number of float[4] attributes per vertex.
|
||||||
|
* Note: this must be done after draw_pt_emit_prepare() since that
|
||||||
|
* can effect the vertex size.
|
||||||
|
*/
|
||||||
|
nr = MAX2(vs->info.num_inputs, draw_total_vs_outputs(draw));
|
||||||
|
|
||||||
|
/* Always leave room for the vertex header whether we need it or
|
||||||
|
* not. It's hard to get rid of it in particular because of the
|
||||||
|
* viewport code in draw_pt_post_vs.c.
|
||||||
|
*/
|
||||||
|
fpme->vertex_size = sizeof(struct vertex_header) + nr * 4 * sizeof(float);
|
||||||
|
|
||||||
|
/* Get the number of float[4] attributes per vertex.
|
||||||
|
* Note: this must be done after draw_pt_emit_prepare() since that
|
||||||
|
* can effect the vertex size.
|
||||||
|
*/
|
||||||
|
nr = MAX2(vs->info.num_inputs, draw_total_vs_outputs(draw));
|
||||||
|
|
||||||
|
/* Always leave room for the vertex header whether we need it or
|
||||||
|
* not. It's hard to get rid of it in particular because of the
|
||||||
|
* viewport code in draw_pt_post_vs.c.
|
||||||
|
*/
|
||||||
|
fpme->vertex_size = sizeof(struct vertex_header) + nr * 4 * sizeof(float);
|
||||||
|
|
||||||
/* return even number */
|
/* return even number */
|
||||||
*max_vertices = *max_vertices & ~1;
|
*max_vertices = *max_vertices & ~1;
|
||||||
|
|
||||||
|
@@ -41,7 +41,7 @@
|
|||||||
#include "util/u_debug.h" /* for assert */
|
#include "util/u_debug.h" /* for assert */
|
||||||
|
|
||||||
|
|
||||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
|
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_HURD)
|
||||||
|
|
||||||
#include <pthread.h> /* POSIX threads headers */
|
#include <pthread.h> /* POSIX threads headers */
|
||||||
#include <stdio.h> /* for perror() */
|
#include <stdio.h> /* for perror() */
|
||||||
@@ -316,7 +316,7 @@ typedef int64_t pipe_condvar;
|
|||||||
* pipe_barrier
|
* pipe_barrier
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if (defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)) && !defined(PIPE_OS_ANDROID)
|
#if (defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HURD)) && !defined(PIPE_OS_ANDROID)
|
||||||
|
|
||||||
typedef pthread_barrier_t pipe_barrier;
|
typedef pthread_barrier_t pipe_barrier;
|
||||||
|
|
||||||
@@ -444,7 +444,7 @@ pipe_semaphore_wait(pipe_semaphore *sema)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
|
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_HURD)
|
||||||
pthread_key_t key;
|
pthread_key_t key;
|
||||||
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
||||||
DWORD key;
|
DWORD key;
|
||||||
@@ -459,7 +459,7 @@ typedef struct {
|
|||||||
static INLINE void
|
static INLINE void
|
||||||
pipe_tsd_init(pipe_tsd *tsd)
|
pipe_tsd_init(pipe_tsd *tsd)
|
||||||
{
|
{
|
||||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
|
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_HURD)
|
||||||
if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
|
if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
|
||||||
perror("pthread_key_create(): failed to allocate key for thread specific data");
|
perror("pthread_key_create(): failed to allocate key for thread specific data");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
@@ -476,7 +476,7 @@ pipe_tsd_get(pipe_tsd *tsd)
|
|||||||
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
|
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
|
||||||
pipe_tsd_init(tsd);
|
pipe_tsd_init(tsd);
|
||||||
}
|
}
|
||||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
|
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_HURD)
|
||||||
return pthread_getspecific(tsd->key);
|
return pthread_getspecific(tsd->key);
|
||||||
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
||||||
assert(0);
|
assert(0);
|
||||||
@@ -493,7 +493,7 @@ pipe_tsd_set(pipe_tsd *tsd, void *value)
|
|||||||
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
|
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
|
||||||
pipe_tsd_init(tsd);
|
pipe_tsd_init(tsd);
|
||||||
}
|
}
|
||||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
|
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_HURD)
|
||||||
if (pthread_setspecific(tsd->key, value) != 0) {
|
if (pthread_setspecific(tsd->key, value) != 0) {
|
||||||
perror("pthread_set_specific() failed");
|
perror("pthread_set_specific() failed");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
@@ -88,6 +88,9 @@ find_drm_pci_id(struct pipe_loader_drm_device *ddev)
|
|||||||
&ddev->base.u.pci.chip_id) != 2)
|
&ddev->base.u.pci.chip_id) != 2)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
udev_device_unref(device);
|
||||||
|
udev_unref(udev);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
@@ -95,8 +95,11 @@ pipe_loader_sw_create_screen(struct pipe_loader_device *dev,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
init = (void *)util_dl_get_proc_address(sdev->lib, "swrast_create_screen");
|
init = (void *)util_dl_get_proc_address(sdev->lib, "swrast_create_screen");
|
||||||
if (!init)
|
if (!init){
|
||||||
|
util_dl_close(sdev->lib);
|
||||||
|
sdev->lib = NULL;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return init(sdev->ws);
|
return init(sdev->ws);
|
||||||
}
|
}
|
||||||
|
@@ -69,7 +69,7 @@ static struct mem_block *exec_heap = NULL;
|
|||||||
static unsigned char *exec_mem = NULL;
|
static unsigned char *exec_mem = NULL;
|
||||||
|
|
||||||
|
|
||||||
static void
|
static int
|
||||||
init_heap(void)
|
init_heap(void)
|
||||||
{
|
{
|
||||||
if (!exec_heap)
|
if (!exec_heap)
|
||||||
@@ -79,6 +79,8 @@ init_heap(void)
|
|||||||
exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE,
|
exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE,
|
||||||
PROT_EXEC | PROT_READ | PROT_WRITE,
|
PROT_EXEC | PROT_READ | PROT_WRITE,
|
||||||
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||||
|
|
||||||
|
return (exec_mem != MAP_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -90,7 +92,8 @@ rtasm_exec_malloc(size_t size)
|
|||||||
|
|
||||||
pipe_mutex_lock(exec_mutex);
|
pipe_mutex_lock(exec_mutex);
|
||||||
|
|
||||||
init_heap();
|
if (!init_heap())
|
||||||
|
goto bail;
|
||||||
|
|
||||||
if (exec_heap) {
|
if (exec_heap) {
|
||||||
size = (size + 31) & ~31; /* next multiple of 32 bytes */
|
size = (size + 31) & ~31; /* next multiple of 32 bytes */
|
||||||
@@ -101,7 +104,8 @@ rtasm_exec_malloc(size_t size)
|
|||||||
addr = exec_mem + block->ofs;
|
addr = exec_mem + block->ofs;
|
||||||
else
|
else
|
||||||
debug_printf("rtasm_exec_malloc failed\n");
|
debug_printf("rtasm_exec_malloc failed\n");
|
||||||
|
|
||||||
|
bail:
|
||||||
pipe_mutex_unlock(exec_mutex);
|
pipe_mutex_unlock(exec_mutex);
|
||||||
|
|
||||||
return addr;
|
return addr;
|
||||||
|
@@ -872,6 +872,9 @@ util_format_get_component_bits(enum pipe_format format,
|
|||||||
static INLINE enum pipe_format
|
static INLINE enum pipe_format
|
||||||
util_format_srgb(enum pipe_format format)
|
util_format_srgb(enum pipe_format format)
|
||||||
{
|
{
|
||||||
|
if (util_format_is_srgb(format))
|
||||||
|
return format;
|
||||||
|
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case PIPE_FORMAT_L8_UNORM:
|
case PIPE_FORMAT_L8_UNORM:
|
||||||
return PIPE_FORMAT_L8_SRGB;
|
return PIPE_FORMAT_L8_SRGB;
|
||||||
|
@@ -136,6 +136,12 @@ llvmpipe_set_sampler_views(struct pipe_context *pipe,
|
|||||||
|
|
||||||
/* set the new sampler views */
|
/* set the new sampler views */
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
|
/* Note: we're using pipe_sampler_view_release() here to work around
|
||||||
|
* a possible crash when the old view belongs to another context that
|
||||||
|
* was already destroyed.
|
||||||
|
*/
|
||||||
|
pipe_sampler_view_release(pipe,
|
||||||
|
&llvmpipe->sampler_views[shader][start + i]);
|
||||||
pipe_sampler_view_reference(&llvmpipe->sampler_views[shader][start + i],
|
pipe_sampler_view_reference(&llvmpipe->sampler_views[shader][start + i],
|
||||||
views[i]);
|
views[i]);
|
||||||
}
|
}
|
||||||
|
@@ -205,6 +205,9 @@ nouveau_transfer_write(struct nouveau_context *nv, struct nouveau_transfer *tx,
|
|||||||
base, size / 4, (const uint32_t *)data);
|
base, size / 4, (const uint32_t *)data);
|
||||||
else
|
else
|
||||||
nv->push_data(nv, buf->bo, buf->offset + base, buf->domain, size, data);
|
nv->push_data(nv, buf->bo, buf->offset + base, buf->domain, size, data);
|
||||||
|
|
||||||
|
nouveau_fence_ref(nv->screen->fence.current, &buf->fence);
|
||||||
|
nouveau_fence_ref(nv->screen->fence.current, &buf->fence_wr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -189,16 +189,15 @@ nouveau_fence_wait(struct nouveau_fence *fence)
|
|||||||
/* wtf, someone is waiting on a fence in flush_notify handler? */
|
/* wtf, someone is waiting on a fence in flush_notify handler? */
|
||||||
assert(fence->state != NOUVEAU_FENCE_STATE_EMITTING);
|
assert(fence->state != NOUVEAU_FENCE_STATE_EMITTING);
|
||||||
|
|
||||||
if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) {
|
if (fence->state < NOUVEAU_FENCE_STATE_EMITTED)
|
||||||
nouveau_fence_emit(fence);
|
nouveau_fence_emit(fence);
|
||||||
|
|
||||||
if (fence == screen->fence.current)
|
if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED)
|
||||||
nouveau_fence_new(screen, &screen->fence.current, FALSE);
|
|
||||||
}
|
|
||||||
if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED) {
|
|
||||||
if (nouveau_pushbuf_kick(screen->pushbuf, screen->pushbuf->channel))
|
if (nouveau_pushbuf_kick(screen->pushbuf, screen->pushbuf->channel))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
|
||||||
|
if (fence == screen->fence.current)
|
||||||
|
nouveau_fence_next(screen);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
nouveau_fence_update(screen, FALSE);
|
nouveau_fence_update(screen, FALSE);
|
||||||
|
@@ -519,7 +519,7 @@ nouveau_create_decoder(struct pipe_context *context,
|
|||||||
goto vl;
|
goto vl;
|
||||||
if (screen->device->chipset >= 0x98 && screen->device->chipset != 0xa0)
|
if (screen->device->chipset >= 0x98 && screen->device->chipset != 0xa0)
|
||||||
goto vl;
|
goto vl;
|
||||||
if (screen->device->chipset < 0x31 || screen->device->chipset == 0x35)
|
if (screen->device->chipset < 0x40)
|
||||||
goto vl;
|
goto vl;
|
||||||
|
|
||||||
dec = CALLOC_STRUCT(nouveau_decoder);
|
dec = CALLOC_STRUCT(nouveau_decoder);
|
||||||
@@ -611,7 +611,6 @@ nouveau_create_decoder(struct pipe_context *context,
|
|||||||
BEGIN_NV04(push, NV31_MPEG(FORMAT), 2);
|
BEGIN_NV04(push, NV31_MPEG(FORMAT), 2);
|
||||||
PUSH_DATA (push, 0);
|
PUSH_DATA (push, 0);
|
||||||
switch (templ->entrypoint) {
|
switch (templ->entrypoint) {
|
||||||
case PIPE_VIDEO_ENTRYPOINT_BITSTREAM: PUSH_DATA (push, 0x100); break;
|
|
||||||
case PIPE_VIDEO_ENTRYPOINT_IDCT: PUSH_DATA (push, 1); break;
|
case PIPE_VIDEO_ENTRYPOINT_IDCT: PUSH_DATA (push, 1); break;
|
||||||
case PIPE_VIDEO_ENTRYPOINT_MC: PUSH_DATA (push, 0); break;
|
case PIPE_VIDEO_ENTRYPOINT_MC: PUSH_DATA (push, 0); break;
|
||||||
default: assert(0);
|
default: assert(0);
|
||||||
@@ -782,7 +781,7 @@ nouveau_video_buffer_create(struct pipe_context *pipe,
|
|||||||
*/
|
*/
|
||||||
if (templat->buffer_format != PIPE_FORMAT_NV12 || getenv("XVMC_VL") ||
|
if (templat->buffer_format != PIPE_FORMAT_NV12 || getenv("XVMC_VL") ||
|
||||||
(screen->device->chipset >= 0x98 && screen->device->chipset != 0xa0) ||
|
(screen->device->chipset >= 0x98 && screen->device->chipset != 0xa0) ||
|
||||||
screen->device->chipset < 0x31 || screen->device->chipset == 0x35)
|
screen->device->chipset < 0x40)
|
||||||
return vl_video_buffer_create(pipe, templat);
|
return vl_video_buffer_create(pipe, templat);
|
||||||
|
|
||||||
assert(templat->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420);
|
assert(templat->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420);
|
||||||
@@ -839,7 +838,8 @@ nouveau_screen_get_video_param(struct pipe_screen *pscreen,
|
|||||||
{
|
{
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case PIPE_VIDEO_CAP_SUPPORTED:
|
case PIPE_VIDEO_CAP_SUPPORTED:
|
||||||
return vl_profile_supported(pscreen, profile, entrypoint);
|
return entrypoint >= PIPE_VIDEO_ENTRYPOINT_IDCT &&
|
||||||
|
u_reduce_video_profile(profile) == PIPE_VIDEO_FORMAT_MPEG12;
|
||||||
case PIPE_VIDEO_CAP_NPOT_TEXTURES:
|
case PIPE_VIDEO_CAP_NPOT_TEXTURES:
|
||||||
return 1;
|
return 1;
|
||||||
case PIPE_VIDEO_CAP_MAX_WIDTH:
|
case PIPE_VIDEO_CAP_MAX_WIDTH:
|
||||||
|
@@ -362,12 +362,7 @@ nouveau_vp3_screen_get_video_param(struct pipe_screen *pscreen,
|
|||||||
enum pipe_video_format codec = u_reduce_video_profile(profile);
|
enum pipe_video_format codec = u_reduce_video_profile(profile);
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case PIPE_VIDEO_CAP_SUPPORTED:
|
case PIPE_VIDEO_CAP_SUPPORTED:
|
||||||
/* For now, h264 and mpeg4 don't work on pre-nvc0. */
|
/* VP3 does not support MPEG4, VP4+ do. */
|
||||||
if (chipset < 0xc0)
|
|
||||||
return codec == PIPE_VIDEO_FORMAT_MPEG12 ||
|
|
||||||
codec == PIPE_VIDEO_FORMAT_VC1;
|
|
||||||
/* In the general case, this should work, once the pre-nvc0 problems are
|
|
||||||
* resolved. */
|
|
||||||
return profile >= PIPE_VIDEO_PROFILE_MPEG1 && (
|
return profile >= PIPE_VIDEO_PROFILE_MPEG1 && (
|
||||||
!vp3 || codec != PIPE_VIDEO_FORMAT_MPEG4);
|
!vp3 || codec != PIPE_VIDEO_FORMAT_MPEG4);
|
||||||
case PIPE_VIDEO_CAP_NPOT_TEXTURES:
|
case PIPE_VIDEO_CAP_NPOT_TEXTURES:
|
||||||
|
@@ -114,21 +114,21 @@ struct h264_picparm_vp { // 700..a00
|
|||||||
uint32_t stride1, stride2; // 04 08
|
uint32_t stride1, stride2; // 04 08
|
||||||
uint32_t ofs[6]; // 0c..24 in-image offset
|
uint32_t ofs[6]; // 0c..24 in-image offset
|
||||||
|
|
||||||
uint32_t u24; // nfi ac8 ?
|
uint32_t tmp_stride;
|
||||||
uint32_t bucket_size; // 28 bucket size
|
uint32_t bucket_size; // 28 bucket size
|
||||||
uint32_t inter_ring_data_size; // 2c
|
uint32_t inter_ring_data_size; // 2c
|
||||||
|
|
||||||
unsigned f0 : 1; // 0 0x01: into 640 shifted by 3, 540 shifted by 5, half size something?
|
unsigned mb_adaptive_frame_field_flag : 1; // 0
|
||||||
unsigned f1 : 1; // 1 0x02: into vuc ofs 56
|
unsigned direct_8x8_inference_flag : 1; // 1 0x02: into vuc ofs 56
|
||||||
unsigned weighted_pred_flag : 1; // 2 0x04
|
unsigned weighted_pred_flag : 1; // 2 0x04
|
||||||
unsigned f3 : 1; // 3 0x08: into vuc ofs 68
|
unsigned constrained_intra_pred_flag : 1; // 3 0x08: into vuc ofs 68
|
||||||
unsigned is_reference : 1; // 4
|
unsigned is_reference : 1; // 4
|
||||||
unsigned interlace : 1; // 5 field_pic_flag
|
unsigned interlace : 1; // 5 field_pic_flag
|
||||||
unsigned bottom_field_flag : 1; // 6
|
unsigned bottom_field_flag : 1; // 6
|
||||||
unsigned f7 : 1; // 7 0x80: nfi yet
|
unsigned second_field : 1; // 7 0x80: nfi yet
|
||||||
|
|
||||||
signed log2_max_frame_num_minus4 : 4; // 31 0..3
|
signed log2_max_frame_num_minus4 : 4; // 31 0..3
|
||||||
unsigned u31_45 : 2; // 31 4..5
|
unsigned chroma_format_idc : 2; // 31 4..5
|
||||||
unsigned pic_order_cnt_type : 2; // 31 6..7
|
unsigned pic_order_cnt_type : 2; // 31 6..7
|
||||||
signed pic_init_qp_minus26 : 6; // 32 0..5
|
signed pic_init_qp_minus26 : 6; // 32 0..5
|
||||||
signed chroma_qp_index_offset : 5; // 32 6..10
|
signed chroma_qp_index_offset : 5; // 32 6..10
|
||||||
@@ -144,17 +144,15 @@ struct h264_picparm_vp { // 700..a00
|
|||||||
uint32_t field_order_cnt[2]; // 38, 3c
|
uint32_t field_order_cnt[2]; // 38, 3c
|
||||||
|
|
||||||
struct { // 40
|
struct { // 40
|
||||||
// 0x00223102
|
|
||||||
// nfi (needs: top_is_reference, bottom_is_reference, is_long_term, maybe some other state that was saved..
|
|
||||||
unsigned fifo_idx : 7; // 00 0..6
|
unsigned fifo_idx : 7; // 00 0..6
|
||||||
unsigned tmp_idx : 5; // 00 7..11
|
unsigned tmp_idx : 5; // 00 7..11
|
||||||
unsigned unk12 : 1; // 00 12 not seen yet, but set, maybe top_is_reference
|
unsigned top_is_reference : 1; // 00 12
|
||||||
unsigned unk13 : 1; // 00 13 not seen yet, but set, maybe bottom_is_reference?
|
unsigned bottom_is_reference : 1; // 00 13
|
||||||
unsigned unk14 : 1; // 00 14 skipped?
|
unsigned is_long_term : 1; // 00 14
|
||||||
unsigned notseenyet : 1; // 00 15 pad?
|
unsigned notseenyet : 1; // 00 15 pad?
|
||||||
unsigned unk16 : 1; // 00 16
|
unsigned field_pic_flag : 1; // 00 16
|
||||||
unsigned unk17 : 4; // 00 17..20
|
unsigned top_field_marking : 4; // 00 17..20
|
||||||
unsigned unk21 : 4; // 00 21..24
|
unsigned bottom_field_marking : 4; // 00 21..24
|
||||||
unsigned pad : 7; // 00 d25..31
|
unsigned pad : 7; // 00 d25..31
|
||||||
|
|
||||||
uint32_t field_order_cnt[2]; // 04,08
|
uint32_t field_order_cnt[2]; // 04,08
|
||||||
@@ -335,21 +333,21 @@ nouveau_vp3_fill_picparm_h264_vp(struct nouveau_vp3_decoder *dec,
|
|||||||
nouveau_vp3_ycbcr_offsets(dec, &h->ofs[1], &h->ofs[3], &h->ofs[4]);
|
nouveau_vp3_ycbcr_offsets(dec, &h->ofs[1], &h->ofs[3], &h->ofs[4]);
|
||||||
h->ofs[5] = h->ofs[3];
|
h->ofs[5] = h->ofs[3];
|
||||||
h->ofs[0] = h->ofs[2] = 0;
|
h->ofs[0] = h->ofs[2] = 0;
|
||||||
h->u24 = dec->tmp_stride >> 8;
|
h->tmp_stride = dec->tmp_stride >> 8;
|
||||||
assert(h->u24);
|
assert(h->tmp_stride);
|
||||||
nouveau_vp3_inter_sizes(dec, 1, &ring, &h->bucket_size, &h->inter_ring_data_size);
|
nouveau_vp3_inter_sizes(dec, 1, &ring, &h->bucket_size, &h->inter_ring_data_size);
|
||||||
|
|
||||||
h->u220 = 0;
|
h->u220 = 0;
|
||||||
h->f0 = d->pps->sps->mb_adaptive_frame_field_flag;
|
h->mb_adaptive_frame_field_flag = d->pps->sps->mb_adaptive_frame_field_flag;
|
||||||
h->f1 = d->pps->sps->direct_8x8_inference_flag;
|
h->direct_8x8_inference_flag = d->pps->sps->direct_8x8_inference_flag;
|
||||||
h->weighted_pred_flag = d->pps->weighted_pred_flag;
|
h->weighted_pred_flag = d->pps->weighted_pred_flag;
|
||||||
h->f3 = d->pps->constrained_intra_pred_flag;
|
h->constrained_intra_pred_flag = d->pps->constrained_intra_pred_flag;
|
||||||
h->is_reference = d->is_reference;
|
h->is_reference = d->is_reference;
|
||||||
h->interlace = d->field_pic_flag;
|
h->interlace = d->field_pic_flag;
|
||||||
h->bottom_field_flag = d->bottom_field_flag;
|
h->bottom_field_flag = d->bottom_field_flag;
|
||||||
h->f7 = 0; // TODO: figure out when set..
|
h->second_field = 0; // TODO: figure out when set..
|
||||||
h->log2_max_frame_num_minus4 = d->pps->sps->log2_max_frame_num_minus4;
|
h->log2_max_frame_num_minus4 = d->pps->sps->log2_max_frame_num_minus4;
|
||||||
h->u31_45 = 1;
|
h->chroma_format_idc = 1;
|
||||||
|
|
||||||
h->pic_order_cnt_type = d->pps->sps->pic_order_cnt_type;
|
h->pic_order_cnt_type = d->pps->sps->pic_order_cnt_type;
|
||||||
h->pic_init_qp_minus26 = d->pps->pic_init_qp_minus26;
|
h->pic_init_qp_minus26 = d->pps->pic_init_qp_minus26;
|
||||||
@@ -376,18 +374,19 @@ nouveau_vp3_fill_picparm_h264_vp(struct nouveau_vp3_decoder *dec,
|
|||||||
h->refs[j].field_order_cnt[1] = d->field_order_cnt_list[i][1];
|
h->refs[j].field_order_cnt[1] = d->field_order_cnt_list[i][1];
|
||||||
h->refs[j].frame_idx = d->frame_num_list[i];
|
h->refs[j].frame_idx = d->frame_num_list[i];
|
||||||
if (!dec->refs[refs[j]->valid_ref].field_pic_flag) {
|
if (!dec->refs[refs[j]->valid_ref].field_pic_flag) {
|
||||||
h->refs[j].unk12 = d->top_is_reference[i];
|
h->refs[j].top_is_reference = d->top_is_reference[i];
|
||||||
h->refs[j].unk13 = d->bottom_is_reference[i];
|
h->refs[j].bottom_is_reference = d->bottom_is_reference[i];
|
||||||
}
|
}
|
||||||
h->refs[j].unk14 = 0;
|
h->refs[j].is_long_term = d->is_long_term[i];
|
||||||
h->refs[j].notseenyet = 0;
|
h->refs[j].notseenyet = 0;
|
||||||
h->refs[j].unk16 = dec->refs[refs[j]->valid_ref].field_pic_flag;
|
h->refs[j].field_pic_flag = dec->refs[refs[j]->valid_ref].field_pic_flag;
|
||||||
h->refs[j].unk17 = dec->refs[refs[j]->valid_ref].decoded_top &&
|
h->refs[j].top_field_marking =
|
||||||
d->top_is_reference[i];
|
dec->refs[refs[j]->valid_ref].decoded_top && d->top_is_reference[i] ?
|
||||||
h->refs[j].unk21 = dec->refs[refs[j]->valid_ref].decoded_bottom &&
|
1 + d->is_long_term[i] : 0;
|
||||||
d->bottom_is_reference[i];
|
h->refs[j].bottom_field_marking =
|
||||||
|
dec->refs[refs[j]->valid_ref].decoded_bottom && d->bottom_is_reference[i] ?
|
||||||
|
1 + d->is_long_term[i] : 0;
|
||||||
h->refs[j].pad = 0;
|
h->refs[j].pad = 0;
|
||||||
assert(!d->is_long_term[i]);
|
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
for (; i < 16; ++i)
|
for (; i < 16; ++i)
|
||||||
@@ -395,7 +394,7 @@ nouveau_vp3_fill_picparm_h264_vp(struct nouveau_vp3_decoder *dec,
|
|||||||
assert(d->num_ref_frames <= dec->base.max_references);
|
assert(d->num_ref_frames <= dec->base.max_references);
|
||||||
|
|
||||||
for (; i < d->num_ref_frames; ++i)
|
for (; i < d->num_ref_frames; ++i)
|
||||||
h->refs[j].unk16 = d->field_pic_flag;
|
h->refs[j].field_pic_flag = d->field_pic_flag;
|
||||||
*(struct h264_picparm_vp *)map = *h;
|
*(struct h264_picparm_vp *)map = *h;
|
||||||
|
|
||||||
return 0x1113;
|
return 0x1113;
|
||||||
|
@@ -114,6 +114,8 @@ nv50_destroy(struct pipe_context *pipe)
|
|||||||
draw_destroy(nv50->draw);
|
draw_destroy(nv50->draw);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
FREE(nv50->blit);
|
||||||
|
|
||||||
nouveau_context_destroy(&nv50->base);
|
nouveau_context_destroy(&nv50->base);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +165,7 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (res->bind & PIPE_BIND_SAMPLER_VIEW) {
|
if (res->bind & PIPE_BIND_SAMPLER_VIEW) {
|
||||||
for (s = 0; s < 5; ++s) {
|
for (s = 0; s < 3; ++s) {
|
||||||
for (i = 0; i < nv50->num_textures[s]; ++i) {
|
for (i = 0; i < nv50->num_textures[s]; ++i) {
|
||||||
if (nv50->textures[s][i] &&
|
if (nv50->textures[s][i] &&
|
||||||
nv50->textures[s][i]->texture == res) {
|
nv50->textures[s][i]->texture == res) {
|
||||||
@@ -177,7 +179,7 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (res->bind & PIPE_BIND_CONSTANT_BUFFER) {
|
if (res->bind & PIPE_BIND_CONSTANT_BUFFER) {
|
||||||
for (s = 0; s < 5; ++s) {
|
for (s = 0; s < 3; ++s) {
|
||||||
for (i = 0; i < nv50->num_vtxbufs; ++i) {
|
for (i = 0; i < nv50->num_vtxbufs; ++i) {
|
||||||
if (!nv50->constbuf[s][i].user &&
|
if (!nv50->constbuf[s][i].user &&
|
||||||
nv50->constbuf[s][i].u.buf == res) {
|
nv50->constbuf[s][i].u.buf == res) {
|
||||||
|
@@ -224,7 +224,7 @@ nv50_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
|
|||||||
case PIPE_SHADER_CAP_MAX_INPUTS:
|
case PIPE_SHADER_CAP_MAX_INPUTS:
|
||||||
if (shader == PIPE_SHADER_VERTEX)
|
if (shader == PIPE_SHADER_VERTEX)
|
||||||
return 32;
|
return 32;
|
||||||
return 0x300 / 16;
|
return 15;
|
||||||
case PIPE_SHADER_CAP_MAX_CONSTS:
|
case PIPE_SHADER_CAP_MAX_CONSTS:
|
||||||
return 65536 / 16;
|
return 65536 / 16;
|
||||||
case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
|
case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
|
||||||
|
@@ -61,7 +61,7 @@ nv50_validate_fb(struct nv50_context *nv50)
|
|||||||
if (mt->base.status & NOUVEAU_BUFFER_STATUS_GPU_READING)
|
if (mt->base.status & NOUVEAU_BUFFER_STATUS_GPU_READING)
|
||||||
nv50->state.rt_serialize = TRUE;
|
nv50->state.rt_serialize = TRUE;
|
||||||
mt->base.status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING;
|
mt->base.status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING;
|
||||||
mt->base.status &= NOUVEAU_BUFFER_STATUS_GPU_READING;
|
mt->base.status &= ~NOUVEAU_BUFFER_STATUS_GPU_READING;
|
||||||
|
|
||||||
/* only register for writing, otherwise we'd always serialize here */
|
/* only register for writing, otherwise we'd always serialize here */
|
||||||
BCTX_REFN(nv50->bufctx_3d, FB, &mt->base, WR);
|
BCTX_REFN(nv50->bufctx_3d, FB, &mt->base, WR);
|
||||||
@@ -91,7 +91,7 @@ nv50_validate_fb(struct nv50_context *nv50)
|
|||||||
if (mt->base.status & NOUVEAU_BUFFER_STATUS_GPU_READING)
|
if (mt->base.status & NOUVEAU_BUFFER_STATUS_GPU_READING)
|
||||||
nv50->state.rt_serialize = TRUE;
|
nv50->state.rt_serialize = TRUE;
|
||||||
mt->base.status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING;
|
mt->base.status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING;
|
||||||
mt->base.status &= NOUVEAU_BUFFER_STATUS_GPU_READING;
|
mt->base.status &= ~NOUVEAU_BUFFER_STATUS_GPU_READING;
|
||||||
|
|
||||||
BCTX_REFN(nv50->bufctx_3d, FB, &mt->base, WR);
|
BCTX_REFN(nv50->bufctx_3d, FB, &mt->base, WR);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -271,7 +271,7 @@ nv50_validate_tic(struct nv50_context *nv50, int s)
|
|||||||
|
|
||||||
nv50->screen->tic.lock[tic->id / 32] |= 1 << (tic->id % 32);
|
nv50->screen->tic.lock[tic->id / 32] |= 1 << (tic->id % 32);
|
||||||
|
|
||||||
res->status &= NOUVEAU_BUFFER_STATUS_GPU_WRITING;
|
res->status &= ~NOUVEAU_BUFFER_STATUS_GPU_WRITING;
|
||||||
res->status |= NOUVEAU_BUFFER_STATUS_GPU_READING;
|
res->status |= NOUVEAU_BUFFER_STATUS_GPU_READING;
|
||||||
|
|
||||||
BCTX_REFN(nv50->bufctx_3d, TEXTURES, res, RD);
|
BCTX_REFN(nv50->bufctx_3d, TEXTURES, res, RD);
|
||||||
|
@@ -597,6 +597,15 @@ nv50_draw_elements(struct nv50_context *nv50, boolean shorten,
|
|||||||
|
|
||||||
assert(nouveau_resource_mapped_by_gpu(nv50->idxbuf.buffer));
|
assert(nouveau_resource_mapped_by_gpu(nv50->idxbuf.buffer));
|
||||||
|
|
||||||
|
/* This shouldn't have to be here. The going theory is that the buffer
|
||||||
|
* is being filled in by PGRAPH, and it's not done yet by the time it
|
||||||
|
* gets submitted to PFIFO, which in turn starts immediately prefetching
|
||||||
|
* the not-yet-written data. Ideally this wait would only happen on
|
||||||
|
* pushbuf submit, but it's probably not a big performance difference.
|
||||||
|
*/
|
||||||
|
if (buf->fence_wr && !nouveau_fence_signalled(buf->fence_wr))
|
||||||
|
nouveau_fence_wait(buf->fence_wr);
|
||||||
|
|
||||||
while (instance_count--) {
|
while (instance_count--) {
|
||||||
BEGIN_NV04(push, NV50_3D(VERTEX_BEGIN_GL), 1);
|
BEGIN_NV04(push, NV50_3D(VERTEX_BEGIN_GL), 1);
|
||||||
PUSH_DATA (push, prim);
|
PUSH_DATA (push, prim);
|
||||||
|
@@ -64,10 +64,6 @@ nv98_create_decoder(struct pipe_context *context,
|
|||||||
struct nouveau_vp3_decoder *dec;
|
struct nouveau_vp3_decoder *dec;
|
||||||
struct nouveau_pushbuf **push;
|
struct nouveau_pushbuf **push;
|
||||||
struct nv04_fifo nv04_data = {.vram = 0xbeef0201, .gart = 0xbeef0202};
|
struct nv04_fifo nv04_data = {.vram = 0xbeef0201, .gart = 0xbeef0202};
|
||||||
union nouveau_bo_config cfg;
|
|
||||||
|
|
||||||
cfg.nv50.tile_mode = 0x20;
|
|
||||||
cfg.nv50.memtype = 0x70;
|
|
||||||
|
|
||||||
int ret, i;
|
int ret, i;
|
||||||
uint32_t codec = 1, ppp_codec = 3;
|
uint32_t codec = 1, ppp_codec = 3;
|
||||||
@@ -200,7 +196,7 @@ nv98_create_decoder(struct pipe_context *context,
|
|||||||
dec->ref_stride = mb(templ->width)*16 * (mb_half(templ->height)*32 + nouveau_vp3_video_align(templ->height)/2);
|
dec->ref_stride = mb(templ->width)*16 * (mb_half(templ->height)*32 + nouveau_vp3_video_align(templ->height)/2);
|
||||||
ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM, 0,
|
ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM, 0,
|
||||||
dec->ref_stride * (templ->max_references+2) + tmp_size,
|
dec->ref_stride * (templ->max_references+2) + tmp_size,
|
||||||
&cfg, &dec->ref_bo);
|
NULL, &dec->ref_bo);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
@@ -79,14 +79,13 @@ static void test_runner_rc_regalloc(
|
|||||||
|
|
||||||
static void tex_1d_swizzle(struct test_result *result)
|
static void tex_1d_swizzle(struct test_result *result)
|
||||||
{
|
{
|
||||||
struct radeon_compiler c;
|
struct r300_fragment_program_compiler c;
|
||||||
|
|
||||||
init_compiler(&c, RC_FRAGMENT_PROGRAM, 0, 0);
|
memset(&c, 0, sizeof(c));
|
||||||
struct r300_fragment_program_compiler *cc =
|
init_compiler(&c.Base, RC_FRAGMENT_PROGRAM, 0, 0);
|
||||||
(struct r300_fragment_program_compiler*)&c;
|
c.AllocateHwInputs = dummy_allocate_hw_inputs;
|
||||||
cc->AllocateHwInputs = dummy_allocate_hw_inputs;
|
|
||||||
|
|
||||||
test_runner_rc_regalloc(result, &c, "regalloc_tex_1d_swizzle.test");
|
test_runner_rc_regalloc(result, &c.Base, "regalloc_tex_1d_swizzle.test");
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned radeon_compiler_regalloc_run_tests()
|
unsigned radeon_compiler_regalloc_run_tests()
|
||||||
|
@@ -542,6 +542,7 @@ unsigned load_program(
|
|||||||
char **string_store;
|
char **string_store;
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
|
|
||||||
|
memset(line, 0, sizeof(line));
|
||||||
snprintf(path, MAX_PATH_LENGTH, "compiler/tests/%s", filename);
|
snprintf(path, MAX_PATH_LENGTH, "compiler/tests/%s", filename);
|
||||||
file = fopen(path, "r");
|
file = fopen(path, "r");
|
||||||
if (!file) {
|
if (!file) {
|
||||||
@@ -552,7 +553,8 @@ unsigned load_program(
|
|||||||
count = &test->num_input_lines;
|
count = &test->num_input_lines;
|
||||||
|
|
||||||
while (fgets(line, MAX_LINE_LENGTH, file)){
|
while (fgets(line, MAX_LINE_LENGTH, file)){
|
||||||
if (line[MAX_LINE_LENGTH - 2] == '\n') {
|
char last_char = line[MAX_LINE_LENGTH - 1];
|
||||||
|
if (last_char && last_char != '\n') {
|
||||||
fprintf(stderr, "Error line cannot be longer than 100 "
|
fprintf(stderr, "Error line cannot be longer than 100 "
|
||||||
"characters:\n%s\n", line);
|
"characters:\n%s\n", line);
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -204,6 +204,8 @@ void *evergreen_create_compute_state(
|
|||||||
const unsigned char * code;
|
const unsigned char * code;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
|
shader->llvm_ctx = LLVMContextCreate();
|
||||||
|
|
||||||
COMPUTE_DBG(ctx->screen, "*** evergreen_create_compute_state\n");
|
COMPUTE_DBG(ctx->screen, "*** evergreen_create_compute_state\n");
|
||||||
|
|
||||||
header = cso->prog;
|
header = cso->prog;
|
||||||
@@ -216,13 +218,14 @@ void *evergreen_create_compute_state(
|
|||||||
shader->input_size = cso->req_input_mem;
|
shader->input_size = cso->req_input_mem;
|
||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
shader->num_kernels = radeon_llvm_get_num_kernels(code, header->num_bytes);
|
shader->num_kernels = radeon_llvm_get_num_kernels(shader->llvm_ctx, code,
|
||||||
|
header->num_bytes);
|
||||||
shader->kernels = CALLOC(sizeof(struct r600_kernel), shader->num_kernels);
|
shader->kernels = CALLOC(sizeof(struct r600_kernel), shader->num_kernels);
|
||||||
|
|
||||||
for (i = 0; i < shader->num_kernels; i++) {
|
for (i = 0; i < shader->num_kernels; i++) {
|
||||||
struct r600_kernel *kernel = &shader->kernels[i];
|
struct r600_kernel *kernel = &shader->kernels[i];
|
||||||
kernel->llvm_module = radeon_llvm_get_kernel_module(i, code,
|
kernel->llvm_module = radeon_llvm_get_kernel_module(shader->llvm_ctx, i,
|
||||||
header->num_bytes);
|
code, header->num_bytes);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return shader;
|
return shader;
|
||||||
@@ -232,7 +235,18 @@ void evergreen_delete_compute_state(struct pipe_context *ctx, void* state)
|
|||||||
{
|
{
|
||||||
struct r600_pipe_compute *shader = (struct r600_pipe_compute *)state;
|
struct r600_pipe_compute *shader = (struct r600_pipe_compute *)state;
|
||||||
|
|
||||||
free(shader);
|
if (!shader)
|
||||||
|
return;
|
||||||
|
|
||||||
|
FREE(shader->kernels);
|
||||||
|
|
||||||
|
#ifdef HAVE_OPENCL
|
||||||
|
if (shader->llvm_ctx){
|
||||||
|
LLVMContextDispose(shader->llvm_ctx);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
FREE(shader);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void evergreen_bind_compute_state(struct pipe_context *ctx_, void *state)
|
static void evergreen_bind_compute_state(struct pipe_context *ctx_, void *state)
|
||||||
@@ -474,6 +488,17 @@ static void compute_emit_cs(struct r600_context *ctx, const uint *block_layout,
|
|||||||
r600_flush_emit(ctx);
|
r600_flush_emit(ctx);
|
||||||
ctx->b.flags = 0;
|
ctx->b.flags = 0;
|
||||||
|
|
||||||
|
if (ctx->b.chip_class >= CAYMAN) {
|
||||||
|
cs->buf[cs->cdw++] = PKT3(PKT3_EVENT_WRITE, 0, 0);
|
||||||
|
cs->buf[cs->cdw++] = EVENT_TYPE(EVENT_TYPE_CS_PARTIAL_FLUSH) | EVENT_INDEX(4);
|
||||||
|
/* DEALLOC_STATE prevents the GPU from hanging when a
|
||||||
|
* SURFACE_SYNC packet is emitted some time after a DISPATCH_DIRECT
|
||||||
|
* with any of the CB*_DEST_BASE_ENA or DB_DEST_BASE_ENA bits set.
|
||||||
|
*/
|
||||||
|
cs->buf[cs->cdw++] = PKT3C(PKT3_DEALLOC_STATE, 0, 0);
|
||||||
|
cs->buf[cs->cdw++] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
COMPUTE_DBG(ctx->screen, "cdw: %i\n", cs->cdw);
|
COMPUTE_DBG(ctx->screen, "cdw: %i\n", cs->cdw);
|
||||||
for (i = 0; i < cs->cdw; i++) {
|
for (i = 0; i < cs->cdw; i++) {
|
||||||
|
@@ -47,6 +47,10 @@ struct r600_pipe_compute {
|
|||||||
unsigned private_size;
|
unsigned private_size;
|
||||||
unsigned input_size;
|
unsigned input_size;
|
||||||
struct r600_resource *kernel_param;
|
struct r600_resource *kernel_param;
|
||||||
|
|
||||||
|
#ifdef HAVE_OPENCL
|
||||||
|
LLVMContextRef llvm_ctx;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct r600_resource* r600_compute_buffer_alloc_vram(struct r600_screen *screen, unsigned size);
|
struct r600_resource* r600_compute_buffer_alloc_vram(struct r600_screen *screen, unsigned size);
|
||||||
|
@@ -63,6 +63,7 @@
|
|||||||
#define R600_TEXEL_PITCH_ALIGNMENT_MASK 0x7
|
#define R600_TEXEL_PITCH_ALIGNMENT_MASK 0x7
|
||||||
|
|
||||||
#define PKT3_NOP 0x10
|
#define PKT3_NOP 0x10
|
||||||
|
#define PKT3_DEALLOC_STATE 0x14
|
||||||
#define PKT3_DISPATCH_DIRECT 0x15
|
#define PKT3_DISPATCH_DIRECT 0x15
|
||||||
#define PKT3_DISPATCH_INDIRECT 0x16
|
#define PKT3_DISPATCH_INDIRECT 0x16
|
||||||
#define PKT3_INDIRECT_BUFFER_END 0x17
|
#define PKT3_INDIRECT_BUFFER_END 0x17
|
||||||
|
@@ -619,6 +619,36 @@ void r600_copy_buffer(struct pipe_context *ctx, struct pipe_resource *dst, unsig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Global buffers are not really resources, they are are actually offsets
|
||||||
|
* into a single global resource (r600_screen::global_pool). The means
|
||||||
|
* they don't have their own cs_buf handle, so they cannot be passed
|
||||||
|
* to r600_copy_buffer() and must be handled separately.
|
||||||
|
*
|
||||||
|
* XXX: It should be possible to implement this function using
|
||||||
|
* r600_copy_buffer() by passing the memory_pool resource as both src
|
||||||
|
* and dst and updating dstx and src_box to point to the correct offsets.
|
||||||
|
* This would likely perform better than the current implementation.
|
||||||
|
*/
|
||||||
|
static void r600_copy_global_buffer(struct pipe_context *ctx,
|
||||||
|
struct pipe_resource *dst, unsigned
|
||||||
|
dstx, struct pipe_resource *src,
|
||||||
|
const struct pipe_box *src_box)
|
||||||
|
{
|
||||||
|
struct pipe_box dst_box; struct pipe_transfer *src_pxfer,
|
||||||
|
*dst_pxfer;
|
||||||
|
|
||||||
|
u_box_1d(dstx, src_box->width, &dst_box);
|
||||||
|
void *src_ptr = ctx->transfer_map(ctx, src, 0, PIPE_TRANSFER_READ,
|
||||||
|
src_box, &src_pxfer);
|
||||||
|
void *dst_ptr = ctx->transfer_map(ctx, dst, 0, PIPE_TRANSFER_WRITE,
|
||||||
|
&dst_box, &dst_pxfer);
|
||||||
|
memcpy(dst_ptr, src_ptr, src_box->width);
|
||||||
|
|
||||||
|
ctx->transfer_unmap(ctx, src_pxfer);
|
||||||
|
ctx->transfer_unmap(ctx, dst_pxfer);
|
||||||
|
}
|
||||||
|
|
||||||
static void r600_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst,
|
static void r600_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst,
|
||||||
unsigned offset, unsigned size, unsigned value)
|
unsigned offset, unsigned size, unsigned value)
|
||||||
{
|
{
|
||||||
@@ -671,7 +701,12 @@ static void r600_resource_copy_region(struct pipe_context *ctx,
|
|||||||
|
|
||||||
/* Handle buffers first. */
|
/* Handle buffers first. */
|
||||||
if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
|
if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
|
||||||
r600_copy_buffer(ctx, dst, dstx, src, src_box);
|
if ((src->bind & PIPE_BIND_GLOBAL) ||
|
||||||
|
(dst->bind & PIPE_BIND_GLOBAL)) {
|
||||||
|
r600_copy_global_buffer(ctx, dst, dstx, src, src_box);
|
||||||
|
} else {
|
||||||
|
r600_copy_buffer(ctx, dst, dstx, src, src_box);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -712,6 +712,7 @@ unsigned r600_llvm_compile(
|
|||||||
const char * gpu_family = r600_llvm_gpu_string(family);
|
const char * gpu_family = r600_llvm_gpu_string(family);
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
|
memset(&binary, 0, sizeof(struct radeon_llvm_binary));
|
||||||
r = radeon_llvm_compile(mod, &binary, gpu_family, dump);
|
r = radeon_llvm_compile(mod, &binary, gpu_family, dump);
|
||||||
|
|
||||||
assert(binary.code_size % 4 == 0);
|
assert(binary.code_size % 4 == 0);
|
||||||
@@ -744,6 +745,9 @@ unsigned r600_llvm_compile(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FREE(binary.code);
|
||||||
|
FREE(binary.config);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -192,12 +192,7 @@ static void r600_destroy_context(struct pipe_context *context)
|
|||||||
|
|
||||||
r600_release_command_buffer(&rctx->start_cs_cmd);
|
r600_release_command_buffer(&rctx->start_cs_cmd);
|
||||||
|
|
||||||
if (rctx->b.rings.gfx.cs) {
|
FREE(rctx->start_compute_cs_cmd.buf);
|
||||||
rctx->b.ws->cs_destroy(rctx->b.rings.gfx.cs);
|
|
||||||
}
|
|
||||||
if (rctx->b.rings.dma.cs) {
|
|
||||||
rctx->b.ws->cs_destroy(rctx->b.rings.dma.cs);
|
|
||||||
}
|
|
||||||
|
|
||||||
r600_common_context_cleanup(&rctx->b);
|
r600_common_context_cleanup(&rctx->b);
|
||||||
FREE(rctx);
|
FREE(rctx);
|
||||||
|
@@ -614,6 +614,10 @@ public:
|
|||||||
unsigned num_slots;
|
unsigned num_slots;
|
||||||
bool uses_mova_gpr;
|
bool uses_mova_gpr;
|
||||||
|
|
||||||
|
bool stack_workaround_8xx;
|
||||||
|
bool stack_workaround_9xx;
|
||||||
|
|
||||||
|
unsigned wavefront_size;
|
||||||
unsigned stack_entry_size;
|
unsigned stack_entry_size;
|
||||||
|
|
||||||
static unsigned dump_pass;
|
static unsigned dump_pass;
|
||||||
@@ -638,6 +642,23 @@ public:
|
|||||||
bool is_cayman() {return hw_class == HW_CLASS_CAYMAN;}
|
bool is_cayman() {return hw_class == HW_CLASS_CAYMAN;}
|
||||||
bool is_egcm() {return hw_class >= HW_CLASS_EVERGREEN;}
|
bool is_egcm() {return hw_class >= HW_CLASS_EVERGREEN;}
|
||||||
|
|
||||||
|
bool needs_8xx_stack_workaround() {
|
||||||
|
if (!is_evergreen())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
switch (hw_chip) {
|
||||||
|
case HW_CHIP_CYPRESS:
|
||||||
|
case HW_CHIP_JUNIPER:
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool needs_9xx_stack_workaround() {
|
||||||
|
return is_cayman();
|
||||||
|
}
|
||||||
|
|
||||||
sb_hw_class_bits hw_class_bit() {
|
sb_hw_class_bits hw_class_bit() {
|
||||||
switch (hw_class) {
|
switch (hw_class) {
|
||||||
case HW_CLASS_R600:return HB_R6;
|
case HW_CLASS_R600:return HB_R6;
|
||||||
|
@@ -40,8 +40,9 @@ namespace r600_sb {
|
|||||||
|
|
||||||
int bc_finalizer::run() {
|
int bc_finalizer::run() {
|
||||||
|
|
||||||
regions_vec &rv = sh.get_regions();
|
run_on(sh.root);
|
||||||
|
|
||||||
|
regions_vec &rv = sh.get_regions();
|
||||||
for (regions_vec::reverse_iterator I = rv.rbegin(), E = rv.rend(); I != E;
|
for (regions_vec::reverse_iterator I = rv.rbegin(), E = rv.rend(); I != E;
|
||||||
++I) {
|
++I) {
|
||||||
region_node *r = *I;
|
region_node *r = *I;
|
||||||
@@ -58,8 +59,6 @@ int bc_finalizer::run() {
|
|||||||
r->expand();
|
r->expand();
|
||||||
}
|
}
|
||||||
|
|
||||||
run_on(sh.root);
|
|
||||||
|
|
||||||
cf_peephole();
|
cf_peephole();
|
||||||
|
|
||||||
// workaround for some problems on r6xx/7xx
|
// workaround for some problems on r6xx/7xx
|
||||||
@@ -213,18 +212,36 @@ void bc_finalizer::run_on(container_node* c) {
|
|||||||
if (n->is_alu_group()) {
|
if (n->is_alu_group()) {
|
||||||
finalize_alu_group(static_cast<alu_group_node*>(n));
|
finalize_alu_group(static_cast<alu_group_node*>(n));
|
||||||
} else {
|
} else {
|
||||||
if (n->is_fetch_inst()) {
|
if (n->is_alu_clause()) {
|
||||||
|
cf_node *c = static_cast<cf_node*>(n);
|
||||||
|
|
||||||
|
if (c->bc.op == CF_OP_ALU_PUSH_BEFORE && ctx.is_egcm()) {
|
||||||
|
if (ctx.stack_workaround_8xx) {
|
||||||
|
region_node *r = c->get_parent_region();
|
||||||
|
if (r) {
|
||||||
|
unsigned ifs, loops;
|
||||||
|
unsigned elems = get_stack_depth(r, loops, ifs);
|
||||||
|
unsigned dmod1 = elems % ctx.stack_entry_size;
|
||||||
|
unsigned dmod2 = (elems + 1) % ctx.stack_entry_size;
|
||||||
|
|
||||||
|
if (elems && (!dmod1 || !dmod2))
|
||||||
|
c->flags |= NF_ALU_STACK_WORKAROUND;
|
||||||
|
}
|
||||||
|
} else if (ctx.stack_workaround_9xx) {
|
||||||
|
region_node *r = c->get_parent_region();
|
||||||
|
if (r) {
|
||||||
|
unsigned ifs, loops;
|
||||||
|
get_stack_depth(r, loops, ifs);
|
||||||
|
if (loops >= 2)
|
||||||
|
c->flags |= NF_ALU_STACK_WORKAROUND;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (n->is_fetch_inst()) {
|
||||||
finalize_fetch(static_cast<fetch_node*>(n));
|
finalize_fetch(static_cast<fetch_node*>(n));
|
||||||
} else if (n->is_cf_inst()) {
|
} else if (n->is_cf_inst()) {
|
||||||
finalize_cf(static_cast<cf_node*>(n));
|
finalize_cf(static_cast<cf_node*>(n));
|
||||||
} else if (n->is_alu_clause()) {
|
|
||||||
|
|
||||||
} else if (n->is_fetch_clause()) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
assert(!"unexpected node");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n->is_container())
|
if (n->is_container())
|
||||||
run_on(static_cast<container_node*>(n));
|
run_on(static_cast<container_node*>(n));
|
||||||
}
|
}
|
||||||
@@ -578,10 +595,6 @@ void bc_finalizer::finalize_cf(cf_node* c) {
|
|||||||
|
|
||||||
unsigned flags = c->bc.op_ptr->flags;
|
unsigned flags = c->bc.op_ptr->flags;
|
||||||
|
|
||||||
if (flags & CF_CALL) {
|
|
||||||
update_nstack(c->get_parent_region(), ctx.is_cayman() ? 1 : 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
c->bc.end_of_program = 0;
|
c->bc.end_of_program = 0;
|
||||||
last_cf = c;
|
last_cf = c;
|
||||||
|
|
||||||
@@ -715,17 +728,8 @@ void bc_finalizer::finalize_cf(cf_node* c) {
|
|||||||
|
|
||||||
c->bc.index_gpr = reg >= 0 ? reg : 0;
|
c->bc.index_gpr = reg >= 0 ? reg : 0;
|
||||||
}
|
}
|
||||||
|
} else if (flags & CF_CALL) {
|
||||||
|
update_nstack(c->get_parent_region(), ctx.wavefront_size == 16 ? 2 : 1);
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
if ((flags & (CF_BRANCH | CF_LOOP)) && !sh.uses_gradients) {
|
|
||||||
c->bc.valid_pixel_mode = 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -763,37 +767,86 @@ void bc_finalizer::update_ngpr(unsigned gpr) {
|
|||||||
ngpr = gpr + 1;
|
ngpr = gpr + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned bc_finalizer::get_stack_depth(node *n, unsigned &loops,
|
||||||
|
unsigned &ifs, unsigned add) {
|
||||||
|
unsigned stack_elements = add;
|
||||||
|
bool has_non_wqm_push = (add != 0);
|
||||||
|
region_node *r = n->is_region() ?
|
||||||
|
static_cast<region_node*>(n) : n->get_parent_region();
|
||||||
|
|
||||||
|
loops = 0;
|
||||||
|
ifs = 0;
|
||||||
|
|
||||||
|
while (r) {
|
||||||
|
if (r->is_loop()) {
|
||||||
|
++loops;
|
||||||
|
} else {
|
||||||
|
++ifs;
|
||||||
|
has_non_wqm_push = true;
|
||||||
|
}
|
||||||
|
r = r->get_parent_region();
|
||||||
|
}
|
||||||
|
stack_elements += (loops * ctx.stack_entry_size) + ifs;
|
||||||
|
|
||||||
|
// reserve additional elements in some cases
|
||||||
|
switch (ctx.hw_class) {
|
||||||
|
case HW_CLASS_R600:
|
||||||
|
case HW_CLASS_R700:
|
||||||
|
// If any non-WQM push is invoked, 2 elements should be reserved.
|
||||||
|
if (has_non_wqm_push)
|
||||||
|
stack_elements += 2;
|
||||||
|
break;
|
||||||
|
case HW_CLASS_CAYMAN:
|
||||||
|
// If any stack operation is invoked, 2 elements should be reserved
|
||||||
|
if (stack_elements)
|
||||||
|
stack_elements += 2;
|
||||||
|
break;
|
||||||
|
case HW_CLASS_EVERGREEN:
|
||||||
|
// According to the docs we need to reserve 1 element for each of the
|
||||||
|
// following cases:
|
||||||
|
// 1) non-WQM push is used with WQM/LOOP frames on stack
|
||||||
|
// 2) ALU_ELSE_AFTER is used at the point of max stack usage
|
||||||
|
// NOTE:
|
||||||
|
// It was found that the conditions above are not sufficient, there are
|
||||||
|
// other cases where we also need to reserve stack space, that's why
|
||||||
|
// we always reserve 1 stack element if we have non-WQM push on stack.
|
||||||
|
// Condition 2 is ignored for now because we don't use this instruction.
|
||||||
|
if (has_non_wqm_push)
|
||||||
|
++stack_elements;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return stack_elements;
|
||||||
|
}
|
||||||
|
|
||||||
void bc_finalizer::update_nstack(region_node* r, unsigned add) {
|
void bc_finalizer::update_nstack(region_node* r, unsigned add) {
|
||||||
unsigned loops = 0;
|
unsigned loops = 0;
|
||||||
unsigned ifs = 0;
|
unsigned ifs = 0;
|
||||||
|
unsigned elems = r ? get_stack_depth(r, loops, ifs, add) : add;
|
||||||
|
|
||||||
while (r) {
|
// XXX all chips expect this value to be computed using 4 as entry size,
|
||||||
if (r->is_loop())
|
// not the real entry size
|
||||||
++loops;
|
unsigned stack_entries = (elems + 3) >> 2;
|
||||||
else
|
|
||||||
++ifs;
|
|
||||||
|
|
||||||
r = r->get_parent_region();
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned stack_elements = (loops * ctx.stack_entry_size) + ifs + add;
|
|
||||||
|
|
||||||
// FIXME calculate more precisely
|
|
||||||
if (ctx.is_evergreen()) {
|
|
||||||
++stack_elements;
|
|
||||||
} else {
|
|
||||||
stack_elements += 2;
|
|
||||||
if (ctx.is_cayman())
|
|
||||||
++stack_elements;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned stack_entries = (stack_elements + 3) >> 2;
|
|
||||||
|
|
||||||
if (nstack < stack_entries)
|
if (nstack < stack_entries)
|
||||||
nstack = stack_entries;
|
nstack = stack_entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bc_finalizer::cf_peephole() {
|
void bc_finalizer::cf_peephole() {
|
||||||
|
if (ctx.stack_workaround_8xx || ctx.stack_workaround_9xx) {
|
||||||
|
for (node_iterator N, I = sh.root->begin(), E = sh.root->end(); I != E;
|
||||||
|
I = N) {
|
||||||
|
N = I; ++N;
|
||||||
|
cf_node *c = static_cast<cf_node*>(*I);
|
||||||
|
|
||||||
|
if (c->bc.op == CF_OP_ALU_PUSH_BEFORE &&
|
||||||
|
(c->flags & NF_ALU_STACK_WORKAROUND)) {
|
||||||
|
cf_node *push = sh.create_cf(CF_OP_PUSH);
|
||||||
|
c->insert_before(push);
|
||||||
|
push->jump(c);
|
||||||
|
c->bc.set_op(CF_OP_ALU);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (node_iterator N, I = sh.root->begin(), E = sh.root->end(); I != E;
|
for (node_iterator N, I = sh.root->begin(), E = sh.root->end(); I != E;
|
||||||
I = N) {
|
I = N) {
|
||||||
|
@@ -66,20 +66,27 @@ int sb_context::init(r600_isa *isa, sb_hw_chip chip, sb_hw_class cclass) {
|
|||||||
case HW_CHIP_RS780:
|
case HW_CHIP_RS780:
|
||||||
case HW_CHIP_RV620:
|
case HW_CHIP_RV620:
|
||||||
case HW_CHIP_RS880:
|
case HW_CHIP_RS880:
|
||||||
|
wavefront_size = 16;
|
||||||
|
stack_entry_size = 8;
|
||||||
|
break;
|
||||||
case HW_CHIP_RV630:
|
case HW_CHIP_RV630:
|
||||||
case HW_CHIP_RV635:
|
case HW_CHIP_RV635:
|
||||||
case HW_CHIP_RV730:
|
case HW_CHIP_RV730:
|
||||||
case HW_CHIP_RV710:
|
case HW_CHIP_RV710:
|
||||||
case HW_CHIP_PALM:
|
case HW_CHIP_PALM:
|
||||||
case HW_CHIP_CEDAR:
|
case HW_CHIP_CEDAR:
|
||||||
|
wavefront_size = 32;
|
||||||
stack_entry_size = 8;
|
stack_entry_size = 8;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
wavefront_size = 64;
|
||||||
stack_entry_size = 4;
|
stack_entry_size = 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stack_workaround_8xx = needs_8xx_stack_workaround();
|
||||||
|
stack_workaround_9xx = needs_9xx_stack_workaround();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -700,7 +700,10 @@ enum node_flags {
|
|||||||
NF_DONT_MOVE = (1 << 8),
|
NF_DONT_MOVE = (1 << 8),
|
||||||
|
|
||||||
// for KILLxx - we want to schedule them as early as possible
|
// for KILLxx - we want to schedule them as early as possible
|
||||||
NF_SCHEDULE_EARLY = (1 << 9)
|
NF_SCHEDULE_EARLY = (1 << 9),
|
||||||
|
|
||||||
|
// for ALU_PUSH_BEFORE - when set, replace with PUSH + ALU
|
||||||
|
NF_ALU_STACK_WORKAROUND = (1 << 10)
|
||||||
};
|
};
|
||||||
|
|
||||||
inline node_flags operator |(node_flags l, node_flags r) {
|
inline node_flags operator |(node_flags l, node_flags r) {
|
||||||
|
@@ -708,6 +708,9 @@ public:
|
|||||||
void update_ngpr(unsigned gpr);
|
void update_ngpr(unsigned gpr);
|
||||||
void update_nstack(region_node *r, unsigned add = 0);
|
void update_nstack(region_node *r, unsigned add = 0);
|
||||||
|
|
||||||
|
unsigned get_stack_depth(node *n, unsigned &loops, unsigned &ifs,
|
||||||
|
unsigned add = 0);
|
||||||
|
|
||||||
void cf_peephole();
|
void cf_peephole();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -234,6 +234,13 @@ bool r600_common_context_init(struct r600_common_context *rctx,
|
|||||||
|
|
||||||
void r600_common_context_cleanup(struct r600_common_context *rctx)
|
void r600_common_context_cleanup(struct r600_common_context *rctx)
|
||||||
{
|
{
|
||||||
|
if (rctx->rings.gfx.cs) {
|
||||||
|
rctx->ws->cs_destroy(rctx->rings.gfx.cs);
|
||||||
|
}
|
||||||
|
if (rctx->rings.dma.cs) {
|
||||||
|
rctx->ws->cs_destroy(rctx->rings.dma.cs);
|
||||||
|
}
|
||||||
|
|
||||||
if (rctx->allocator_so_filled_size) {
|
if (rctx->allocator_so_filled_size) {
|
||||||
u_suballocator_destroy(rctx->allocator_so_filled_size);
|
u_suballocator_destroy(rctx->allocator_so_filled_size);
|
||||||
}
|
}
|
||||||
|
@@ -173,6 +173,10 @@ unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_llvm_binary *binary,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (elf){
|
||||||
|
elf_end(elf);
|
||||||
|
}
|
||||||
|
FREE(elf_buffer);
|
||||||
LLVMDisposeMemoryBuffer(out_buffer);
|
LLVMDisposeMemoryBuffer(out_buffer);
|
||||||
LLVMDisposeTargetMachine(tm);
|
LLVMDisposeTargetMachine(tm);
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -30,25 +30,26 @@
|
|||||||
#include <llvm-c/BitReader.h>
|
#include <llvm-c/BitReader.h>
|
||||||
#include <llvm-c/Core.h>
|
#include <llvm-c/Core.h>
|
||||||
#include <llvm-c/Target.h>
|
#include <llvm-c/Target.h>
|
||||||
|
#include <llvm-c/Transforms/IPO.h>
|
||||||
#include <llvm-c/Transforms/PassManagerBuilder.h>
|
#include <llvm-c/Transforms/PassManagerBuilder.h>
|
||||||
|
|
||||||
LLVMModuleRef radeon_llvm_parse_bitcode(const unsigned char * bitcode,
|
LLVMModuleRef radeon_llvm_parse_bitcode(LLVMContextRef ctx,
|
||||||
unsigned bitcode_len)
|
const unsigned char * bitcode, unsigned bitcode_len)
|
||||||
{
|
{
|
||||||
LLVMMemoryBufferRef buf;
|
LLVMMemoryBufferRef buf;
|
||||||
LLVMContextRef ctx = LLVMContextCreate();
|
|
||||||
LLVMModuleRef module;
|
LLVMModuleRef module;
|
||||||
|
|
||||||
buf = LLVMCreateMemoryBufferWithMemoryRangeCopy((const char*)bitcode,
|
buf = LLVMCreateMemoryBufferWithMemoryRangeCopy((const char*)bitcode,
|
||||||
bitcode_len, "radeon");
|
bitcode_len, "radeon");
|
||||||
LLVMParseBitcodeInContext(ctx, buf, &module, NULL);
|
LLVMParseBitcodeInContext(ctx, buf, &module, NULL);
|
||||||
|
LLVMDisposeMemoryBuffer(buf);
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned radeon_llvm_get_num_kernels(const unsigned char *bitcode,
|
unsigned radeon_llvm_get_num_kernels(LLVMContextRef ctx,
|
||||||
unsigned bitcode_len)
|
const unsigned char *bitcode, unsigned bitcode_len)
|
||||||
{
|
{
|
||||||
LLVMModuleRef mod = radeon_llvm_parse_bitcode(bitcode, bitcode_len);
|
LLVMModuleRef mod = radeon_llvm_parse_bitcode(ctx, bitcode, bitcode_len);
|
||||||
return LLVMGetNamedMetadataNumOperands(mod, "opencl.kernels");
|
return LLVMGetNamedMetadataNumOperands(mod, "opencl.kernels");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,17 +59,35 @@ static void radeon_llvm_optimize(LLVMModuleRef mod)
|
|||||||
LLVMTargetDataRef TD = LLVMCreateTargetData(data_layout);
|
LLVMTargetDataRef TD = LLVMCreateTargetData(data_layout);
|
||||||
LLVMPassManagerBuilderRef builder = LLVMPassManagerBuilderCreate();
|
LLVMPassManagerBuilderRef builder = LLVMPassManagerBuilderCreate();
|
||||||
LLVMPassManagerRef pass_manager = LLVMCreatePassManager();
|
LLVMPassManagerRef pass_manager = LLVMCreatePassManager();
|
||||||
LLVMAddTargetData(TD, pass_manager);
|
|
||||||
|
|
||||||
LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 1000000000);
|
/* Functions calls are not supported yet, so we need to inline
|
||||||
|
* everything. The most efficient way to do this is to add
|
||||||
|
* the always_inline attribute to all non-kernel functions
|
||||||
|
* and then run the Always Inline pass. The Always Inline
|
||||||
|
* pass will automaically inline functions with this attribute
|
||||||
|
* and does not perform the expensive cost analysis that the normal
|
||||||
|
* inliner does.
|
||||||
|
*/
|
||||||
|
|
||||||
|
LLVMValueRef fn;
|
||||||
|
for (fn = LLVMGetFirstFunction(mod); fn; fn = LLVMGetNextFunction(fn)) {
|
||||||
|
/* All the non-kernel functions have internal linkage */
|
||||||
|
if (LLVMGetLinkage(fn) == LLVMInternalLinkage) {
|
||||||
|
LLVMAddFunctionAttr(fn, LLVMAlwaysInlineAttribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LLVMAddTargetData(TD, pass_manager);
|
||||||
|
LLVMAddAlwaysInlinerPass(pass_manager);
|
||||||
LLVMPassManagerBuilderPopulateModulePassManager(builder, pass_manager);
|
LLVMPassManagerBuilderPopulateModulePassManager(builder, pass_manager);
|
||||||
|
|
||||||
LLVMRunPassManager(pass_manager, mod);
|
LLVMRunPassManager(pass_manager, mod);
|
||||||
LLVMPassManagerBuilderDispose(builder);
|
LLVMPassManagerBuilderDispose(builder);
|
||||||
LLVMDisposePassManager(pass_manager);
|
LLVMDisposePassManager(pass_manager);
|
||||||
|
LLVMDisposeTargetData(TD);
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMModuleRef radeon_llvm_get_kernel_module(unsigned index,
|
LLVMModuleRef radeon_llvm_get_kernel_module(LLVMContextRef ctx, unsigned index,
|
||||||
const unsigned char *bitcode, unsigned bitcode_len)
|
const unsigned char *bitcode, unsigned bitcode_len)
|
||||||
{
|
{
|
||||||
LLVMModuleRef mod;
|
LLVMModuleRef mod;
|
||||||
@@ -76,7 +95,7 @@ LLVMModuleRef radeon_llvm_get_kernel_module(unsigned index,
|
|||||||
LLVMValueRef *kernel_metadata;
|
LLVMValueRef *kernel_metadata;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
mod = radeon_llvm_parse_bitcode(bitcode, bitcode_len);
|
mod = radeon_llvm_parse_bitcode(ctx, bitcode, bitcode_len);
|
||||||
num_kernels = LLVMGetNamedMetadataNumOperands(mod, "opencl.kernels");
|
num_kernels = LLVMGetNamedMetadataNumOperands(mod, "opencl.kernels");
|
||||||
kernel_metadata = MALLOC(num_kernels * sizeof(LLVMValueRef));
|
kernel_metadata = MALLOC(num_kernels * sizeof(LLVMValueRef));
|
||||||
LLVMGetNamedMetadataOperands(mod, "opencl.kernels", kernel_metadata);
|
LLVMGetNamedMetadataOperands(mod, "opencl.kernels", kernel_metadata);
|
||||||
|
@@ -29,10 +29,11 @@
|
|||||||
|
|
||||||
#include <llvm-c/Core.h>
|
#include <llvm-c/Core.h>
|
||||||
|
|
||||||
LLVMModuleRef radeon_llvm_parse_bitcode(const unsigned char * bitcode,
|
LLVMModuleRef radeon_llvm_parse_bitcode(LLVMContextRef ctx,
|
||||||
unsigned bitcode_len);
|
const unsigned char * bitcode, unsigned bitcode_len);
|
||||||
unsigned radeon_llvm_get_num_kernels(const unsigned char *bitcode, unsigned bitcode_len);
|
unsigned radeon_llvm_get_num_kernels(LLVMContextRef ctx,
|
||||||
LLVMModuleRef radeon_llvm_get_kernel_module(unsigned index,
|
const unsigned char *bitcode, unsigned bitcode_len);
|
||||||
|
LLVMModuleRef radeon_llvm_get_kernel_module(LLVMContextRef ctx, unsigned index,
|
||||||
const unsigned char *bitcode, unsigned bitcode_len);
|
const unsigned char *bitcode, unsigned bitcode_len);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1379,7 +1379,7 @@ void radeon_llvm_finalize_module(struct radeon_llvm_context * ctx)
|
|||||||
LLVMAddAggressiveDCEPass(gallivm->passmgr);
|
LLVMAddAggressiveDCEPass(gallivm->passmgr);
|
||||||
LLVMAddCFGSimplificationPass(gallivm->passmgr);
|
LLVMAddCFGSimplificationPass(gallivm->passmgr);
|
||||||
|
|
||||||
/* Run the passs */
|
/* Run the pass */
|
||||||
LLVMRunFunctionPassManager(gallivm->passmgr, ctx->main_fn);
|
LLVMRunFunctionPassManager(gallivm->passmgr, ctx->main_fn);
|
||||||
|
|
||||||
LLVMDisposeBuilder(gallivm->builder);
|
LLVMDisposeBuilder(gallivm->builder);
|
||||||
|
@@ -20,6 +20,7 @@ struct si_pipe_compute {
|
|||||||
|
|
||||||
struct pipe_resource *global_buffers[MAX_GLOBAL_BUFFERS];
|
struct pipe_resource *global_buffers[MAX_GLOBAL_BUFFERS];
|
||||||
|
|
||||||
|
LLVMContextRef llvm_ctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *radeonsi_create_compute_state(
|
static void *radeonsi_create_compute_state(
|
||||||
@@ -33,6 +34,8 @@ static void *radeonsi_create_compute_state(
|
|||||||
const unsigned char *code;
|
const unsigned char *code;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
|
program->llvm_ctx = LLVMContextCreate();
|
||||||
|
|
||||||
header = cso->prog;
|
header = cso->prog;
|
||||||
code = cso->prog + sizeof(struct pipe_llvm_program_header);
|
code = cso->prog + sizeof(struct pipe_llvm_program_header);
|
||||||
|
|
||||||
@@ -41,14 +44,15 @@ static void *radeonsi_create_compute_state(
|
|||||||
program->private_size = cso->req_private_mem;
|
program->private_size = cso->req_private_mem;
|
||||||
program->input_size = cso->req_input_mem;
|
program->input_size = cso->req_input_mem;
|
||||||
|
|
||||||
program->num_kernels = radeon_llvm_get_num_kernels(code,
|
program->num_kernels = radeon_llvm_get_num_kernels(program->llvm_ctx, code,
|
||||||
header->num_bytes);
|
header->num_bytes);
|
||||||
program->kernels = CALLOC(sizeof(struct si_pipe_shader),
|
program->kernels = CALLOC(sizeof(struct si_pipe_shader),
|
||||||
program->num_kernels);
|
program->num_kernels);
|
||||||
for (i = 0; i < program->num_kernels; i++) {
|
for (i = 0; i < program->num_kernels; i++) {
|
||||||
LLVMModuleRef mod = radeon_llvm_get_kernel_module(i, code,
|
LLVMModuleRef mod = radeon_llvm_get_kernel_module(program->llvm_ctx, i,
|
||||||
header->num_bytes);
|
code, header->num_bytes);
|
||||||
si_compile_llvm(rctx, &program->kernels[i], mod);
|
si_compile_llvm(rctx, &program->kernels[i], mod);
|
||||||
|
LLVMDisposeModule(mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
return program;
|
return program;
|
||||||
@@ -102,6 +106,7 @@ static void radeonsi_launch_grid(
|
|||||||
unsigned arg_user_sgpr_count = 2;
|
unsigned arg_user_sgpr_count = 2;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
struct si_pipe_shader *shader = &program->kernels[pc];
|
struct si_pipe_shader *shader = &program->kernels[pc];
|
||||||
|
unsigned lds_blocks;
|
||||||
|
|
||||||
pm4->compute_pkt = true;
|
pm4->compute_pkt = true;
|
||||||
si_cmd_context_control(pm4);
|
si_cmd_context_control(pm4);
|
||||||
@@ -161,9 +166,18 @@ static void radeonsi_launch_grid(
|
|||||||
si_pm4_add_bo(pm4, buffer, RADEON_USAGE_READWRITE);
|
si_pm4_add_bo(pm4, buffer, RADEON_USAGE_READWRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX: This should be:
|
/* This register has been moved to R_00CD20_COMPUTE_MAX_WAVE_ID
|
||||||
* (number of compute units) * 4 * (waves per simd) - 1 */
|
* and is now per pipe, so it should be handled in the
|
||||||
si_pm4_set_reg(pm4, R_00B82C_COMPUTE_MAX_WAVE_ID, 0x190 /* Default value */);
|
* kernel if we want to use something other than the default value,
|
||||||
|
* which is now 0x22f.
|
||||||
|
*/
|
||||||
|
if (rctx->b.chip_class <= SI) {
|
||||||
|
/* XXX: This should be:
|
||||||
|
* (number of compute units) * 4 * (waves per simd) - 1 */
|
||||||
|
|
||||||
|
si_pm4_set_reg(pm4, R_00B82C_COMPUTE_MAX_WAVE_ID,
|
||||||
|
0x190 /* Default value */);
|
||||||
|
}
|
||||||
|
|
||||||
shader_va = r600_resource_va(ctx->screen, (void *)shader->bo);
|
shader_va = r600_resource_va(ctx->screen, (void *)shader->bo);
|
||||||
si_pm4_add_bo(pm4, shader->bo, RADEON_USAGE_READ);
|
si_pm4_add_bo(pm4, shader->bo, RADEON_USAGE_READ);
|
||||||
@@ -184,6 +198,20 @@ static void radeonsi_launch_grid(
|
|||||||
shader->num_sgprs)) - 1) / 8))
|
shader->num_sgprs)) - 1) / 8))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
lds_blocks = shader->lds_size;
|
||||||
|
/* XXX: We are over allocating LDS. For SI, the shader reports LDS in
|
||||||
|
* blocks of 256 bytes, so if there are 4 bytes lds allocated in
|
||||||
|
* the shader and 4 bytes allocated by the state tracker, then
|
||||||
|
* we will set LDS_SIZE to 512 bytes rather than 256.
|
||||||
|
*/
|
||||||
|
if (rctx->b.chip_class <= SI) {
|
||||||
|
lds_blocks += align(program->local_size, 256) >> 8;
|
||||||
|
} else {
|
||||||
|
lds_blocks += align(program->local_size, 512) >> 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(lds_blocks <= 0xFF);
|
||||||
|
|
||||||
si_pm4_set_reg(pm4, R_00B84C_COMPUTE_PGM_RSRC2,
|
si_pm4_set_reg(pm4, R_00B84C_COMPUTE_PGM_RSRC2,
|
||||||
S_00B84C_SCRATCH_EN(0)
|
S_00B84C_SCRATCH_EN(0)
|
||||||
| S_00B84C_USER_SGPR(arg_user_sgpr_count)
|
| S_00B84C_USER_SGPR(arg_user_sgpr_count)
|
||||||
@@ -192,7 +220,7 @@ static void radeonsi_launch_grid(
|
|||||||
| S_00B84C_TGID_Z_EN(1)
|
| S_00B84C_TGID_Z_EN(1)
|
||||||
| S_00B84C_TG_SIZE_EN(1)
|
| S_00B84C_TG_SIZE_EN(1)
|
||||||
| S_00B84C_TIDIG_COMP_CNT(2)
|
| S_00B84C_TIDIG_COMP_CNT(2)
|
||||||
| S_00B84C_LDS_SIZE(shader->lds_size)
|
| S_00B84C_LDS_SIZE(lds_blocks)
|
||||||
| S_00B84C_EXCP_EN(0))
|
| S_00B84C_EXCP_EN(0))
|
||||||
;
|
;
|
||||||
si_pm4_set_reg(pm4, R_00B854_COMPUTE_RESOURCE_LIMITS, 0);
|
si_pm4_set_reg(pm4, R_00B854_COMPUTE_RESOURCE_LIMITS, 0);
|
||||||
@@ -236,7 +264,25 @@ static void radeonsi_launch_grid(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void si_delete_compute_state(struct pipe_context *ctx, void* state){}
|
static void si_delete_compute_state(struct pipe_context *ctx, void* state){
|
||||||
|
struct si_pipe_compute *program = (struct si_pipe_compute *)state;
|
||||||
|
|
||||||
|
if (!state) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (program->kernels) {
|
||||||
|
FREE(program->kernels);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (program->llvm_ctx){
|
||||||
|
LLVMContextDispose(program->llvm_ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
//And then free the program itself.
|
||||||
|
FREE(program);
|
||||||
|
}
|
||||||
|
|
||||||
static void si_set_compute_resources(struct pipe_context * ctx_,
|
static void si_set_compute_resources(struct pipe_context * ctx_,
|
||||||
unsigned start, unsigned count,
|
unsigned start, unsigned count,
|
||||||
struct pipe_surface ** surfaces) { }
|
struct pipe_surface ** surfaces) { }
|
||||||
|
@@ -860,8 +860,8 @@ clamp_colors(float (*quadColor)[4])
|
|||||||
{
|
{
|
||||||
unsigned i, j;
|
unsigned i, j;
|
||||||
|
|
||||||
for (j = 0; j < TGSI_QUAD_SIZE; j++) {
|
for (i = 0; i < 4; i++) {
|
||||||
for (i = 0; i < 4; i++) {
|
for (j = 0; j < TGSI_QUAD_SIZE; j++) {
|
||||||
quadColor[i][j] = CLAMP(quadColor[i][j], 0.0F, 1.0F);
|
quadColor[i][j] = CLAMP(quadColor[i][j], 0.0F, 1.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
**********************************************************/
|
**********************************************************/
|
||||||
|
|
||||||
#include "util/u_inlines.h"
|
#include "util/u_inlines.h"
|
||||||
|
#include "util/u_prim.h"
|
||||||
#include "indices/u_indices.h"
|
#include "indices/u_indices.h"
|
||||||
|
|
||||||
#include "svga_cmd.h"
|
#include "svga_cmd.h"
|
||||||
@@ -37,17 +38,25 @@
|
|||||||
|
|
||||||
static enum pipe_error
|
static enum pipe_error
|
||||||
translate_indices(struct svga_hwtnl *hwtnl, struct pipe_resource *src,
|
translate_indices(struct svga_hwtnl *hwtnl, struct pipe_resource *src,
|
||||||
unsigned offset, unsigned nr, unsigned index_size,
|
unsigned offset, unsigned prim, unsigned nr,
|
||||||
|
unsigned index_size,
|
||||||
u_translate_func translate, struct pipe_resource **out_buf)
|
u_translate_func translate, struct pipe_resource **out_buf)
|
||||||
{
|
{
|
||||||
struct pipe_context *pipe = &hwtnl->svga->pipe;
|
struct pipe_context *pipe = &hwtnl->svga->pipe;
|
||||||
struct pipe_transfer *src_transfer = NULL;
|
struct pipe_transfer *src_transfer = NULL;
|
||||||
struct pipe_transfer *dst_transfer = NULL;
|
struct pipe_transfer *dst_transfer = NULL;
|
||||||
unsigned size = index_size * nr;
|
unsigned size;
|
||||||
const void *src_map = NULL;
|
const void *src_map = NULL;
|
||||||
struct pipe_resource *dst = NULL;
|
struct pipe_resource *dst = NULL;
|
||||||
void *dst_map = NULL;
|
void *dst_map = NULL;
|
||||||
|
|
||||||
|
/* Need to trim vertex count to make sure we don't write too much data
|
||||||
|
* to the dst buffer in the translate() call.
|
||||||
|
*/
|
||||||
|
u_trim_pipe_prim(prim, &nr);
|
||||||
|
|
||||||
|
size = index_size * nr;
|
||||||
|
|
||||||
dst = pipe_buffer_create(pipe->screen,
|
dst = pipe_buffer_create(pipe->screen,
|
||||||
PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_STATIC, size);
|
PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_STATIC, size);
|
||||||
if (dst == NULL)
|
if (dst == NULL)
|
||||||
@@ -180,7 +189,7 @@ svga_hwtnl_draw_range_elements(struct svga_hwtnl *hwtnl,
|
|||||||
ret = translate_indices(hwtnl,
|
ret = translate_indices(hwtnl,
|
||||||
index_buffer,
|
index_buffer,
|
||||||
start * index_size,
|
start * index_size,
|
||||||
gen_nr, gen_size, gen_func, &gen_buf);
|
gen_prim, gen_nr, gen_size, gen_func, &gen_buf);
|
||||||
if (ret != PIPE_OK)
|
if (ret != PIPE_OK)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
@@ -148,6 +148,8 @@ static void svga_surface_copy(struct pipe_context *pipe,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Mark the destination image as being defined */
|
||||||
|
svga_define_texture_level(dtex, dst_face, dst_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -61,18 +61,24 @@ clCreateContextFromType(const cl_context_properties *d_props,
|
|||||||
void *user_data, cl_int *r_errcode) try {
|
void *user_data, cl_int *r_errcode) try {
|
||||||
cl_platform_id d_platform;
|
cl_platform_id d_platform;
|
||||||
cl_uint num_platforms;
|
cl_uint num_platforms;
|
||||||
cl_device_id d_dev;
|
|
||||||
cl_int ret;
|
cl_int ret;
|
||||||
|
std::vector<cl_device_id> devs;
|
||||||
|
cl_uint num_devices;
|
||||||
|
|
||||||
ret = clGetPlatformIDs(1, &d_platform, &num_platforms);
|
ret = clGetPlatformIDs(1, &d_platform, &num_platforms);
|
||||||
if (ret || !num_platforms)
|
if (ret || !num_platforms)
|
||||||
throw error(CL_INVALID_PLATFORM);
|
throw error(CL_INVALID_PLATFORM);
|
||||||
|
|
||||||
ret = clGetDeviceIDs(d_platform, type, 1, &d_dev, 0);
|
ret = clGetDeviceIDs(d_platform, type, 0, NULL, &num_devices);
|
||||||
|
if (ret)
|
||||||
|
throw error(CL_DEVICE_NOT_FOUND);
|
||||||
|
devs.resize(num_devices);
|
||||||
|
ret = clGetDeviceIDs(d_platform, type, num_devices, devs.data(), 0);
|
||||||
if (ret)
|
if (ret)
|
||||||
throw error(CL_DEVICE_NOT_FOUND);
|
throw error(CL_DEVICE_NOT_FOUND);
|
||||||
|
|
||||||
return clCreateContext(d_props, 1, &d_dev, pfn_notify, user_data, r_errcode);
|
return clCreateContext(d_props, num_devices, devs.data(), pfn_notify,
|
||||||
|
user_data, r_errcode);
|
||||||
|
|
||||||
} catch (error &e) {
|
} catch (error &e) {
|
||||||
ret_error(r_errcode, e);
|
ret_error(r_errcode, e);
|
||||||
|
@@ -173,11 +173,15 @@ clGetProgramInfo(cl_program d_prog, cl_program_info param,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CL_PROGRAM_NUM_DEVICES:
|
case CL_PROGRAM_NUM_DEVICES:
|
||||||
buf.as_scalar<cl_uint>() = prog.devices().size();
|
buf.as_scalar<cl_uint>() = prog.devices().size() ?
|
||||||
|
prog.devices().size() :
|
||||||
|
prog.ctx.devs().size();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CL_PROGRAM_DEVICES:
|
case CL_PROGRAM_DEVICES:
|
||||||
buf.as_vector<cl_device_id>() = descs(prog.devices());
|
buf.as_vector<cl_device_id>() = prog.devices().size() ?
|
||||||
|
descs(prog.devices()) :
|
||||||
|
descs(prog.ctx.devs());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CL_PROGRAM_SOURCE:
|
case CL_PROGRAM_SOURCE:
|
||||||
|
@@ -117,7 +117,6 @@ namespace {
|
|||||||
const std::string &opts, clang::LangAS::Map& address_spaces) {
|
const std::string &opts, clang::LangAS::Map& address_spaces) {
|
||||||
|
|
||||||
clang::CompilerInstance c;
|
clang::CompilerInstance c;
|
||||||
clang::CompilerInvocation invocation;
|
|
||||||
clang::EmitLLVMOnlyAction act(&llvm::getGlobalContext());
|
clang::EmitLLVMOnlyAction act(&llvm::getGlobalContext());
|
||||||
std::string log;
|
std::string log;
|
||||||
llvm::raw_string_ostream s_log(log);
|
llvm::raw_string_ostream s_log(log);
|
||||||
|
@@ -269,7 +269,8 @@ namespace clover {
|
|||||||
|
|
||||||
typename super::const_iterator
|
typename super::const_iterator
|
||||||
end() const {
|
end() const {
|
||||||
return { f, tuple::map(ends(), os) };
|
return { f, tuple::map(advances_by(size()),
|
||||||
|
tuple::map(begins(), os)) };
|
||||||
}
|
}
|
||||||
|
|
||||||
typename super::size_type
|
typename super::size_type
|
||||||
|
@@ -89,6 +89,7 @@ dri_create_context(gl_api api,
|
|||||||
unsigned major_version,
|
unsigned major_version,
|
||||||
unsigned minor_version,
|
unsigned minor_version,
|
||||||
uint32_t flags,
|
uint32_t flags,
|
||||||
|
bool notify_reset,
|
||||||
unsigned *error,
|
unsigned *error,
|
||||||
void *sharedContextPrivate);
|
void *sharedContextPrivate);
|
||||||
|
|
||||||
|
@@ -360,6 +360,12 @@ dri_destroy_option_cache(struct dri_screen * screen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
free(screen->optionCache.values);
|
free(screen->optionCache.values);
|
||||||
|
|
||||||
|
/* Default values are copied to screen->optionCache->values in
|
||||||
|
* initOptionCache. The info field, however, is a pointer copy, so don't free
|
||||||
|
* that twice.
|
||||||
|
*/
|
||||||
|
free(screen->optionCacheDefaults.values);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -72,6 +72,11 @@ vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device,
|
|||||||
goto no_context;
|
goto no_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!pscreen->get_param(pscreen, PIPE_CAP_NPOT_TEXTURES)) {
|
||||||
|
ret = VDP_STATUS_NO_IMPLEMENTATION;
|
||||||
|
goto no_context;
|
||||||
|
}
|
||||||
|
|
||||||
*device = vlAddDataHTAB(dev);
|
*device = vlAddDataHTAB(dev);
|
||||||
if (*device == 0) {
|
if (*device == 0) {
|
||||||
ret = VDP_STATUS_ERROR;
|
ret = VDP_STATUS_ERROR;
|
||||||
@@ -86,6 +91,7 @@ vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device,
|
|||||||
return VDP_STATUS_OK;
|
return VDP_STATUS_OK;
|
||||||
|
|
||||||
no_handle:
|
no_handle:
|
||||||
|
dev->context->destroy(dev->context);
|
||||||
/* Destroy vscreen */
|
/* Destroy vscreen */
|
||||||
no_context:
|
no_context:
|
||||||
vl_screen_destroy(dev->vscreen);
|
vl_screen_destroy(dev->vscreen);
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define XA_TRACKER_VERSION_MAJOR 1
|
#define XA_TRACKER_VERSION_MAJOR 2
|
||||||
#define XA_TRACKER_VERSION_MINOR 0
|
#define XA_TRACKER_VERSION_MINOR 0
|
||||||
#define XA_TRACKER_VERSION_PATCH 0
|
#define XA_TRACKER_VERSION_PATCH 0
|
||||||
|
|
||||||
|
@@ -30,6 +30,8 @@
|
|||||||
#
|
#
|
||||||
include $(top_srcdir)/src/gallium/Automake.inc
|
include $(top_srcdir)/src/gallium/Automake.inc
|
||||||
|
|
||||||
|
LDFLAGS += -Wl,--version-script=$(top_srcdir)/src/gallium/targets/egl-static/egl.link
|
||||||
|
|
||||||
AM_CFLAGS = $(PTHREAD_CFLAGS)
|
AM_CFLAGS = $(PTHREAD_CFLAGS)
|
||||||
AM_CPPFLAGS = \
|
AM_CPPFLAGS = \
|
||||||
$(GALLIUM_CFLAGS) \
|
$(GALLIUM_CFLAGS) \
|
||||||
|
3
src/gallium/targets/egl-static/egl.link
Normal file
3
src/gallium/targets/egl-static/egl.link
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
VERSION {
|
||||||
|
global: _eglMain; local: *;
|
||||||
|
};
|
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
include $(top_srcdir)/src/gallium/Automake.inc
|
include $(top_srcdir)/src/gallium/Automake.inc
|
||||||
|
|
||||||
|
LDFLAGS += -Wl,--version-script=$(top_srcdir)/src/gallium/targets/pipe-loader/pipe.link
|
||||||
|
|
||||||
AM_CPPFLAGS = \
|
AM_CPPFLAGS = \
|
||||||
$(GALLIUM_CFLAGS) \
|
$(GALLIUM_CFLAGS) \
|
||||||
-I$(top_srcdir)/include \
|
-I$(top_srcdir)/include \
|
||||||
|
3
src/gallium/targets/pipe-loader/pipe.link
Normal file
3
src/gallium/targets/pipe-loader/pipe.link
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
VERSION {
|
||||||
|
global: driver_descriptor; local: *;
|
||||||
|
};
|
@@ -104,6 +104,24 @@ dri_get_buffers_with_format(__DRIdrawable * driDrawable,
|
|||||||
count, out_count, surf->dri_private);
|
count, out_count, surf->dri_private);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
image_get_buffers(__DRIdrawable *driDrawable,
|
||||||
|
unsigned int format,
|
||||||
|
uint32_t *stamp,
|
||||||
|
void *loaderPrivate,
|
||||||
|
uint32_t buffer_mask,
|
||||||
|
struct __DRIimageList *buffers)
|
||||||
|
{
|
||||||
|
struct gbm_dri_surface *surf = loaderPrivate;
|
||||||
|
struct gbm_dri_device *dri = gbm_dri_device(surf->base.gbm);
|
||||||
|
|
||||||
|
if (dri->image_get_buffers == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return dri->image_get_buffers(driDrawable, format, stamp,
|
||||||
|
surf->dri_private, buffer_mask, buffers);
|
||||||
|
}
|
||||||
|
|
||||||
static const __DRIuseInvalidateExtension use_invalidate = {
|
static const __DRIuseInvalidateExtension use_invalidate = {
|
||||||
{ __DRI_USE_INVALIDATE, 1 }
|
{ __DRI_USE_INVALIDATE, 1 }
|
||||||
};
|
};
|
||||||
@@ -113,13 +131,20 @@ static const __DRIimageLookupExtension image_lookup_extension = {
|
|||||||
dri_lookup_egl_image
|
dri_lookup_egl_image
|
||||||
};
|
};
|
||||||
|
|
||||||
const __DRIdri2LoaderExtension dri2_loader_extension = {
|
static const __DRIdri2LoaderExtension dri2_loader_extension = {
|
||||||
{ __DRI_DRI2_LOADER, 3 },
|
{ __DRI_DRI2_LOADER, 3 },
|
||||||
dri_get_buffers,
|
dri_get_buffers,
|
||||||
dri_flush_front_buffer,
|
dri_flush_front_buffer,
|
||||||
dri_get_buffers_with_format,
|
dri_get_buffers_with_format,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const __DRIimageLoaderExtension image_loader_extension = {
|
||||||
|
{ __DRI_IMAGE_LOADER, 1 },
|
||||||
|
image_get_buffers,
|
||||||
|
dri_flush_front_buffer,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
struct dri_extension_match {
|
struct dri_extension_match {
|
||||||
const char *name;
|
const char *name;
|
||||||
int version;
|
int version;
|
||||||
@@ -258,7 +283,8 @@ dri_screen_create(struct gbm_dri_device *dri)
|
|||||||
dri->extensions[0] = &image_lookup_extension.base;
|
dri->extensions[0] = &image_lookup_extension.base;
|
||||||
dri->extensions[1] = &use_invalidate.base;
|
dri->extensions[1] = &use_invalidate.base;
|
||||||
dri->extensions[2] = &dri2_loader_extension.base;
|
dri->extensions[2] = &dri2_loader_extension.base;
|
||||||
dri->extensions[3] = NULL;
|
dri->extensions[3] = &image_loader_extension.base;
|
||||||
|
dri->extensions[4] = NULL;
|
||||||
|
|
||||||
if (dri->dri2 == NULL)
|
if (dri->dri2 == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
@@ -52,7 +52,7 @@ struct gbm_dri_device {
|
|||||||
__DRIdri2LoaderExtension *loader;
|
__DRIdri2LoaderExtension *loader;
|
||||||
|
|
||||||
const __DRIconfig **driver_configs;
|
const __DRIconfig **driver_configs;
|
||||||
const __DRIextension *extensions[4];
|
const __DRIextension *extensions[5];
|
||||||
const __DRIextension **driver_extensions;
|
const __DRIextension **driver_extensions;
|
||||||
|
|
||||||
__DRIimage *(*lookup_image)(__DRIscreen *screen, void *image, void *data);
|
__DRIimage *(*lookup_image)(__DRIscreen *screen, void *image, void *data);
|
||||||
@@ -67,6 +67,12 @@ struct gbm_dri_device {
|
|||||||
int *width, int *height,
|
int *width, int *height,
|
||||||
unsigned int *attachments, int count,
|
unsigned int *attachments, int count,
|
||||||
int *out_count, void *data);
|
int *out_count, void *data);
|
||||||
|
int (*image_get_buffers)(__DRIdrawable *driDrawable,
|
||||||
|
unsigned int format,
|
||||||
|
uint32_t *stamp,
|
||||||
|
void *loaderPrivate,
|
||||||
|
uint32_t buffer_mask,
|
||||||
|
struct __DRIimageList *buffers);
|
||||||
|
|
||||||
struct wl_drm *wl_drm;
|
struct wl_drm *wl_drm;
|
||||||
};
|
};
|
||||||
|
@@ -1651,7 +1651,7 @@ ast_function_expression::hir(exec_list *instructions,
|
|||||||
} else {
|
} else {
|
||||||
const ast_expression *id = subexpressions[0];
|
const ast_expression *id = subexpressions[0];
|
||||||
const char *func_name = id->primary_expression.identifier;
|
const char *func_name = id->primary_expression.identifier;
|
||||||
YYLTYPE loc = id->get_location();
|
YYLTYPE loc = get_location();
|
||||||
exec_list actual_parameters;
|
exec_list actual_parameters;
|
||||||
|
|
||||||
process_parameters(instructions, &actual_parameters, &this->expressions,
|
process_parameters(instructions, &actual_parameters, &this->expressions,
|
||||||
|
@@ -734,14 +734,15 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
|
|||||||
{
|
{
|
||||||
void *ctx = state;
|
void *ctx = state;
|
||||||
bool error_emitted = (lhs->type->is_error() || rhs->type->is_error());
|
bool error_emitted = (lhs->type->is_error() || rhs->type->is_error());
|
||||||
|
ir_rvalue *extract_channel = NULL;
|
||||||
|
|
||||||
/* If the assignment LHS comes back as an ir_binop_vector_extract
|
/* If the assignment LHS comes back as an ir_binop_vector_extract
|
||||||
* expression, move it to the RHS as an ir_triop_vector_insert.
|
* expression, move it to the RHS as an ir_triop_vector_insert.
|
||||||
*/
|
*/
|
||||||
if (lhs->ir_type == ir_type_expression) {
|
if (lhs->ir_type == ir_type_expression) {
|
||||||
ir_expression *const expr = lhs->as_expression();
|
ir_expression *const lhs_expr = lhs->as_expression();
|
||||||
|
|
||||||
if (unlikely(expr->operation == ir_binop_vector_extract)) {
|
if (unlikely(lhs_expr->operation == ir_binop_vector_extract)) {
|
||||||
ir_rvalue *new_rhs =
|
ir_rvalue *new_rhs =
|
||||||
validate_assignment(state, lhs_loc, lhs->type,
|
validate_assignment(state, lhs_loc, lhs->type,
|
||||||
rhs, is_initializer);
|
rhs, is_initializer);
|
||||||
@@ -749,12 +750,24 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
|
|||||||
if (new_rhs == NULL) {
|
if (new_rhs == NULL) {
|
||||||
return lhs;
|
return lhs;
|
||||||
} else {
|
} else {
|
||||||
|
/* This converts:
|
||||||
|
* - LHS: (expression float vector_extract <vec> <channel>)
|
||||||
|
* - RHS: <scalar>
|
||||||
|
* into:
|
||||||
|
* - LHS: <vec>
|
||||||
|
* - RHS: (expression vec2 vector_insert <vec> <channel> <scalar>)
|
||||||
|
*
|
||||||
|
* The LHS type is now a vector instead of a scalar. Since GLSL
|
||||||
|
* allows assignments to be used as rvalues, we need to re-extract
|
||||||
|
* the channel from assignment_temp when returning the rvalue.
|
||||||
|
*/
|
||||||
|
extract_channel = lhs_expr->operands[1];
|
||||||
rhs = new(ctx) ir_expression(ir_triop_vector_insert,
|
rhs = new(ctx) ir_expression(ir_triop_vector_insert,
|
||||||
expr->operands[0]->type,
|
lhs_expr->operands[0]->type,
|
||||||
expr->operands[0],
|
lhs_expr->operands[0],
|
||||||
new_rhs,
|
new_rhs,
|
||||||
expr->operands[1]);
|
extract_channel);
|
||||||
lhs = expr->operands[0]->clone(ctx, NULL);
|
lhs = lhs_expr->operands[0]->clone(ctx, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -848,6 +861,11 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
|
|||||||
if (!error_emitted)
|
if (!error_emitted)
|
||||||
instructions->push_tail(new(ctx) ir_assignment(lhs, deref_var));
|
instructions->push_tail(new(ctx) ir_assignment(lhs, deref_var));
|
||||||
|
|
||||||
|
if (extract_channel) {
|
||||||
|
return new(ctx) ir_expression(ir_binop_vector_extract,
|
||||||
|
new(ctx) ir_dereference_variable(var),
|
||||||
|
extract_channel->clone(ctx, NULL));
|
||||||
|
}
|
||||||
return new(ctx) ir_dereference_variable(var);
|
return new(ctx) ir_dereference_variable(var);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2934,7 +2952,7 @@ ast_declarator_list::hir(exec_list *instructions,
|
|||||||
precision_names[this->type->qualifier.precision],
|
precision_names[this->type->qualifier.precision],
|
||||||
type_name);
|
type_name);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (this->type->specifier->structure == NULL) {
|
||||||
_mesa_glsl_warning(&loc, state, "empty declaration");
|
_mesa_glsl_warning(&loc, state, "empty declaration");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3355,6 +3373,15 @@ ast_declarator_list::hir(exec_list *instructions,
|
|||||||
ir_variable *earlier =
|
ir_variable *earlier =
|
||||||
get_variable_being_redeclared(var, decl->get_location(), state,
|
get_variable_being_redeclared(var, decl->get_location(), state,
|
||||||
false /* allow_all_redeclarations */);
|
false /* allow_all_redeclarations */);
|
||||||
|
if (earlier != NULL) {
|
||||||
|
if (strncmp(var->name, "gl_", 3) == 0 &&
|
||||||
|
earlier->how_declared == ir_var_declared_in_block) {
|
||||||
|
_mesa_glsl_error(&loc, state,
|
||||||
|
"`%s' has already been redeclared using "
|
||||||
|
"gl_PerVertex", var->name);
|
||||||
|
}
|
||||||
|
earlier->how_declared = ir_var_declared_normally;
|
||||||
|
}
|
||||||
|
|
||||||
if (decl->initializer != NULL) {
|
if (decl->initializer != NULL) {
|
||||||
result = process_initializer((earlier == NULL) ? var : earlier,
|
result = process_initializer((earlier == NULL) ? var : earlier,
|
||||||
@@ -5048,6 +5075,7 @@ ast_interface_block::hir(exec_list *instructions,
|
|||||||
_mesa_glsl_error(&loc, state, "`%s' redeclared",
|
_mesa_glsl_error(&loc, state, "`%s' redeclared",
|
||||||
this->instance_name);
|
this->instance_name);
|
||||||
}
|
}
|
||||||
|
earlier->how_declared = ir_var_declared_normally;
|
||||||
earlier->type = var->type;
|
earlier->type = var->type;
|
||||||
earlier->reinit_interface_type(block_type);
|
earlier->reinit_interface_type(block_type);
|
||||||
delete var;
|
delete var;
|
||||||
@@ -5078,7 +5106,11 @@ ast_interface_block::hir(exec_list *instructions,
|
|||||||
_mesa_glsl_error(&loc, state,
|
_mesa_glsl_error(&loc, state,
|
||||||
"redeclaration of gl_PerVertex can only "
|
"redeclaration of gl_PerVertex can only "
|
||||||
"include built-in variables");
|
"include built-in variables");
|
||||||
|
} else if (earlier->how_declared == ir_var_declared_normally) {
|
||||||
|
_mesa_glsl_error(&loc, state,
|
||||||
|
"`%s' has already been redeclared", var->name);
|
||||||
} else {
|
} else {
|
||||||
|
earlier->how_declared = ir_var_declared_in_block;
|
||||||
earlier->reinit_interface_type(block_type);
|
earlier->reinit_interface_type(block_type);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@@ -5125,6 +5157,12 @@ ast_interface_block::hir(exec_list *instructions,
|
|||||||
if (var != NULL &&
|
if (var != NULL &&
|
||||||
var->get_interface_type() == earlier_per_vertex &&
|
var->get_interface_type() == earlier_per_vertex &&
|
||||||
var->mode == var_mode) {
|
var->mode == var_mode) {
|
||||||
|
if (var->how_declared == ir_var_declared_normally) {
|
||||||
|
_mesa_glsl_error(&loc, state,
|
||||||
|
"redeclaration of gl_PerVertex cannot "
|
||||||
|
"follow a redeclaration of `%s'",
|
||||||
|
var->name);
|
||||||
|
}
|
||||||
state->symbols->disable_variable(var->name);
|
state->symbols->disable_variable(var->name);
|
||||||
var->remove();
|
var->remove();
|
||||||
}
|
}
|
||||||
|
@@ -3864,7 +3864,7 @@ builtin_builder::_fma(const glsl_type *type)
|
|||||||
ir_variable *c = in_var(type, "c");
|
ir_variable *c = in_var(type, "c");
|
||||||
MAKE_SIG(type, gpu_shader5, 3, a, b, c);
|
MAKE_SIG(type, gpu_shader5, 3, a, b, c);
|
||||||
|
|
||||||
body.emit(ret(fma(a, b, c)));
|
body.emit(ret(ir_builder::fma(a, b, c)));
|
||||||
|
|
||||||
return sig;
|
return sig;
|
||||||
}
|
}
|
||||||
|
@@ -434,6 +434,7 @@ builtin_variable_generator::add_variable(const char *name,
|
|||||||
enum ir_variable_mode mode, int slot)
|
enum ir_variable_mode mode, int slot)
|
||||||
{
|
{
|
||||||
ir_variable *var = new(symtab) ir_variable(type, name, mode);
|
ir_variable *var = new(symtab) ir_variable(type, name, mode);
|
||||||
|
var->how_declared = ir_var_declared_implicitly;
|
||||||
|
|
||||||
switch (var->mode) {
|
switch (var->mode) {
|
||||||
case ir_var_auto:
|
case ir_var_auto:
|
||||||
|
@@ -310,6 +310,11 @@ control_line:
|
|||||||
_glcpp_parser_expand_and_lex_from (parser,
|
_glcpp_parser_expand_and_lex_from (parser,
|
||||||
ELIF_EXPANDED, $2);
|
ELIF_EXPANDED, $2);
|
||||||
}
|
}
|
||||||
|
else if (parser->skip_stack &&
|
||||||
|
parser->skip_stack->has_else)
|
||||||
|
{
|
||||||
|
glcpp_error(& @1, parser, "#elif after #else");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_glcpp_parser_skip_stack_change_if (parser, & @1,
|
_glcpp_parser_skip_stack_change_if (parser, & @1,
|
||||||
@@ -324,6 +329,11 @@ control_line:
|
|||||||
{
|
{
|
||||||
glcpp_error(& @1, parser, "#elif with no expression");
|
glcpp_error(& @1, parser, "#elif with no expression");
|
||||||
}
|
}
|
||||||
|
else if (parser->skip_stack &&
|
||||||
|
parser->skip_stack->has_else)
|
||||||
|
{
|
||||||
|
glcpp_error(& @1, parser, "#elif after #else");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_glcpp_parser_skip_stack_change_if (parser, & @1,
|
_glcpp_parser_skip_stack_change_if (parser, & @1,
|
||||||
@@ -332,7 +342,17 @@ control_line:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
| HASH_ELSE {
|
| HASH_ELSE {
|
||||||
_glcpp_parser_skip_stack_change_if (parser, & @1, "else", 1);
|
if (parser->skip_stack &&
|
||||||
|
parser->skip_stack->has_else)
|
||||||
|
{
|
||||||
|
glcpp_error(& @1, parser, "multiple #else");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_glcpp_parser_skip_stack_change_if (parser, & @1, "else", 1);
|
||||||
|
if (parser->skip_stack)
|
||||||
|
parser->skip_stack->has_else = true;
|
||||||
|
}
|
||||||
} NEWLINE
|
} NEWLINE
|
||||||
| HASH_ENDIF {
|
| HASH_ENDIF {
|
||||||
_glcpp_parser_skip_stack_pop (parser, & @1);
|
_glcpp_parser_skip_stack_pop (parser, & @1);
|
||||||
@@ -1252,9 +1272,6 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
|
|||||||
if (extensions->ARB_sample_shading)
|
if (extensions->ARB_sample_shading)
|
||||||
add_builtin_define(parser, "GL_ARB_sample_shading", 1);
|
add_builtin_define(parser, "GL_ARB_sample_shading", 1);
|
||||||
|
|
||||||
if (extensions->EXT_shader_integer_mix)
|
|
||||||
add_builtin_define(parser, "GL_EXT_shader_integer_mix", 1);
|
|
||||||
|
|
||||||
if (extensions->ARB_texture_gather)
|
if (extensions->ARB_texture_gather)
|
||||||
add_builtin_define(parser, "GL_ARB_texture_gather", 1);
|
add_builtin_define(parser, "GL_ARB_texture_gather", 1);
|
||||||
|
|
||||||
@@ -1263,6 +1280,11 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (extensions != NULL) {
|
||||||
|
if (extensions->EXT_shader_integer_mix)
|
||||||
|
add_builtin_define(parser, "GL_EXT_shader_integer_mix", 1);
|
||||||
|
}
|
||||||
|
|
||||||
language_version = 110;
|
language_version = 110;
|
||||||
add_builtin_define(parser, "__VERSION__", language_version);
|
add_builtin_define(parser, "__VERSION__", language_version);
|
||||||
|
|
||||||
@@ -2024,6 +2046,7 @@ _glcpp_parser_skip_stack_push_if (glcpp_parser_t *parser, YYLTYPE *loc,
|
|||||||
node->type = SKIP_TO_ENDIF;
|
node->type = SKIP_TO_ENDIF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
node->has_else = false;
|
||||||
node->next = parser->skip_stack;
|
node->next = parser->skip_stack;
|
||||||
parser->skip_stack = node;
|
parser->skip_stack = node;
|
||||||
}
|
}
|
||||||
|
@@ -153,6 +153,7 @@ typedef enum skip_type {
|
|||||||
|
|
||||||
typedef struct skip_node {
|
typedef struct skip_node {
|
||||||
skip_type_t type;
|
skip_type_t type;
|
||||||
|
bool has_else;
|
||||||
YYLTYPE loc; /* location of the initial #if/#elif/... */
|
YYLTYPE loc; /* location of the initial #if/#elif/... */
|
||||||
struct skip_node *next;
|
struct skip_node *next;
|
||||||
} skip_node_t;
|
} skip_node_t;
|
||||||
|
6
src/glsl/glcpp/tests/118-multiple-else.c
Normal file
6
src/glsl/glcpp/tests/118-multiple-else.c
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#if 0
|
||||||
|
#else
|
||||||
|
int foo;
|
||||||
|
#else
|
||||||
|
int bar;
|
||||||
|
#endif
|
8
src/glsl/glcpp/tests/118-multiple-else.c.expected
Normal file
8
src/glsl/glcpp/tests/118-multiple-else.c.expected
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
0:4(1): preprocessor error: multiple #else
|
||||||
|
|
||||||
|
|
||||||
|
int foo;
|
||||||
|
|
||||||
|
int bar;
|
||||||
|
|
||||||
|
|
6
src/glsl/glcpp/tests/119-elif-after-else.c
Normal file
6
src/glsl/glcpp/tests/119-elif-after-else.c
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#if 0
|
||||||
|
#else
|
||||||
|
int foo;
|
||||||
|
#elif 0
|
||||||
|
int bar;
|
||||||
|
#endif
|
8
src/glsl/glcpp/tests/119-elif-after-else.c.expected
Normal file
8
src/glsl/glcpp/tests/119-elif-after-else.c.expected
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
0:4(1): preprocessor error: #elif after #else
|
||||||
|
|
||||||
|
|
||||||
|
int foo;
|
||||||
|
|
||||||
|
int bar;
|
||||||
|
|
||||||
|
|
@@ -191,6 +191,8 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
|
|||||||
this->gs_input_prim_type = GL_POINTS;
|
this->gs_input_prim_type = GL_POINTS;
|
||||||
this->gs_input_size = 0;
|
this->gs_input_size = 0;
|
||||||
this->out_qualifier = new(this) ast_type_qualifier();
|
this->out_qualifier = new(this) ast_type_qualifier();
|
||||||
|
memset(this->atomic_counter_offsets, 0,
|
||||||
|
sizeof(this->atomic_counter_offsets));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -290,6 +292,10 @@ _mesa_glsl_parse_state::process_version_directive(YYLTYPE *locp, int version,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this->es_shader) {
|
||||||
|
this->ARB_texture_rectangle_enable = false;
|
||||||
|
}
|
||||||
|
|
||||||
this->language_version = version;
|
this->language_version = version;
|
||||||
|
|
||||||
bool supported = false;
|
bool supported = false;
|
||||||
|
@@ -1586,7 +1586,8 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
|
|||||||
ir_variable_mode mode)
|
ir_variable_mode mode)
|
||||||
: max_array_access(0), max_ifc_array_access(NULL),
|
: max_array_access(0), max_ifc_array_access(NULL),
|
||||||
read_only(false), centroid(false), invariant(false),
|
read_only(false), centroid(false), invariant(false),
|
||||||
mode(mode), interpolation(INTERP_QUALIFIER_NONE), atomic()
|
how_declared(ir_var_declared_normally), mode(mode),
|
||||||
|
interpolation(INTERP_QUALIFIER_NONE), atomic()
|
||||||
{
|
{
|
||||||
this->ir_type = ir_type_variable;
|
this->ir_type = ir_type_variable;
|
||||||
this->type = type;
|
this->type = type;
|
||||||
|
@@ -283,6 +283,34 @@ enum ir_variable_mode {
|
|||||||
ir_var_mode_count /**< Number of variable modes */
|
ir_var_mode_count /**< Number of variable modes */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum keeping track of how a variable was declared. For error checking of
|
||||||
|
* the gl_PerVertex redeclaration rules.
|
||||||
|
*/
|
||||||
|
enum ir_var_declaration_type {
|
||||||
|
/**
|
||||||
|
* Normal declaration (for most variables, this means an explicit
|
||||||
|
* declaration. Exception: temporaries are always implicitly declared, but
|
||||||
|
* they still use ir_var_declared_normally).
|
||||||
|
*
|
||||||
|
* Note: an ir_variable that represents a named interface block uses
|
||||||
|
* ir_var_declared_normally.
|
||||||
|
*/
|
||||||
|
ir_var_declared_normally = 0,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Variable was explicitly declared (or re-declared) in an unnamed
|
||||||
|
* interface block.
|
||||||
|
*/
|
||||||
|
ir_var_declared_in_block,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Variable is an implicitly declared built-in that has not been explicitly
|
||||||
|
* re-declared by the shader.
|
||||||
|
*/
|
||||||
|
ir_var_declared_implicitly,
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Layout qualifiers for gl_FragDepth.
|
* \brief Layout qualifiers for gl_FragDepth.
|
||||||
*
|
*
|
||||||
@@ -515,6 +543,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
unsigned assigned:1;
|
unsigned assigned:1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum indicating how the variable was declared. See
|
||||||
|
* ir_var_declaration_type.
|
||||||
|
*
|
||||||
|
* This is used to detect certain kinds of illegal variable redeclarations.
|
||||||
|
*/
|
||||||
|
unsigned how_declared:2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Storage class of the variable.
|
* Storage class of the variable.
|
||||||
*
|
*
|
||||||
|
@@ -68,6 +68,7 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
|
|||||||
var->has_initializer = this->has_initializer;
|
var->has_initializer = this->has_initializer;
|
||||||
var->depth_layout = this->depth_layout;
|
var->depth_layout = this->depth_layout;
|
||||||
var->assigned = this->assigned;
|
var->assigned = this->assigned;
|
||||||
|
var->how_declared = this->how_declared;
|
||||||
var->used = this->used;
|
var->used = this->used;
|
||||||
|
|
||||||
var->num_state_slots = this->num_state_slots;
|
var->num_state_slots = this->num_state_slots;
|
||||||
@@ -162,7 +163,8 @@ ir_loop::clone(void *mem_ctx, struct hash_table *ht) const
|
|||||||
new_loop->to = this->to->clone(mem_ctx, ht);
|
new_loop->to = this->to->clone(mem_ctx, ht);
|
||||||
if (this->increment)
|
if (this->increment)
|
||||||
new_loop->increment = this->increment->clone(mem_ctx, ht);
|
new_loop->increment = this->increment->clone(mem_ctx, ht);
|
||||||
new_loop->counter = counter;
|
if (this->counter)
|
||||||
|
new_loop->counter = this->counter->clone(mem_ctx, ht);
|
||||||
|
|
||||||
foreach_iter(exec_list_iterator, iter, this->body_instructions) {
|
foreach_iter(exec_list_iterator, iter, this->body_instructions) {
|
||||||
ir_instruction *ir = (ir_instruction *)iter.get();
|
ir_instruction *ir = (ir_instruction *)iter.get();
|
||||||
|
@@ -1402,7 +1402,7 @@ ir_expression::constant_expression_value(struct hash_table *variable_context)
|
|||||||
data.f[c] = ldexp(op[0]->value.f[c], op[1]->value.i[c]);
|
data.f[c] = ldexp(op[0]->value.f[c], op[1]->value.i[c]);
|
||||||
/* Flush subnormal values to zero. */
|
/* Flush subnormal values to zero. */
|
||||||
if (!isnormal(data.f[c]))
|
if (!isnormal(data.f[c]))
|
||||||
data.f[c] = copysign(0.0, op[0]->value.f[c]);
|
data.f[c] = copysign(0.0f, op[0]->value.f[c]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@@ -87,6 +87,12 @@ ir_loop::accept(ir_hierarchical_visitor *v)
|
|||||||
if (s != visit_continue)
|
if (s != visit_continue)
|
||||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||||
|
|
||||||
|
if (this->counter) {
|
||||||
|
s = this->counter->accept(v);
|
||||||
|
if (s != visit_continue)
|
||||||
|
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||||
|
}
|
||||||
|
|
||||||
s = visit_list_elements(v, &this->body_instructions);
|
s = visit_list_elements(v, &this->body_instructions);
|
||||||
if (s == visit_stop)
|
if (s == visit_stop)
|
||||||
return s;
|
return s;
|
||||||
|
@@ -132,3 +132,24 @@ ir_variable_refcount_visitor::visit_leave(ir_assignment *ir)
|
|||||||
|
|
||||||
return visit_continue;
|
return visit_continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ir_visitor_status
|
||||||
|
ir_variable_refcount_visitor::visit_leave(ir_loop *ir)
|
||||||
|
{
|
||||||
|
/* If the loop has a counter variable, it is implicitly referenced and
|
||||||
|
* assigned to. Note that since the LHS of an assignment is counted as a
|
||||||
|
* reference, we actually have to increment referenced_count by 2 so that
|
||||||
|
* later code will know that the variable isn't just assigned to.
|
||||||
|
*/
|
||||||
|
if (ir->counter != NULL) {
|
||||||
|
ir_variable_refcount_entry *entry =
|
||||||
|
this->get_variable_entry(ir->counter);
|
||||||
|
if (entry) {
|
||||||
|
entry->referenced_count += 2;
|
||||||
|
entry->assigned_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return visit_continue;
|
||||||
|
}
|
||||||
|
@@ -60,6 +60,7 @@ public:
|
|||||||
|
|
||||||
virtual ir_visitor_status visit_enter(ir_function_signature *);
|
virtual ir_visitor_status visit_enter(ir_function_signature *);
|
||||||
virtual ir_visitor_status visit_leave(ir_assignment *);
|
virtual ir_visitor_status visit_leave(ir_assignment *);
|
||||||
|
virtual ir_visitor_status visit_leave(ir_loop *);
|
||||||
|
|
||||||
ir_variable_refcount_entry *get_variable_entry(ir_variable *var);
|
ir_variable_refcount_entry *get_variable_entry(ir_variable *var);
|
||||||
|
|
||||||
|
@@ -30,13 +30,230 @@
|
|||||||
#include "glsl_symbol_table.h"
|
#include "glsl_symbol_table.h"
|
||||||
#include "linker.h"
|
#include "linker.h"
|
||||||
#include "main/macros.h"
|
#include "main/macros.h"
|
||||||
|
#include "program/hash_table.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Information about a single interface block definition that we need to keep
|
||||||
|
* track of in order to check linkage rules.
|
||||||
|
*
|
||||||
|
* Note: this class is expected to be short lived, so it doesn't make copies
|
||||||
|
* of the strings it references; it simply borrows the pointers from the
|
||||||
|
* ir_variable class.
|
||||||
|
*/
|
||||||
|
struct interface_block_definition
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Extract an interface block definition from an ir_variable that
|
||||||
|
* represents either the interface instance (for named interfaces), or a
|
||||||
|
* member of the interface (for unnamed interfaces).
|
||||||
|
*/
|
||||||
|
explicit interface_block_definition(const ir_variable *var)
|
||||||
|
: type(var->get_interface_type()),
|
||||||
|
instance_name(NULL),
|
||||||
|
array_size(-1)
|
||||||
|
{
|
||||||
|
if (var->is_interface_instance()) {
|
||||||
|
instance_name = var->name;
|
||||||
|
if (var->type->is_array())
|
||||||
|
array_size = var->type->length;
|
||||||
|
}
|
||||||
|
explicitly_declared = (var->how_declared != ir_var_declared_implicitly);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface block type
|
||||||
|
*/
|
||||||
|
const glsl_type *type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For a named interface block, the instance name. Otherwise NULL.
|
||||||
|
*/
|
||||||
|
const char *instance_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For an interface block array, the array size (or 0 if unsized).
|
||||||
|
* Otherwise -1.
|
||||||
|
*/
|
||||||
|
int array_size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True if this interface block was explicitly declared in the shader;
|
||||||
|
* false if it was an implicitly declared built-in interface block.
|
||||||
|
*/
|
||||||
|
bool explicitly_declared;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if two interfaces match, according to intrastage interface matching
|
||||||
|
* rules. If they do, and the first interface uses an unsized array, it will
|
||||||
|
* be updated to reflect the array size declared in the second interface.
|
||||||
|
*/
|
||||||
|
bool
|
||||||
|
intrastage_match(interface_block_definition *a,
|
||||||
|
const interface_block_definition *b,
|
||||||
|
ir_variable_mode mode)
|
||||||
|
{
|
||||||
|
/* Types must match. */
|
||||||
|
if (a->type != b->type) {
|
||||||
|
/* Exception: if both the interface blocks are implicitly declared,
|
||||||
|
* don't force their types to match. They might mismatch due to the two
|
||||||
|
* shaders using different GLSL versions, and that's ok.
|
||||||
|
*/
|
||||||
|
if (a->explicitly_declared || b->explicitly_declared)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Presence/absence of interface names must match. */
|
||||||
|
if ((a->instance_name == NULL) != (b->instance_name == NULL))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
/* For uniforms, instance names need not match. For shader ins/outs,
|
||||||
|
* it's not clear from the spec whether they need to match, but
|
||||||
|
* Mesa's implementation relies on them matching.
|
||||||
|
*/
|
||||||
|
if (a->instance_name != NULL && mode != ir_var_uniform &&
|
||||||
|
strcmp(a->instance_name, b->instance_name) != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Array vs. nonarray must be consistent, and sizes must be
|
||||||
|
* consistent, with the exception that unsized arrays match sized
|
||||||
|
* arrays.
|
||||||
|
*/
|
||||||
|
if ((a->array_size == -1) != (b->array_size == -1))
|
||||||
|
return false;
|
||||||
|
if (b->array_size != 0) {
|
||||||
|
if (a->array_size == 0)
|
||||||
|
a->array_size = b->array_size;
|
||||||
|
else if (a->array_size != b->array_size)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if two interfaces match, according to interstage (in/out) interface
|
||||||
|
* matching rules.
|
||||||
|
*
|
||||||
|
* If \c extra_array_level is true, then vertex-to-geometry shader matching
|
||||||
|
* rules are enforced (i.e. a successful match requires the consumer interface
|
||||||
|
* to be an array and the producer interface to be a non-array).
|
||||||
|
*/
|
||||||
|
bool
|
||||||
|
interstage_match(const interface_block_definition *producer,
|
||||||
|
const interface_block_definition *consumer,
|
||||||
|
bool extra_array_level)
|
||||||
|
{
|
||||||
|
/* Unsized arrays should not occur during interstage linking. They
|
||||||
|
* should have all been assigned a size by link_intrastage_shaders.
|
||||||
|
*/
|
||||||
|
assert(consumer->array_size != 0);
|
||||||
|
assert(producer->array_size != 0);
|
||||||
|
|
||||||
|
/* Types must match. */
|
||||||
|
if (consumer->type != producer->type) {
|
||||||
|
/* Exception: if both the interface blocks are implicitly declared,
|
||||||
|
* don't force their types to match. They might mismatch due to the two
|
||||||
|
* shaders using different GLSL versions, and that's ok.
|
||||||
|
*/
|
||||||
|
if (consumer->explicitly_declared || producer->explicitly_declared)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (extra_array_level) {
|
||||||
|
/* Consumer must be an array, and producer must not. */
|
||||||
|
if (consumer->array_size == -1)
|
||||||
|
return false;
|
||||||
|
if (producer->array_size != -1)
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
/* Array vs. nonarray must be consistent, and sizes must be consistent.
|
||||||
|
* Since unsized arrays have been ruled out, we can check this by just
|
||||||
|
* making sure the sizes are equal.
|
||||||
|
*/
|
||||||
|
if (consumer->array_size != producer->array_size)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class keeps track of a mapping from an interface block name to the
|
||||||
|
* necessary information about that interface block to determine whether to
|
||||||
|
* generate a link error.
|
||||||
|
*
|
||||||
|
* Note: this class is expected to be short lived, so it doesn't make copies
|
||||||
|
* of the strings it references; it simply borrows the pointers from the
|
||||||
|
* ir_variable class.
|
||||||
|
*/
|
||||||
|
class interface_block_definitions
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
interface_block_definitions()
|
||||||
|
: mem_ctx(ralloc_context(NULL)),
|
||||||
|
ht(hash_table_ctor(0, hash_table_string_hash,
|
||||||
|
hash_table_string_compare))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
~interface_block_definitions()
|
||||||
|
{
|
||||||
|
hash_table_dtor(ht);
|
||||||
|
ralloc_free(mem_ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lookup the interface definition having the given block name. Return
|
||||||
|
* NULL if none is found.
|
||||||
|
*/
|
||||||
|
interface_block_definition *lookup(const char *block_name)
|
||||||
|
{
|
||||||
|
return (interface_block_definition *) hash_table_find(ht, block_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new interface definition.
|
||||||
|
*/
|
||||||
|
void store(const interface_block_definition &def)
|
||||||
|
{
|
||||||
|
interface_block_definition *hash_entry =
|
||||||
|
rzalloc(mem_ctx, interface_block_definition);
|
||||||
|
*hash_entry = def;
|
||||||
|
hash_table_insert(ht, hash_entry, def.type->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* Ralloc context for data structures allocated by this class.
|
||||||
|
*/
|
||||||
|
void *mem_ctx;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hash table mapping interface block name to an \c
|
||||||
|
* interface_block_definition struct. interface_block_definition structs
|
||||||
|
* are allocated using \c mem_ctx.
|
||||||
|
*/
|
||||||
|
hash_table *ht;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}; /* anonymous namespace */
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
validate_intrastage_interface_blocks(struct gl_shader_program *prog,
|
validate_intrastage_interface_blocks(struct gl_shader_program *prog,
|
||||||
const gl_shader **shader_list,
|
const gl_shader **shader_list,
|
||||||
unsigned num_shaders)
|
unsigned num_shaders)
|
||||||
{
|
{
|
||||||
glsl_symbol_table interfaces;
|
interface_block_definitions in_interfaces;
|
||||||
|
interface_block_definitions out_interfaces;
|
||||||
|
interface_block_definitions uniform_interfaces;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < num_shaders; i++) {
|
for (unsigned int i = 0; i < num_shaders; i++) {
|
||||||
if (shader_list[i] == NULL)
|
if (shader_list[i] == NULL)
|
||||||
@@ -52,17 +269,36 @@ validate_intrastage_interface_blocks(struct gl_shader_program *prog,
|
|||||||
if (iface_type == NULL)
|
if (iface_type == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const glsl_type *old_iface_type =
|
interface_block_definitions *definitions;
|
||||||
interfaces.get_interface(iface_type->name,
|
switch (var->mode) {
|
||||||
(enum ir_variable_mode) var->mode);
|
case ir_var_shader_in:
|
||||||
|
definitions = &in_interfaces;
|
||||||
if (old_iface_type == NULL) {
|
break;
|
||||||
/* This is the first time we've seen the interface, so save
|
case ir_var_shader_out:
|
||||||
* it into our symbol table.
|
definitions = &out_interfaces;
|
||||||
|
break;
|
||||||
|
case ir_var_uniform:
|
||||||
|
definitions = &uniform_interfaces;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* Only in, out, and uniform interfaces are legal, so we should
|
||||||
|
* never get here.
|
||||||
*/
|
*/
|
||||||
interfaces.add_interface(iface_type->name, iface_type,
|
assert(!"illegal interface type");
|
||||||
(enum ir_variable_mode) var->mode);
|
continue;
|
||||||
} else if (old_iface_type != iface_type) {
|
}
|
||||||
|
|
||||||
|
const interface_block_definition def(var);
|
||||||
|
interface_block_definition *prev_def =
|
||||||
|
definitions->lookup(iface_type->name);
|
||||||
|
|
||||||
|
if (prev_def == NULL) {
|
||||||
|
/* This is the first time we've seen the interface, so save
|
||||||
|
* it into the appropriate data structure.
|
||||||
|
*/
|
||||||
|
definitions->store(def);
|
||||||
|
} else if (!intrastage_match(prev_def, &def,
|
||||||
|
(ir_variable_mode) var->mode)) {
|
||||||
linker_error(prog, "definitions of interface block `%s' do not"
|
linker_error(prog, "definitions of interface block `%s' do not"
|
||||||
" match\n", iface_type->name);
|
" match\n", iface_type->name);
|
||||||
return;
|
return;
|
||||||
@@ -72,43 +308,78 @@ validate_intrastage_interface_blocks(struct gl_shader_program *prog,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
validate_interstage_interface_blocks(struct gl_shader_program *prog,
|
validate_interstage_inout_blocks(struct gl_shader_program *prog,
|
||||||
const gl_shader *producer,
|
const gl_shader *producer,
|
||||||
const gl_shader *consumer)
|
const gl_shader *consumer)
|
||||||
{
|
{
|
||||||
glsl_symbol_table interfaces;
|
interface_block_definitions definitions;
|
||||||
|
const bool extra_array_level = consumer->Type == GL_GEOMETRY_SHADER;
|
||||||
|
|
||||||
/* Add non-output interfaces from the consumer to the symbol table. */
|
/* Add input interfaces from the consumer to the symbol table. */
|
||||||
foreach_list(node, consumer->ir) {
|
foreach_list(node, consumer->ir) {
|
||||||
ir_variable *var = ((ir_instruction *) node)->as_variable();
|
ir_variable *var = ((ir_instruction *) node)->as_variable();
|
||||||
if (!var || !var->get_interface_type() || var->mode == ir_var_shader_out)
|
if (!var || !var->get_interface_type() || var->mode != ir_var_shader_in)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
interfaces.add_interface(var->get_interface_type()->name,
|
definitions.store(interface_block_definition(var));
|
||||||
var->get_interface_type(),
|
|
||||||
(enum ir_variable_mode) var->mode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Verify that the producer's interfaces match. */
|
/* Verify that the producer's output interfaces match. */
|
||||||
foreach_list(node, producer->ir) {
|
foreach_list(node, producer->ir) {
|
||||||
ir_variable *var = ((ir_instruction *) node)->as_variable();
|
ir_variable *var = ((ir_instruction *) node)->as_variable();
|
||||||
if (!var || !var->get_interface_type() || var->mode == ir_var_shader_in)
|
if (!var || !var->get_interface_type() || var->mode != ir_var_shader_out)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
enum ir_variable_mode consumer_mode =
|
interface_block_definition *consumer_def =
|
||||||
var->mode == ir_var_uniform ? ir_var_uniform : ir_var_shader_in;
|
definitions.lookup(var->get_interface_type()->name);
|
||||||
const glsl_type *expected_type =
|
|
||||||
interfaces.get_interface(var->get_interface_type()->name,
|
|
||||||
consumer_mode);
|
|
||||||
|
|
||||||
/* The consumer doesn't use this output block. Ignore it. */
|
/* The consumer doesn't use this output block. Ignore it. */
|
||||||
if (expected_type == NULL)
|
if (consumer_def == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (var->get_interface_type() != expected_type) {
|
const interface_block_definition producer_def(var);
|
||||||
|
|
||||||
|
if (!interstage_match(&producer_def, consumer_def, extra_array_level)) {
|
||||||
linker_error(prog, "definitions of interface block `%s' do not "
|
linker_error(prog, "definitions of interface block `%s' do not "
|
||||||
"match\n", var->get_interface_type()->name);
|
"match\n", var->get_interface_type()->name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
validate_interstage_uniform_blocks(struct gl_shader_program *prog,
|
||||||
|
gl_shader **stages, int num_stages)
|
||||||
|
{
|
||||||
|
interface_block_definitions definitions;
|
||||||
|
|
||||||
|
for (int i = 0; i < num_stages; i++) {
|
||||||
|
if (stages[i] == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
const gl_shader *stage = stages[i];
|
||||||
|
foreach_list(node, stage->ir) {
|
||||||
|
ir_variable *var = ((ir_instruction *) node)->as_variable();
|
||||||
|
if (!var || !var->get_interface_type() || var->mode != ir_var_uniform)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
interface_block_definition *old_def =
|
||||||
|
definitions.lookup(var->get_interface_type()->name);
|
||||||
|
const interface_block_definition new_def(var);
|
||||||
|
if (old_def == NULL) {
|
||||||
|
definitions.store(new_def);
|
||||||
|
} else {
|
||||||
|
/* Interstage uniform matching rules are the same as intrastage
|
||||||
|
* uniform matchin rules (for uniforms, it is as though all
|
||||||
|
* shaders are in the same shader stage).
|
||||||
|
*/
|
||||||
|
if (!intrastage_match(old_def, &new_def, ir_var_uniform)) {
|
||||||
|
linker_error(prog, "definitions of interface block `%s' do not "
|
||||||
|
"match\n", var->get_interface_type()->name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -2154,8 +2154,8 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
|||||||
if (prog->_LinkedShaders[i] == NULL)
|
if (prog->_LinkedShaders[i] == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
validate_interstage_interface_blocks(prog, prog->_LinkedShaders[prev],
|
validate_interstage_inout_blocks(prog, prog->_LinkedShaders[prev],
|
||||||
prog->_LinkedShaders[i]);
|
prog->_LinkedShaders[i]);
|
||||||
if (!prog->LinkStatus)
|
if (!prog->LinkStatus)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
@@ -2168,6 +2168,11 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
|||||||
prev = i;
|
prev = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Cross-validate uniform blocks between shader stages */
|
||||||
|
validate_interstage_uniform_blocks(prog, prog->_LinkedShaders,
|
||||||
|
MESA_SHADER_TYPES);
|
||||||
|
if (!prog->LinkStatus)
|
||||||
|
goto done;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) {
|
for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) {
|
||||||
if (prog->_LinkedShaders[i] != NULL)
|
if (prog->_LinkedShaders[i] != NULL)
|
||||||
|
@@ -65,9 +65,13 @@ validate_intrastage_interface_blocks(struct gl_shader_program *prog,
|
|||||||
unsigned num_shaders);
|
unsigned num_shaders);
|
||||||
|
|
||||||
void
|
void
|
||||||
validate_interstage_interface_blocks(struct gl_shader_program *prog,
|
validate_interstage_inout_blocks(struct gl_shader_program *prog,
|
||||||
const gl_shader *producer,
|
const gl_shader *producer,
|
||||||
const gl_shader *consumer);
|
const gl_shader *consumer);
|
||||||
|
|
||||||
|
void
|
||||||
|
validate_interstage_uniform_blocks(struct gl_shader_program *prog,
|
||||||
|
gl_shader **stages, int num_stages);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
link_assign_atomic_counter_resources(struct gl_context *ctx,
|
link_assign_atomic_counter_resources(struct gl_context *ctx,
|
||||||
|
@@ -254,7 +254,7 @@ loop_control_visitor::visit_leave(ir_loop *ir)
|
|||||||
ir->from = init->clone(ir, NULL);
|
ir->from = init->clone(ir, NULL);
|
||||||
ir->to = limit->clone(ir, NULL);
|
ir->to = limit->clone(ir, NULL);
|
||||||
ir->increment = lv->increment->clone(ir, NULL);
|
ir->increment = lv->increment->clone(ir, NULL);
|
||||||
ir->counter = lv->var;
|
ir->counter = lv->var->clone(ir, NULL);
|
||||||
ir->cmp = cmp;
|
ir->cmp = cmp;
|
||||||
|
|
||||||
max_iterations = iterations;
|
max_iterations = iterations;
|
||||||
|
@@ -381,6 +381,11 @@ lower_clip_distance_visitor::fix_lhs(ir_assignment *ir)
|
|||||||
ir_visitor_status
|
ir_visitor_status
|
||||||
lower_clip_distance_visitor::visit_leave(ir_assignment *ir)
|
lower_clip_distance_visitor::visit_leave(ir_assignment *ir)
|
||||||
{
|
{
|
||||||
|
/* First invoke the base class visitor. This causes handle_rvalue() to be
|
||||||
|
* called on ir->rhs and ir->condition.
|
||||||
|
*/
|
||||||
|
ir_rvalue_visitor::visit_leave(ir);
|
||||||
|
|
||||||
if (this->is_clip_distance_vec8(ir->lhs) ||
|
if (this->is_clip_distance_vec8(ir->lhs) ||
|
||||||
this->is_clip_distance_vec8(ir->rhs)) {
|
this->is_clip_distance_vec8(ir->rhs)) {
|
||||||
/* LHS or RHS of the assignment is the entire 1D gl_ClipDistance array
|
/* LHS or RHS of the assignment is the entire 1D gl_ClipDistance array
|
||||||
|
@@ -352,6 +352,7 @@ equals(ir_texture *a, ir_texture *b)
|
|||||||
if (!equals(a->lod_info.grad.dPdx, b->lod_info.grad.dPdx) ||
|
if (!equals(a->lod_info.grad.dPdx, b->lod_info.grad.dPdx) ||
|
||||||
!equals(a->lod_info.grad.dPdy, b->lod_info.grad.dPdy))
|
!equals(a->lod_info.grad.dPdy, b->lod_info.grad.dPdy))
|
||||||
return false;
|
return false;
|
||||||
|
break;
|
||||||
case ir_txf_ms:
|
case ir_txf_ms:
|
||||||
if (!equals(a->lod_info.sample_index, b->lod_info.sample_index))
|
if (!equals(a->lod_info.sample_index, b->lod_info.sample_index))
|
||||||
return false;
|
return false;
|
||||||
@@ -359,6 +360,7 @@ equals(ir_texture *a, ir_texture *b)
|
|||||||
case ir_tg4:
|
case ir_tg4:
|
||||||
if (!equals(a->lod_info.component, b->lod_info.component))
|
if (!equals(a->lod_info.component, b->lod_info.component))
|
||||||
return false;
|
return false;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
assert(!"Unrecognized texture op");
|
assert(!"Unrecognized texture op");
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user