Compare commits
71 Commits
mesa-10.5.
...
10.5
Author | SHA1 | Date | |
---|---|---|---|
|
4a0bd3dcff | ||
|
7f40d08374 | ||
|
8c8006099f | ||
|
81a0920c3a | ||
|
80e283b053 | ||
|
999b2b2716 | ||
|
81ac47605f | ||
|
f8ea1430ae | ||
|
c11a8c1c33 | ||
|
4c80d44311 | ||
|
8e79cf6ba0 | ||
|
5bec733641 | ||
|
5985de6f1a | ||
|
cdc7aa1038 | ||
|
16b6fa972d | ||
|
3c4570e3fc | ||
|
2843e2a5c8 | ||
|
36250def23 | ||
|
8bcc8f4b48 | ||
|
54ac592009 | ||
|
7b528f0d78 | ||
|
8c748fa125 | ||
|
6bb51be018 | ||
|
a939a4b9a6 | ||
|
e724322f39 | ||
|
9df2ae3305 | ||
|
e82c46de11 | ||
|
fc6caeb9ad | ||
|
e3bcc87755 | ||
|
22d7f3ceca | ||
|
074122fbe3 | ||
|
a81b1d5512 | ||
|
24b043aab7 | ||
|
2de5d0762a | ||
|
e6f1a49809 | ||
|
4ab83eee98 | ||
|
512927bc02 | ||
|
b26bac8b1e | ||
|
20fd2abdd6 | ||
|
bb00457f49 | ||
|
f6e743ea38 | ||
|
1812014fe8 | ||
|
631414a507 | ||
|
4a2d7fbde4 | ||
|
eb3a704bb0 | ||
|
495bcbc48c | ||
|
95b81ee9e8 | ||
|
07aa6d78bb | ||
|
70816a66d5 | ||
|
f8bb4a814d | ||
|
8c56fc9275 | ||
|
6338bd6f70 | ||
|
7087a507bf | ||
|
93650a80e9 | ||
|
23c0c94ac3 | ||
|
efaf906415 | ||
|
adee8f1ca5 | ||
|
56d13627eb | ||
|
a10c9c6725 | ||
|
2d610edf5c | ||
|
0f7c9815a0 | ||
|
ece96b4954 | ||
|
e692b6428c | ||
|
7d76e89053 | ||
|
60e81b47e5 | ||
|
c04aaa5d99 | ||
|
a642ec0551 | ||
|
c13b16029d | ||
|
58b9e11084 | ||
|
d88de40d7a | ||
|
8cb28bc49d |
@@ -24,3 +24,6 @@ fe5fddd7e2df74233a2a02ae021418485f39d11c
|
||||
|
||||
# The optimisations mentioned are not available in 10.5
|
||||
627c68308683abbd6e563a09af6013a33938a790 i965/fs: in MAD optimizations, switch last argument to be immediate
|
||||
|
||||
# 10.5 has the compat string implementation, which includes the <string>
|
||||
967825d053f71c5f5fc3ba31eabc0c6004fde4f1 clover: Build fix for FreeBSD.
|
||||
|
@@ -14,7 +14,7 @@ git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
|
||||
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
|
||||
|
||||
# Grep for commits that were marked as a candidate for the stable tree.
|
||||
git log --reverse --pretty=%H -i --grep='^\([[:space:]]*NOTE: .*[Cc]andidate\|CC:.*mesa-stable\)' HEAD..origin/master |\
|
||||
git log --reverse --pretty=%H -i --grep='^\([[:space:]]*NOTE: .*[Cc]andidate\|CC:.*10\.5.*mesa-stable\)' HEAD..origin/master |\
|
||||
while read sha
|
||||
do
|
||||
# Check to see whether the patch is on the ignore list.
|
||||
|
13
configure.ac
13
configure.ac
@@ -911,7 +911,7 @@ x*yes*yes*)
|
||||
esac
|
||||
|
||||
# Building Xlib-GLX requires shared glapi to be disabled.
|
||||
if test "x$enable_xlib_glx" = xyes; then
|
||||
if test "x$enable_shared_glapi$enable_xlib_glx" = xyesyes; then
|
||||
AC_MSG_NOTICE([Shared GLAPI should not used with Xlib-GLX, disabling])
|
||||
enable_shared_glapi=no
|
||||
fi
|
||||
@@ -1379,8 +1379,15 @@ if test "x$enable_egl" = xyes; then
|
||||
|
||||
if test "$enable_static" != yes; then
|
||||
if test "x$enable_dri" = xyes; then
|
||||
HAVE_EGL_DRIVER_DRI2=1
|
||||
fi
|
||||
HAVE_EGL_DRIVER_DRI2=1
|
||||
if test "x$enable_shared_glapi" = xno; then
|
||||
AC_MSG_ERROR([egl_dri2 requires --enable-shared-glapi])
|
||||
fi
|
||||
else
|
||||
# Avoid building an "empty" libEGL. Drop/update this
|
||||
# when other backends (haiku?) come along.
|
||||
AC_MSG_ERROR([egl requires --enable-dri])
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
|
@@ -31,7 +31,8 @@ because compatibility contexts are not supported.
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
TBD
|
||||
89ff9cb08d0f6e3f34154864c3071253057cd21020759457c8ae27e0f70985d3 mesa-10.5.6.tar.gz
|
||||
66017853bde5f7a6647db3eede30512a091a3491daa1708e0ad8027c328ba595 mesa-10.5.6.tar.xz
|
||||
</pre>
|
||||
|
||||
|
||||
|
103
docs/relnotes/10.5.7.html
Normal file
103
docs/relnotes/10.5.7.html
Normal file
@@ -0,0 +1,103 @@
|
||||
<!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.5.7 Release Notes / June 07, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.5.7 is a bug fix release which fixes bugs found since the 10.5.6 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.5.7 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 are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
8f865ce497435fdf25d4e35f3b5551b2bcd5f9bc6570561183be82af20d18b82 mesa-10.5.7.tar.gz
|
||||
04d06890cd69af8089d6ca76f40e46dcf9cacfe4a9788b32be620574d4638818 mesa-10.5.7.tar.xz
|
||||
</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=89131">Bug 89131</a> - [Bisected] Graphical corruption in Weston, shows old framebuffer pieces</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Ben Widawsky (1):</p>
|
||||
<ul>
|
||||
<li>i965: Emit 3DSTATE_MULTISAMPLE before WM_HZ_OP (gen8+)</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (4):</p>
|
||||
<ul>
|
||||
<li>docs: Add sha256sums for the 10.5.6 release</li>
|
||||
<li>get-pick-list.sh: Require explicit "10.5" for nominating stable patches</li>
|
||||
<li>cherry-ignore: add clover build fix not applicable for 10.5</li>
|
||||
<li>Update version to 10.5.7</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (18):</p>
|
||||
<ul>
|
||||
<li>nvc0/ir: set ftz when sources are floats, not just destinations</li>
|
||||
<li>nv50/ir: guess that the constant offset is the starting slot of array</li>
|
||||
<li>nvc0/ir: LOAD's can't be used for shader inputs</li>
|
||||
<li>nvc0: a geometry shader can have up to 1024 vertices output</li>
|
||||
<li>nv50/ir: avoid messing up arg1 of PFETCH</li>
|
||||
<li>nv30: don't leak fragprog consts</li>
|
||||
<li>nv30: avoid leaking render state and draw shaders</li>
|
||||
<li>nv30: fix clip plane uploads and enable changes</li>
|
||||
<li>nv30/draw: avoid leaving stale pointers in draw state</li>
|
||||
<li>nv30/draw: draw expects constbuf size in bytes, not vec4 units</li>
|
||||
<li>st/mesa: don't leak glsl_to_tgsi object on link failure</li>
|
||||
<li>glsl: avoid leaking linked gl_shader when there's a late linker error</li>
|
||||
<li>nv30/draw: fix indexed draws with swtnl path and a resource index buffer</li>
|
||||
<li>nv30/draw: only use the DMA1 object (GART) if the bo is not in VRAM</li>
|
||||
<li>nv30/draw: allocate vertex buffers in gart</li>
|
||||
<li>nv30/draw: switch varying hookup logic to know about texcoords</li>
|
||||
<li>nv30: falling back to draw path for edgeflag does no good</li>
|
||||
<li>nv30: avoid doing extra work on clear and hitting unexpected states</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (1):</p>
|
||||
<ul>
|
||||
<li>i965/fs: Fix implied_mrf_writes for scratch writes</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (1):</p>
|
||||
<ul>
|
||||
<li>st/dri: fix postprocessing crash when there's no depth buffer</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
112
docs/relnotes/10.5.8.html
Normal file
112
docs/relnotes/10.5.8.html
Normal file
@@ -0,0 +1,112 @@
|
||||
<!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.5.8 Release Notes / June 20, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.5.8 is a bug fix release which fixes bugs found since the 10.5.7 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.5.8 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 are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
611ddcfa3c1bf13f7e6ccac785c8749c3b74c9a78452bac70f8372cf6b209aa0 mesa-10.5.8.tar.gz
|
||||
2866b855c5299a4aed066338c77ff6467c389b2c30ada7647be8758663da2b54 mesa-10.5.8.tar.xz
|
||||
</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=90310">Bug 90310</a> - Fails to build gallium_dri.so at linking stage with clang because of multiple redefinitions</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90347">Bug 90347</a> - [NVE0+] Failure to insert texbar under some circumstances (causing bad colors in Terasology)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90520">Bug 90520</a> - Register spilling clobbers registers used elsewhere in the shader</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90905">Bug 90905</a> - mesa: Finish subdir-objects transition</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Ben Widawsky (1):</p>
|
||||
<ul>
|
||||
<li>i965: Disable compaction for EOT send messages</li>
|
||||
</ul>
|
||||
|
||||
<p>Boyan Ding (1):</p>
|
||||
<ul>
|
||||
<li>egl/x11: Set version of swrastLoader to 2</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (2):</p>
|
||||
<ul>
|
||||
<li>docs: Add sha256sums for the 10.5.7 release</li>
|
||||
<li>Update version to 10.5.8</li>
|
||||
</ul>
|
||||
|
||||
<p>Erik Faye-Lund (1):</p>
|
||||
<ul>
|
||||
<li>mesa: build xmlconfig to a separate static library</li>
|
||||
</ul>
|
||||
|
||||
<p>Francisco Jerez (1):</p>
|
||||
<ul>
|
||||
<li>i965: Don't compact instructions with unmapped bits.</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (3):</p>
|
||||
<ul>
|
||||
<li>nvc0/ir: fix collection of first uses for texture barrier insertion</li>
|
||||
<li>nv50,nvc0: clamp uniform size to 64k</li>
|
||||
<li>nvc0/ir: can't have a join on a load with an indirect source</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (1):</p>
|
||||
<ul>
|
||||
<li>i965/fs: Don't let the EOT send message interfere with the MRF hack</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (1):</p>
|
||||
<ul>
|
||||
<li>egl: fix setting context flags</li>
|
||||
</ul>
|
||||
|
||||
<p>Roland Scheidegger (1):</p>
|
||||
<ul>
|
||||
<li>draw: (trivial) fix NULL pointer dereference</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
140
docs/relnotes/10.5.9.html
Normal file
140
docs/relnotes/10.5.9.html
Normal file
@@ -0,0 +1,140 @@
|
||||
<!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.5.9 Release Notes / July 04, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.5.9 is a bug fix release which fixes bugs found since the 10.5.8 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.5.9 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 are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
0c081b59572ee9732e7438d34adc3817fe8cc8d4b58abc0e71fd4b4c904945cb mesa-10.5.9.tar.gz
|
||||
71c69f31d3dbc35cfa79950e58a01d27030378d8c7ef1259a0b31d4d0487f4ec mesa-10.5.9.tar.xz
|
||||
</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=84225">Bug 84225</a> - Allow constant-index-expression sampler array indexing with GLSL-ES < 300</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88999">Bug 88999</a> - [SKL] Compiz crashes after opening unity dash</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89118">Bug 89118</a> - [SKL Bisected]many Ogles3conform cases core dumped</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90537">Bug 90537</a> - radeonsi bo/va conflict on RADEON_GEM_VA (rscreen->ws->buffer_from_handle returns NULL)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90839">Bug 90839</a> - [10.5.5/10.6 regression, bisected] PBO glDrawPixels no longer using blit fastpath</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90873">Bug 90873</a> - Kernel hang, TearFree On, Mate desktop environment</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91056">Bug 91056</a> - The Bard's Tale (2005, native) has rendering issues</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91117">Bug 91117</a> - Nimbus (running in wine) has rendering issues, objects are semi-transparent</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91124">Bug 91124</a> - Civilization V (in Wine) has rendering issues: text missing, menu bar corrupted</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Ben Widawsky (2):</p>
|
||||
<ul>
|
||||
<li>i965/gen9: Implement Push Constant Buffer workaround</li>
|
||||
<li>i965/skl: Use 1 register for uniform pull constant payload</li>
|
||||
</ul>
|
||||
|
||||
<p>Boyan Ding (1):</p>
|
||||
<ul>
|
||||
<li>egl/x11: Remove duplicate call to dri2_x11_add_configs_for_visuals</li>
|
||||
</ul>
|
||||
|
||||
<p>Chris Wilson (3):</p>
|
||||
<ul>
|
||||
<li>i965: Fix HW blitter pitch limits</li>
|
||||
<li>i915: Blit RGBX<->RGBA drawpixels</li>
|
||||
<li>i965: Export format comparison for blitting between miptrees</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (6):</p>
|
||||
<ul>
|
||||
<li>docs: Add sha256sums for the 10.5.8 release</li>
|
||||
<li>configure: warn about shared_glapi & xlib-glx only when both are set</li>
|
||||
<li>configure: error out when building backend-less libEGL</li>
|
||||
<li>configure: error out when building libEGL without shared-glapi</li>
|
||||
<li>gbm: do not (over)link against libglapi.so</li>
|
||||
<li>Update version to 10.5.9</li>
|
||||
</ul>
|
||||
|
||||
<p>Frank Henigman (1):</p>
|
||||
<ul>
|
||||
<li>gbm: dlopen libglapi so gbm_create_device works</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (8):</p>
|
||||
<ul>
|
||||
<li>glsl: add version checks to conditionals for builtin variable enablement</li>
|
||||
<li>mesa: add GL_PROGRAM_PIPELINE support in KHR_debug calls</li>
|
||||
<li>glsl: binding point is a texture unit, which is a combined space</li>
|
||||
<li>nvc0: always put all tfb bufs into bufctx</li>
|
||||
<li>nv50,nvc0: make sure to pushbuf_refn before putting bo into pushbuf_data</li>
|
||||
<li>nv50/ir: propagate modifier to right arg when const-folding mad</li>
|
||||
<li>nv50/ir: fix emission of address reg in 3rd source</li>
|
||||
<li>nv50/ir: copy joinAt when splitting both before and after</li>
|
||||
</ul>
|
||||
|
||||
<p>Mario Kleiner (2):</p>
|
||||
<ul>
|
||||
<li>nouveau: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.</li>
|
||||
<li>winsys/radeon: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.</li>
|
||||
</ul>
|
||||
|
||||
<p>Michel Dänzer (1):</p>
|
||||
<ul>
|
||||
<li>winsys/radeon: Unmap GPU VM address range when destroying BO</li>
|
||||
</ul>
|
||||
|
||||
<p>Tapani Pälli (6):</p>
|
||||
<ul>
|
||||
<li>glsl: Allow dynamic sampler array indexing with GLSL ES < 3.00</li>
|
||||
<li>mesa/glsl: new compiler option EmitNoIndirectSampler</li>
|
||||
<li>i915: use EmitNoIndirectSampler</li>
|
||||
<li>mesa/st: use EmitNoIndirectSampler if !ARB_gpu_shader5</li>
|
||||
<li>i965: use EmitNoIndirectSampler for gen < 7</li>
|
||||
<li>glsl: validate sampler array indexing for 'constant-index-expression'</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -1120,7 +1120,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
goto cleanup_conn;
|
||||
|
||||
dri2_dpy->swrast_loader_extension.base.name = __DRI_SWRAST_LOADER;
|
||||
dri2_dpy->swrast_loader_extension.base.version = __DRI_SWRAST_LOADER_VERSION;
|
||||
dri2_dpy->swrast_loader_extension.base.version = 2;
|
||||
dri2_dpy->swrast_loader_extension.getDrawableInfo = swrastGetDrawableInfo;
|
||||
dri2_dpy->swrast_loader_extension.putImage = swrastPutImage;
|
||||
dri2_dpy->swrast_loader_extension.getImage = swrastGetImage;
|
||||
@@ -1291,11 +1291,6 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
|
||||
dri2_x11_setup_swap_interval(dri2_dpy);
|
||||
|
||||
if (dri2_dpy->conn) {
|
||||
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp))
|
||||
goto cleanup_configs;
|
||||
}
|
||||
|
||||
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
|
||||
disp->Extensions.NOK_swap_region = EGL_TRUE;
|
||||
disp->Extensions.NOK_texture_from_pixmap = EGL_TRUE;
|
||||
|
@@ -131,7 +131,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
break;
|
||||
}
|
||||
|
||||
ctx->Flags = val;
|
||||
ctx->Flags |= val;
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR:
|
||||
@@ -194,7 +194,8 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
break;
|
||||
}
|
||||
|
||||
ctx->Flags = EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;
|
||||
if (val == EGL_TRUE)
|
||||
ctx->Flags |= EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@@ -1966,7 +1966,7 @@ draw_llvm_set_sampler_state(struct draw_context *draw,
|
||||
for (i = 0; i < draw->num_samplers[PIPE_SHADER_VERTEX]; i++) {
|
||||
struct draw_jit_sampler *jit_sam = &draw->llvm->jit_context.samplers[i];
|
||||
|
||||
if (draw->samplers[i]) {
|
||||
if (draw->samplers[PIPE_SHADER_VERTEX][i]) {
|
||||
const struct pipe_sampler_state *s
|
||||
= draw->samplers[PIPE_SHADER_VERTEX][i];
|
||||
jit_sam->min_lod = s->min_lod;
|
||||
@@ -1979,7 +1979,7 @@ draw_llvm_set_sampler_state(struct draw_context *draw,
|
||||
for (i = 0; i < draw->num_samplers[PIPE_SHADER_GEOMETRY]; i++) {
|
||||
struct draw_jit_sampler *jit_sam = &draw->llvm->gs_jit_context.samplers[i];
|
||||
|
||||
if (draw->samplers[i]) {
|
||||
if (draw->samplers[PIPE_SHADER_GEOMETRY][i]) {
|
||||
const struct pipe_sampler_state *s
|
||||
= draw->samplers[PIPE_SHADER_GEOMETRY][i];
|
||||
jit_sam->min_lod = s->min_lod;
|
||||
|
@@ -332,6 +332,9 @@ BasicBlock::splitBefore(Instruction *insn, bool attach)
|
||||
BasicBlock *bb = new BasicBlock(func);
|
||||
assert(!insn || insn->op != OP_PHI);
|
||||
|
||||
bb->joinAt = joinAt;
|
||||
joinAt = NULL;
|
||||
|
||||
splitCommon(insn, bb, attach);
|
||||
return bb;
|
||||
}
|
||||
|
@@ -499,10 +499,14 @@ CodeEmitterNV50::emitForm_MAD(const Instruction *i)
|
||||
setSrc(i, 2, 2);
|
||||
|
||||
if (i->getIndirect(0, 0)) {
|
||||
assert(!i->getIndirect(1, 0));
|
||||
assert(!i->srcExists(1) || !i->getIndirect(1, 0));
|
||||
assert(!i->srcExists(2) || !i->getIndirect(2, 0));
|
||||
setAReg16(i, 0);
|
||||
} else {
|
||||
} else if (i->srcExists(1) && i->getIndirect(1, 0)) {
|
||||
assert(!i->srcExists(2) || !i->getIndirect(2, 0));
|
||||
setAReg16(i, 1);
|
||||
} else {
|
||||
setAReg16(i, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1270,18 +1270,20 @@ Converter::srcToSym(tgsi::Instruction::SrcRegister src, int c)
|
||||
{
|
||||
const int swz = src.getSwizzle(c);
|
||||
|
||||
/* TODO: Use Array ID when it's available for the index */
|
||||
return makeSym(src.getFile(),
|
||||
src.is2D() ? src.getIndex(1) : 0,
|
||||
src.isIndirect(0) ? -1 : src.getIndex(0), swz,
|
||||
src.getIndex(0), swz,
|
||||
src.getIndex(0) * 16 + swz * 4);
|
||||
}
|
||||
|
||||
Symbol *
|
||||
Converter::dstToSym(tgsi::Instruction::DstRegister dst, int c)
|
||||
{
|
||||
/* TODO: Use Array ID when it's available for the index */
|
||||
return makeSym(dst.getFile(),
|
||||
dst.is2D() ? dst.getIndex(1) : 0,
|
||||
dst.isIndirect(0) ? -1 : dst.getIndex(0), c,
|
||||
dst.getIndex(0), c,
|
||||
dst.getIndex(0) * 16 + c * 4);
|
||||
}
|
||||
|
||||
@@ -1610,6 +1612,7 @@ Converter::insertConvergenceOps(BasicBlock *conv, BasicBlock *fork)
|
||||
join->fixed = 1;
|
||||
conv->insertHead(join);
|
||||
|
||||
assert(!fork->joinAt);
|
||||
fork->joinAt = new_FlowInstruction(func, OP_JOINAT, conv);
|
||||
fork->insertBefore(fork->getExit(), fork->joinAt);
|
||||
}
|
||||
|
@@ -240,6 +240,7 @@ GM107LoweringPass::visit(Instruction *i)
|
||||
Value *ptr = bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(),
|
||||
i->getIndirect(0, 0), bld.mkImm(4));
|
||||
i->setIndirect(0, 0, ptr);
|
||||
i->op = OP_VFETCH;
|
||||
} else {
|
||||
i->op = OP_VFETCH;
|
||||
assert(prog->getType() != Program::TYPE_FRAGMENT); // INTERP
|
||||
|
@@ -871,6 +871,7 @@ NV50LoweringPreSSA::handleTXL(TexInstruction *i)
|
||||
BasicBlock *joinBB = i->bb->splitAfter(i);
|
||||
|
||||
bld.setPosition(currBB, true);
|
||||
assert(!currBB->joinAt);
|
||||
currBB->joinAt = bld.mkFlow(OP_JOINAT, joinBB, CC_ALWAYS, NULL);
|
||||
|
||||
for (int l = 0; l <= 3; ++l) {
|
||||
|
@@ -77,8 +77,7 @@ void
|
||||
NVC0LegalizeSSA::handleFTZ(Instruction *i)
|
||||
{
|
||||
// Only want to flush float inputs
|
||||
if (i->sType != TYPE_F32)
|
||||
return;
|
||||
assert(i->sType == TYPE_F32);
|
||||
|
||||
// If we're already flushing denorms (and NaN's) to zero, no need for this.
|
||||
if (i->dnz)
|
||||
@@ -106,7 +105,7 @@ NVC0LegalizeSSA::visit(BasicBlock *bb)
|
||||
Instruction *next;
|
||||
for (Instruction *i = bb->getEntry(); i; i = next) {
|
||||
next = i->next;
|
||||
if (i->dType == TYPE_F32) {
|
||||
if (i->sType == TYPE_F32) {
|
||||
if (prog->getType() != Program::TYPE_COMPUTE)
|
||||
handleFTZ(i);
|
||||
continue;
|
||||
@@ -146,7 +145,7 @@ NVC0LegalizePostRA::insnDominatedBy(const Instruction *later,
|
||||
|
||||
void
|
||||
NVC0LegalizePostRA::addTexUse(std::list<TexUse> &uses,
|
||||
Instruction *usei, const Instruction *insn)
|
||||
Instruction *usei, const Instruction *texi)
|
||||
{
|
||||
bool add = true;
|
||||
for (std::list<TexUse>::iterator it = uses.begin();
|
||||
@@ -161,7 +160,7 @@ NVC0LegalizePostRA::addTexUse(std::list<TexUse> &uses,
|
||||
++it;
|
||||
}
|
||||
if (add)
|
||||
uses.push_back(TexUse(usei, insn));
|
||||
uses.push_back(TexUse(usei, texi));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -173,7 +172,8 @@ NVC0LegalizePostRA::findOverwritingDefs(const Instruction *texi,
|
||||
while (insn->op == OP_MOV && insn->getDef(0)->equals(insn->getSrc(0)))
|
||||
insn = insn->getSrc(0)->getUniqueInsn();
|
||||
|
||||
if (!insn->bb->reachableBy(texi->bb, term))
|
||||
// NOTE: the tex itself is, of course, not an overwriting definition
|
||||
if (insn == texi || !insn->bb->reachableBy(texi->bb, term))
|
||||
return;
|
||||
|
||||
switch (insn->op) {
|
||||
@@ -221,7 +221,12 @@ NVC0LegalizePostRA::findFirstUses(
|
||||
visited.insert(usei);
|
||||
|
||||
if (usei->op == OP_PHI || usei->op == OP_UNION) {
|
||||
// need a barrier before WAW cases
|
||||
// need a barrier before WAW cases, like:
|
||||
// %r0 = tex
|
||||
// if ...
|
||||
// texbar <- is required or tex might replace x again
|
||||
// %r1 = x <- overwriting def
|
||||
// %r2 = phi %r0, %r1
|
||||
for (int s = 0; usei->srcExists(s); ++s) {
|
||||
Instruction *defi = usei->getSrc(s)->getUniqueInsn();
|
||||
if (defi && &usei->src(s) != *u)
|
||||
@@ -240,7 +245,7 @@ NVC0LegalizePostRA::findFirstUses(
|
||||
usei->subOp != NV50_IR_SUBOP_MOV_FINAL) {
|
||||
findFirstUses(texi, usei, uses, visited);
|
||||
} else {
|
||||
addTexUse(uses, usei, insn);
|
||||
addTexUse(uses, usei, texi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1715,6 +1720,7 @@ NVC0LoweringPass::visit(Instruction *i)
|
||||
Value *ptr = bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(),
|
||||
i->getIndirect(0, 0), bld.mkImm(4));
|
||||
i->setIndirect(0, 0, ptr);
|
||||
i->op = OP_VFETCH;
|
||||
} else {
|
||||
i->op = OP_VFETCH;
|
||||
assert(prog->getType() != Program::TYPE_FRAGMENT); // INTERP
|
||||
|
@@ -207,6 +207,9 @@ LoadPropagation::visit(BasicBlock *bb)
|
||||
if (i->op == OP_CALL) // calls have args as sources, they must be in regs
|
||||
continue;
|
||||
|
||||
if (i->op == OP_PFETCH) // pfetch expects arg1 to be a reg
|
||||
continue;
|
||||
|
||||
if (i->srcExists(1))
|
||||
checkSwapSrc01(i);
|
||||
|
||||
@@ -545,6 +548,11 @@ ConstantFolding::expr(Instruction *i,
|
||||
case OP_POPCNT:
|
||||
res.data.u32 = util_bitcount(a->data.u32 & b->data.u32);
|
||||
break;
|
||||
case OP_PFETCH:
|
||||
// The two arguments to pfetch are logically added together. Normally
|
||||
// the second argument will not be constant, but that can happen.
|
||||
res.data.u32 = a->data.u32 + b->data.u32;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@@ -559,12 +567,17 @@ ConstantFolding::expr(Instruction *i,
|
||||
|
||||
i->getSrc(0)->reg.data = res.data;
|
||||
|
||||
if (i->op == OP_MAD || i->op == OP_FMA) {
|
||||
switch (i->op) {
|
||||
case OP_MAD:
|
||||
case OP_FMA: {
|
||||
i->op = OP_ADD;
|
||||
|
||||
/* Move the immediate to the second arg, otherwise the ADD operation
|
||||
* won't be emittable
|
||||
*/
|
||||
i->setSrc(1, i->getSrc(0));
|
||||
i->src(1).mod = i->src(2).mod;
|
||||
i->setSrc(0, i->getSrc(2));
|
||||
i->src(0).mod = i->src(2).mod;
|
||||
i->setSrc(2, NULL);
|
||||
|
||||
ImmediateValue src0;
|
||||
@@ -574,8 +587,14 @@ ConstantFolding::expr(Instruction *i,
|
||||
bld.setPosition(i, false);
|
||||
i->setSrc(1, bld.loadImm(NULL, res.data.u32));
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
case OP_PFETCH:
|
||||
// Leave PFETCH alone... we just folded its 2 args into 1.
|
||||
break;
|
||||
default:
|
||||
i->op = i->saturate ? OP_SAT : OP_MOV; /* SAT handled by unary() */
|
||||
break;
|
||||
}
|
||||
i->subOp = 0;
|
||||
}
|
||||
@@ -2187,7 +2206,7 @@ FlatteningPass::visit(BasicBlock *bb)
|
||||
insn->op != OP_LINTERP && // probably just nve4
|
||||
insn->op != OP_PINTERP && // probably just nve4
|
||||
((insn->op != OP_LOAD && insn->op != OP_STORE) ||
|
||||
typeSizeof(insn->dType) <= 4) &&
|
||||
(typeSizeof(insn->dType) <= 4 && !insn->src(0).isIndirect(0))) &&
|
||||
!insn->isNop()) {
|
||||
insn->join = 1;
|
||||
bb->remove(bb->getExit());
|
||||
|
@@ -58,7 +58,7 @@ nv30_clear(struct pipe_context *pipe, unsigned buffers,
|
||||
struct pipe_framebuffer_state *fb = &nv30->framebuffer;
|
||||
uint32_t colr = 0, zeta = 0, mode = 0;
|
||||
|
||||
if (!nv30_state_validate(nv30, TRUE))
|
||||
if (!nv30_state_validate(nv30, NV30_NEW_FRAMEBUFFER | NV30_NEW_SCISSOR, TRUE))
|
||||
return;
|
||||
|
||||
if (buffers & PIPE_CLEAR_COLOR && fb->nr_cbufs) {
|
||||
|
@@ -204,7 +204,7 @@ void
|
||||
nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info);
|
||||
|
||||
boolean
|
||||
nv30_state_validate(struct nv30_context *nv30, boolean hwtnl);
|
||||
nv30_state_validate(struct nv30_context *nv30, uint32_t mask, boolean hwtnl);
|
||||
|
||||
void
|
||||
nv30_state_release(struct nv30_context *nv30);
|
||||
|
@@ -71,12 +71,12 @@ nv30_render_allocate_vertices(struct vbuf_render *render,
|
||||
struct nv30_render *r = nv30_render(render);
|
||||
struct nv30_context *nv30 = r->nv30;
|
||||
|
||||
r->length = vertex_size * nr_vertices;
|
||||
r->length = (uint32_t)vertex_size * (uint32_t)nr_vertices;
|
||||
|
||||
if (r->offset + r->length >= render->max_vertex_buffer_bytes) {
|
||||
pipe_resource_reference(&r->buffer, NULL);
|
||||
r->buffer = pipe_buffer_create(&nv30->screen->base.base,
|
||||
PIPE_BIND_VERTEX_BUFFER, 0,
|
||||
PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_STREAM,
|
||||
render->max_vertex_buffer_bytes);
|
||||
if (!r->buffer)
|
||||
return FALSE;
|
||||
@@ -91,10 +91,14 @@ static void *
|
||||
nv30_render_map_vertices(struct vbuf_render *render)
|
||||
{
|
||||
struct nv30_render *r = nv30_render(render);
|
||||
char *map = pipe_buffer_map(&r->nv30->base.pipe, r->buffer,
|
||||
PIPE_TRANSFER_WRITE |
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED, &r->transfer);
|
||||
return map + r->offset;
|
||||
char *map = pipe_buffer_map_range(
|
||||
&r->nv30->base.pipe, r->buffer,
|
||||
r->offset, r->length,
|
||||
PIPE_TRANSFER_WRITE |
|
||||
PIPE_TRANSFER_DISCARD_RANGE,
|
||||
&r->transfer);
|
||||
assert(map);
|
||||
return map;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -103,6 +107,7 @@ nv30_render_unmap_vertices(struct vbuf_render *render,
|
||||
{
|
||||
struct nv30_render *r = nv30_render(render);
|
||||
pipe_buffer_unmap(&r->nv30->base.pipe, r->transfer);
|
||||
r->transfer = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -126,10 +131,10 @@ nv30_render_draw_elements(struct vbuf_render *render,
|
||||
for (i = 0; i < r->vertex_info.num_attribs; i++) {
|
||||
PUSH_RESRC(push, NV30_3D(VTXBUF(i)), BUFCTX_VTXTMP,
|
||||
nv04_resource(r->buffer), r->offset + r->vtxptr[i],
|
||||
NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, 0);
|
||||
NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, NV30_3D_VTXBUF_DMA1);
|
||||
}
|
||||
|
||||
if (!nv30_state_validate(nv30, FALSE))
|
||||
if (!nv30_state_validate(nv30, ~0, FALSE))
|
||||
return;
|
||||
|
||||
BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
|
||||
@@ -171,10 +176,10 @@ nv30_render_draw_arrays(struct vbuf_render *render, unsigned start, uint nr)
|
||||
for (i = 0; i < r->vertex_info.num_attribs; i++) {
|
||||
PUSH_RESRC(push, NV30_3D(VTXBUF(i)), BUFCTX_VTXTMP,
|
||||
nv04_resource(r->buffer), r->offset + r->vtxptr[i],
|
||||
NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, 0);
|
||||
NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, NV30_3D_VTXBUF_DMA1);
|
||||
}
|
||||
|
||||
if (!nv30_state_validate(nv30, FALSE))
|
||||
if (!nv30_state_validate(nv30, ~0, FALSE))
|
||||
return;
|
||||
|
||||
BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
|
||||
@@ -213,22 +218,24 @@ static const struct {
|
||||
[TGSI_SEMANTIC_BCOLOR ] = { EMIT_4F, INTERP_LINEAR , 1, 3, 0x00000004 },
|
||||
[TGSI_SEMANTIC_FOG ] = { EMIT_4F, INTERP_PERSPECTIVE, 5, 5, 0x00000010 },
|
||||
[TGSI_SEMANTIC_PSIZE ] = { EMIT_1F_PSIZE, INTERP_POS , 6, 6, 0x00000020 },
|
||||
[TGSI_SEMANTIC_GENERIC ] = { EMIT_4F, INTERP_PERSPECTIVE, 8, 7, 0x00004000 }
|
||||
[TGSI_SEMANTIC_TEXCOORD] = { EMIT_4F, INTERP_PERSPECTIVE, 8, 7, 0x00004000 },
|
||||
};
|
||||
|
||||
static boolean
|
||||
vroute_add(struct nv30_render *r, uint attrib, uint sem, uint *idx)
|
||||
{
|
||||
struct pipe_screen *pscreen = &r->nv30->screen->base.base;
|
||||
struct nv30_screen *screen = r->nv30->screen;
|
||||
struct nv30_fragprog *fp = r->nv30->fragprog.program;
|
||||
struct vertex_info *vinfo = &r->vertex_info;
|
||||
enum pipe_format format;
|
||||
uint emit = EMIT_OMIT;
|
||||
uint result = *idx;
|
||||
|
||||
if (sem == TGSI_SEMANTIC_GENERIC && result >= 8) {
|
||||
for (result = 0; result < 8; result++) {
|
||||
if (fp->texcoord[result] == *idx) {
|
||||
if (sem == TGSI_SEMANTIC_GENERIC) {
|
||||
uint num_texcoords = (screen->eng3d->oclass < NV40_3D_CLASS) ? 8 : 10;
|
||||
for (result = 0; result < num_texcoords; result++) {
|
||||
if (fp->texcoord[result] == *idx + 8) {
|
||||
sem = TGSI_SEMANTIC_TEXCOORD;
|
||||
emit = vroute[sem].emit;
|
||||
break;
|
||||
}
|
||||
@@ -243,11 +250,11 @@ vroute_add(struct nv30_render *r, uint attrib, uint sem, uint *idx)
|
||||
draw_emit_vertex_attr(vinfo, emit, vroute[sem].interp, attrib);
|
||||
format = draw_translate_vinfo_format(emit);
|
||||
|
||||
r->vtxfmt[attrib] = nv30_vtxfmt(pscreen, format)->hw;
|
||||
r->vtxptr[attrib] = vinfo->size | NV30_3D_VTXBUF_DMA1;
|
||||
r->vtxfmt[attrib] = nv30_vtxfmt(&screen->base.base, format)->hw;
|
||||
r->vtxptr[attrib] = vinfo->size;
|
||||
vinfo->size += draw_translate_vinfo_size(emit);
|
||||
|
||||
if (nv30_screen(pscreen)->eng3d->oclass < NV40_3D_CLASS) {
|
||||
if (screen->eng3d->oclass < NV40_3D_CLASS) {
|
||||
r->vtxprog[attrib][0] = 0x001f38d8;
|
||||
r->vtxprog[attrib][1] = 0x0080001b | (attrib << 9);
|
||||
r->vtxprog[attrib][2] = 0x0836106c;
|
||||
@@ -259,7 +266,12 @@ vroute_add(struct nv30_render *r, uint attrib, uint sem, uint *idx)
|
||||
r->vtxprog[attrib][3] = 0x6041ff80 | (result + vroute[sem].vp40) << 2;
|
||||
}
|
||||
|
||||
*idx = vroute[sem].ow40 << result;
|
||||
if (result < 8)
|
||||
*idx = vroute[sem].ow40 << result;
|
||||
else {
|
||||
assert(sem == TGSI_SEMANTIC_TEXCOORD);
|
||||
*idx = 0x00001000 << (result - 8);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -313,7 +325,7 @@ nv30_render_validate(struct nv30_context *nv30)
|
||||
|
||||
while (pntc && attrib < 16) {
|
||||
uint index = ffs(pntc) - 1; pntc &= ~(1 << index);
|
||||
if (vroute_add(r, attrib, TGSI_SEMANTIC_GENERIC, &index)) {
|
||||
if (vroute_add(r, attrib, TGSI_SEMANTIC_TEXCOORD, &index)) {
|
||||
vp_attribs |= (1 << attrib++);
|
||||
vp_results |= index;
|
||||
}
|
||||
@@ -398,17 +410,17 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
if (nv30->vertprog.constbuf) {
|
||||
void *map = nv04_resource(nv30->vertprog.constbuf)->data;
|
||||
draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0,
|
||||
map, nv30->vertprog.constbuf_nr);
|
||||
map, nv30->vertprog.constbuf_nr * 16);
|
||||
} else {
|
||||
draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < nv30->num_vtxbufs; i++) {
|
||||
const void *map = nv30->vtxbuf[i].user_buffer;
|
||||
if (!map) {
|
||||
if (!nv30->vtxbuf[i].buffer) {
|
||||
continue;
|
||||
}
|
||||
map = pipe_buffer_map(pipe, nv30->vtxbuf[i].buffer,
|
||||
if (nv30->vtxbuf[i].buffer)
|
||||
map = pipe_buffer_map(pipe, nv30->vtxbuf[i].buffer,
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED |
|
||||
PIPE_TRANSFER_READ, &transfer[i]);
|
||||
}
|
||||
@@ -418,9 +430,9 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
if (info->indexed) {
|
||||
const void *map = nv30->idxbuf.user_buffer;
|
||||
if (!map)
|
||||
pipe_buffer_map(pipe, nv30->idxbuf.buffer,
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED |
|
||||
PIPE_TRANSFER_READ, &transferi);
|
||||
map = pipe_buffer_map(pipe, nv30->idxbuf.buffer,
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED |
|
||||
PIPE_TRANSFER_READ, &transferi);
|
||||
draw_set_indexes(draw,
|
||||
(ubyte *) map + nv30->idxbuf.offset,
|
||||
nv30->idxbuf.index_size, ~0);
|
||||
@@ -444,6 +456,12 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
static void
|
||||
nv30_render_destroy(struct vbuf_render *render)
|
||||
{
|
||||
struct nv30_render *r = nv30_render(render);
|
||||
|
||||
if (r->transfer)
|
||||
pipe_buffer_unmap(&r->nv30->base.pipe, r->transfer);
|
||||
pipe_resource_reference(&r->buffer, NULL);
|
||||
nouveau_heap_free(&r->vertprog);
|
||||
FREE(render);
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "draw/draw_context.h"
|
||||
#include "tgsi/tgsi_parse.h"
|
||||
|
||||
#include "nv_object.xml.h"
|
||||
@@ -147,8 +148,12 @@ nv30_fp_state_delete(struct pipe_context *pipe, void *hwcso)
|
||||
|
||||
pipe_resource_reference(&fp->buffer, NULL);
|
||||
|
||||
if (fp->draw)
|
||||
draw_delete_fragment_shader(nv30_context(pipe)->draw, fp->draw);
|
||||
|
||||
FREE((void *)fp->pipe.tokens);
|
||||
FREE(fp->insn);
|
||||
FREE(fp->consts);
|
||||
FREE(fp);
|
||||
}
|
||||
|
||||
|
@@ -272,15 +272,13 @@ nv30_validate_clip(struct nv30_context *nv30)
|
||||
uint32_t clpd_enable = 0;
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (nv30->rast->pipe.clip_plane_enable & (1 << i)) {
|
||||
if (nv30->dirty & NV30_NEW_CLIP) {
|
||||
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_CONST_ID), 5);
|
||||
PUSH_DATA (push, i);
|
||||
PUSH_DATAp(push, nv30->clip.ucp[i], 4);
|
||||
}
|
||||
|
||||
clpd_enable |= 1 << (1 + 4*i);
|
||||
if (nv30->dirty & NV30_NEW_CLIP) {
|
||||
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_CONST_ID), 5);
|
||||
PUSH_DATA (push, i);
|
||||
PUSH_DATAp(push, nv30->clip.ucp[i], 4);
|
||||
}
|
||||
if (nv30->rast->pipe.clip_plane_enable & (1 << i))
|
||||
clpd_enable |= 2 << (4*i);
|
||||
}
|
||||
|
||||
BEGIN_NV04(push, NV30_3D(VP_CLIP_PLANES_ENABLE), 1);
|
||||
@@ -389,7 +387,7 @@ static struct state_validate hwtnl_validate_list[] = {
|
||||
{ nv30_validate_stipple, NV30_NEW_STIPPLE },
|
||||
{ nv30_validate_scissor, NV30_NEW_SCISSOR | NV30_NEW_RASTERIZER },
|
||||
{ nv30_validate_viewport, NV30_NEW_VIEWPORT },
|
||||
{ nv30_validate_clip, NV30_NEW_CLIP },
|
||||
{ nv30_validate_clip, NV30_NEW_CLIP | NV30_NEW_RASTERIZER },
|
||||
{ nv30_fragprog_validate, NV30_NEW_FRAGPROG | NV30_NEW_FRAGCONST },
|
||||
{ nv30_vertprog_validate, NV30_NEW_VERTPROG | NV30_NEW_VERTCONST |
|
||||
NV30_NEW_FRAGPROG | NV30_NEW_RASTERIZER },
|
||||
@@ -456,7 +454,7 @@ nv30_state_context_switch(struct nv30_context *nv30)
|
||||
}
|
||||
|
||||
boolean
|
||||
nv30_state_validate(struct nv30_context *nv30, boolean hwtnl)
|
||||
nv30_state_validate(struct nv30_context *nv30, uint32_t mask, boolean hwtnl)
|
||||
{
|
||||
struct nouveau_screen *screen = &nv30->screen->base;
|
||||
struct nouveau_pushbuf *push = nv30->base.pushbuf;
|
||||
@@ -481,14 +479,16 @@ nv30_state_validate(struct nv30_context *nv30, boolean hwtnl)
|
||||
else
|
||||
validate = swtnl_validate_list;
|
||||
|
||||
if (nv30->dirty) {
|
||||
mask &= nv30->dirty;
|
||||
|
||||
if (mask) {
|
||||
while (validate->func) {
|
||||
if (nv30->dirty & validate->mask)
|
||||
if (mask & validate->mask)
|
||||
validate->func(nv30);
|
||||
validate++;
|
||||
}
|
||||
|
||||
nv30->dirty = 0;
|
||||
nv30->dirty &= ~mask;
|
||||
}
|
||||
|
||||
nouveau_pushbuf_bufctx(push, bctx);
|
||||
|
@@ -564,7 +564,7 @@ nv30_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
if (nv30->vbo_user && !(nv30->dirty & (NV30_NEW_VERTEX | NV30_NEW_ARRAYS)))
|
||||
nv30_update_user_vbufs(nv30);
|
||||
|
||||
nv30_state_validate(nv30, TRUE);
|
||||
nv30_state_validate(nv30, ~0, TRUE);
|
||||
if (nv30->draw_flags) {
|
||||
nv30_render_vbo(pipe, info);
|
||||
return;
|
||||
|
@@ -23,6 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "draw/draw_context.h"
|
||||
#include "util/u_dynarray.h"
|
||||
#include "tgsi/tgsi_parse.h"
|
||||
|
||||
@@ -237,6 +238,10 @@ nv30_vp_state_delete(struct pipe_context *pipe, void *hwcso)
|
||||
|
||||
if (vp->translated)
|
||||
nv30_vertprog_destroy(vp);
|
||||
|
||||
if (vp->draw)
|
||||
draw_delete_vertex_shader(nv30_context(pipe)->draw, vp->draw);
|
||||
|
||||
FREE((void *)vp->pipe.tokens);
|
||||
FREE(vp);
|
||||
}
|
||||
|
@@ -873,9 +873,8 @@ nvfx_vertprog_parse_decl_output(struct nvfx_vpc *vpc,
|
||||
}
|
||||
break;
|
||||
case TGSI_SEMANTIC_EDGEFLAG:
|
||||
/* not really an error just a fallback */
|
||||
NOUVEAU_ERR("cannot handle edgeflag output\n");
|
||||
return FALSE;
|
||||
vpc->r_result[idx] = nvfx_reg(NVFXSR_NONE, 0);
|
||||
return TRUE;
|
||||
default:
|
||||
NOUVEAU_ERR("bad output semantic\n");
|
||||
return FALSE;
|
||||
|
@@ -406,6 +406,7 @@ nv50_query_pushbuf_submit(struct nouveau_pushbuf *push,
|
||||
/* XXX: does this exist ? */
|
||||
#define NV50_IB_ENTRY_1_NO_PREFETCH (0 << (31 - 8))
|
||||
|
||||
PUSH_REFN(push, q->bo, NOUVEAU_BO_RD | NOUVEAU_BO_GART);
|
||||
nouveau_pushbuf_space(push, 0, 0, 1);
|
||||
nouveau_pushbuf_data(push, q->bo, q->offset + result_offset, 4 |
|
||||
NV50_IB_ENTRY_1_NO_PREFETCH);
|
||||
|
@@ -811,12 +811,12 @@ nv50_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
|
||||
nv50->constbuf[s][i].user = (cb && cb->user_buffer) ? TRUE : FALSE;
|
||||
if (nv50->constbuf[s][i].user) {
|
||||
nv50->constbuf[s][i].u.data = cb->user_buffer;
|
||||
nv50->constbuf[s][i].size = cb->buffer_size;
|
||||
nv50->constbuf[s][i].size = MIN2(cb->buffer_size, 0x10000);
|
||||
nv50->constbuf_valid[s] |= 1 << i;
|
||||
} else
|
||||
if (res) {
|
||||
nv50->constbuf[s][i].offset = cb->buffer_offset;
|
||||
nv50->constbuf[s][i].size = align(cb->buffer_size, 0x100);
|
||||
nv50->constbuf[s][i].size = MIN2(align(cb->buffer_size, 0x100), 0x10000);
|
||||
nv50->constbuf_valid[s] |= 1 << i;
|
||||
} else {
|
||||
nv50->constbuf_valid[s] &= ~(1 << i);
|
||||
|
@@ -628,6 +628,7 @@ nv50_draw_elements(struct nv50_context *nv50, boolean shorten,
|
||||
BEGIN_NV04(push, NV50_3D(VERTEX_BEGIN_GL), 1);
|
||||
PUSH_DATA (push, prim);
|
||||
|
||||
PUSH_REFN(push, buf->bo, NOUVEAU_BO_RD | buf->domain);
|
||||
nouveau_pushbuf_space(push, 8, 0, 1);
|
||||
|
||||
switch (index_size) {
|
||||
|
@@ -392,7 +392,7 @@ nvc0_gp_gen_header(struct nvc0_program *gp, struct nv50_ir_prog_info *info)
|
||||
break;
|
||||
}
|
||||
|
||||
gp->hdr[4] = info->prop.gp.maxVertices & 0x1ff;
|
||||
gp->hdr[4] = MIN2(info->prop.gp.maxVertices, 1024);
|
||||
|
||||
return nvc0_vtgp_gen_header(gp, info);
|
||||
}
|
||||
|
@@ -610,6 +610,7 @@ nvc0_query_pushbuf_submit(struct nouveau_pushbuf *push,
|
||||
|
||||
#define NVC0_IB_ENTRY_1_NO_PREFETCH (1 << (31 - 8))
|
||||
|
||||
PUSH_REFN(push, q->bo, NOUVEAU_BO_RD | NOUVEAU_BO_GART);
|
||||
nouveau_pushbuf_space(push, 0, 0, 1);
|
||||
nouveau_pushbuf_data(push, q->bo, q->offset + result_offset, 4 |
|
||||
NVC0_IB_ENTRY_1_NO_PREFETCH);
|
||||
|
@@ -262,11 +262,13 @@ nvc0_tfb_validate(struct nvc0_context *nvc0)
|
||||
if (tfb)
|
||||
targ->stride = tfb->stride[b];
|
||||
|
||||
buf = nv04_resource(targ->pipe.buffer);
|
||||
|
||||
BCTX_REFN(nvc0->bufctx_3d, TFB, buf, WR);
|
||||
|
||||
if (!(nvc0->tfbbuf_dirty & (1 << b)))
|
||||
continue;
|
||||
|
||||
buf = nv04_resource(targ->pipe.buffer);
|
||||
|
||||
if (!targ->clean)
|
||||
nvc0_query_fifo_wait(push, targ->pq);
|
||||
BEGIN_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 5);
|
||||
@@ -280,7 +282,6 @@ nvc0_tfb_validate(struct nvc0_context *nvc0)
|
||||
PUSH_DATA(push, 0); /* TFB_BUFFER_OFFSET */
|
||||
targ->clean = FALSE;
|
||||
}
|
||||
BCTX_REFN(nvc0->bufctx_3d, TFB, buf, WR);
|
||||
}
|
||||
for (; b < 4; ++b)
|
||||
IMMED_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 0);
|
||||
|
@@ -811,12 +811,12 @@ nvc0_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
|
||||
nvc0->constbuf[s][i].user = (cb && cb->user_buffer) ? TRUE : FALSE;
|
||||
if (nvc0->constbuf[s][i].user) {
|
||||
nvc0->constbuf[s][i].u.data = cb->user_buffer;
|
||||
nvc0->constbuf[s][i].size = cb->buffer_size;
|
||||
nvc0->constbuf[s][i].size = MIN2(cb->buffer_size, 0x10000);
|
||||
nvc0->constbuf_valid[s] |= 1 << i;
|
||||
} else
|
||||
if (cb) {
|
||||
nvc0->constbuf[s][i].offset = cb->buffer_offset;
|
||||
nvc0->constbuf[s][i].size = align(cb->buffer_size, 0x100);
|
||||
nvc0->constbuf[s][i].size = MIN2(align(cb->buffer_size, 0x100), 0x10000);
|
||||
nvc0->constbuf_valid[s] |= 1 << i;
|
||||
}
|
||||
else {
|
||||
|
@@ -829,6 +829,7 @@ nvc0_draw_indirect(struct nvc0_context *nvc0, const struct pipe_draw_info *info)
|
||||
}
|
||||
PUSH_DATA(push, nvc0_prim_gl(info->mode));
|
||||
#define NVC0_IB_ENTRY_1_NO_PREFETCH (1 << (31 - 8))
|
||||
PUSH_REFN(push, buf->bo, NOUVEAU_BO_RD | buf->domain);
|
||||
nouveau_pushbuf_space(push, 0, 0, 1);
|
||||
nouveau_pushbuf_data(push,
|
||||
buf->bo, offset, NVC0_IB_ENTRY_1_NO_PREFETCH | size);
|
||||
|
@@ -233,11 +233,10 @@ dri_make_current(__DRIcontext * cPriv,
|
||||
|
||||
ctx->stapi->make_current(ctx->stapi, ctx->st, &draw->base, &read->base);
|
||||
|
||||
// This is ok to call here. If they are already init, it's a no-op.
|
||||
if (draw->textures[ST_ATTACHMENT_BACK_LEFT] && draw->textures[ST_ATTACHMENT_DEPTH_STENCIL]
|
||||
&& ctx->pp)
|
||||
pp_init_fbos(ctx->pp, draw->textures[ST_ATTACHMENT_BACK_LEFT]->width0,
|
||||
draw->textures[ST_ATTACHMENT_BACK_LEFT]->height0);
|
||||
/* This is ok to call here. If they are already init, it's a no-op. */
|
||||
if (ctx->pp && draw->textures[ST_ATTACHMENT_BACK_LEFT])
|
||||
pp_init_fbos(ctx->pp, draw->textures[ST_ATTACHMENT_BACK_LEFT]->width0,
|
||||
draw->textures[ST_ATTACHMENT_BACK_LEFT]->height0);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
@@ -55,12 +55,6 @@ gallium_dri_la_LIBADD = \
|
||||
$(LIBDRM_LIBS) \
|
||||
$(GALLIUM_COMMON_LIB_DEPS)
|
||||
|
||||
# XXX: Temporary allow duplicated symbols, as the loader pulls in xmlconfig.c
|
||||
# which already provides driParse* and driQuery* amongst others.
|
||||
# Remove this hack as we come up with a cleaner solution.
|
||||
gallium_dri_la_LDFLAGS += \
|
||||
-Wl,--allow-multiple-definition
|
||||
|
||||
EXTRA_gallium_dri_la_DEPENDENCIES = \
|
||||
dri.sym \
|
||||
$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn
|
||||
|
@@ -120,7 +120,11 @@ nouveau_drm_screen_create(int fd)
|
||||
if (!screen)
|
||||
goto err;
|
||||
|
||||
util_hash_table_set(fd_tab, intptr_to_pointer(fd), screen);
|
||||
/* Use dupfd in hash table, to avoid errors if the original fd gets
|
||||
* closed by its owner. The hash key needs to live at least as long as
|
||||
* the screen.
|
||||
*/
|
||||
util_hash_table_set(fd_tab, intptr_to_pointer(dupfd), screen);
|
||||
screen->refcount = 1;
|
||||
pipe_mutex_unlock(nouveau_screen_mutex);
|
||||
return &screen->base;
|
||||
|
@@ -305,14 +305,34 @@ static void radeon_bo_destroy(struct pb_buffer *_buf)
|
||||
if (bo->ptr)
|
||||
os_munmap(bo->ptr, bo->base.size);
|
||||
|
||||
if (mgr->va) {
|
||||
if (bo->rws->va_unmap_working) {
|
||||
struct drm_radeon_gem_va va;
|
||||
|
||||
va.handle = bo->handle;
|
||||
va.vm_id = 0;
|
||||
va.operation = RADEON_VA_UNMAP;
|
||||
va.flags = RADEON_VM_PAGE_READABLE |
|
||||
RADEON_VM_PAGE_WRITEABLE |
|
||||
RADEON_VM_PAGE_SNOOPED;
|
||||
va.offset = bo->va;
|
||||
|
||||
if (drmCommandWriteRead(bo->rws->fd, DRM_RADEON_GEM_VA, &va,
|
||||
sizeof(va)) != 0 &&
|
||||
va.operation == RADEON_VA_RESULT_ERROR) {
|
||||
fprintf(stderr, "radeon: Failed to deallocate virtual address for buffer:\n");
|
||||
fprintf(stderr, "radeon: size : %d bytes\n", bo->base.size);
|
||||
fprintf(stderr, "radeon: va : 0x%016llx\n", (unsigned long long)bo->va);
|
||||
}
|
||||
}
|
||||
|
||||
radeon_bomgr_free_va(mgr, bo->va, bo->base.size);
|
||||
}
|
||||
|
||||
/* Close object. */
|
||||
args.handle = bo->handle;
|
||||
drmIoctl(bo->rws->fd, DRM_IOCTL_GEM_CLOSE, &args);
|
||||
|
||||
if (mgr->va) {
|
||||
radeon_bomgr_free_va(mgr, bo->va, bo->base.size);
|
||||
}
|
||||
|
||||
pipe_mutex_destroy(bo->map_mutex);
|
||||
|
||||
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
|
||||
|
@@ -49,6 +49,8 @@
|
||||
#define RADEON_INFO_ACTIVE_CU_COUNT 0x20
|
||||
#endif
|
||||
|
||||
#define RADEON_INFO_VA_UNMAP_WORKING 0x25
|
||||
|
||||
static struct util_hash_table *fd_tab = NULL;
|
||||
pipe_static_mutex(fd_tab_mutex);
|
||||
|
||||
@@ -376,6 +378,8 @@ static boolean do_winsys_init(struct radeon_drm_winsys *ws)
|
||||
if (!radeon_get_drm_value(ws->fd, RADEON_INFO_IB_VM_MAX_SIZE, NULL,
|
||||
&ib_vm_max_size))
|
||||
ws->info.r600_virtual_address = FALSE;
|
||||
radeon_get_drm_value(ws->fd, RADEON_INFO_VA_UNMAP_WORKING, NULL,
|
||||
&ws->va_unmap_working);
|
||||
}
|
||||
if (ws->gen == DRV_R600 && !debug_get_bool_option("RADEON_VA", FALSE))
|
||||
ws->info.r600_virtual_address = FALSE;
|
||||
@@ -461,6 +465,10 @@ static void radeon_winsys_destroy(struct radeon_winsys *rws)
|
||||
if (ws->gen >= DRV_R600) {
|
||||
radeon_surface_manager_free(ws->surf_man);
|
||||
}
|
||||
|
||||
if (ws->fd)
|
||||
close(ws->fd);
|
||||
|
||||
FREE(rws);
|
||||
}
|
||||
|
||||
@@ -662,7 +670,7 @@ radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ws->fd = fd;
|
||||
ws->fd = dup(fd);
|
||||
|
||||
if (!do_winsys_init(ws))
|
||||
goto fail;
|
||||
@@ -678,7 +686,7 @@ radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create)
|
||||
goto fail;
|
||||
|
||||
if (ws->gen >= DRV_R600) {
|
||||
ws->surf_man = radeon_surface_manager_new(fd);
|
||||
ws->surf_man = radeon_surface_manager_new(ws->fd);
|
||||
if (!ws->surf_man)
|
||||
goto fail;
|
||||
}
|
||||
@@ -719,7 +727,7 @@ radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
util_hash_table_set(fd_tab, intptr_to_pointer(fd), ws);
|
||||
util_hash_table_set(fd_tab, intptr_to_pointer(ws->fd), ws);
|
||||
|
||||
/* We must unlock the mutex once the winsys is fully initialized, so that
|
||||
* other threads attempting to create the winsys from the same fd will
|
||||
@@ -736,6 +744,9 @@ fail:
|
||||
ws->kman->destroy(ws->kman);
|
||||
if (ws->surf_man)
|
||||
radeon_surface_manager_free(ws->surf_man);
|
||||
if (ws->fd)
|
||||
close(ws->fd);
|
||||
|
||||
FREE(ws);
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -55,6 +55,7 @@ struct radeon_drm_winsys {
|
||||
enum radeon_generation gen;
|
||||
struct radeon_info info;
|
||||
uint32_t va_start;
|
||||
uint32_t va_unmap_working;
|
||||
uint32_t accel_working2;
|
||||
|
||||
struct pb_manager *kman;
|
||||
|
@@ -52,7 +52,8 @@ libgbm_dri_la_CFLAGS = \
|
||||
$(LIBDRM_CFLAGS)
|
||||
|
||||
libgbm_la_LIBADD += \
|
||||
libgbm_dri.la $(top_builddir)/src/mapi/shared-glapi/libglapi.la $(LIBDRM_LIBS)
|
||||
libgbm_dri.la \
|
||||
$(LIBDRM_LIBS)
|
||||
endif
|
||||
|
||||
TESTS = gbm-symbols-check
|
||||
|
@@ -311,6 +311,14 @@ dri_open_driver(struct gbm_dri_device *dri)
|
||||
if (search_paths == NULL)
|
||||
search_paths = DEFAULT_DRIVER_DIR;
|
||||
|
||||
/* Temporarily work around dri driver libs that need symbols in libglapi
|
||||
* but don't automatically link it in.
|
||||
*/
|
||||
/* XXX: Library name differs on per platforms basis. Update this as
|
||||
* osx/cygwin/windows/bsd gets support for GBM..
|
||||
*/
|
||||
dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL);
|
||||
|
||||
dri->driver = NULL;
|
||||
end = search_paths + strlen(search_paths);
|
||||
for (p = search_paths; p < end && dri->driver == NULL; p = next + 1) {
|
||||
|
@@ -228,24 +228,26 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
|
||||
* dynamically uniform expression is undefined.
|
||||
*/
|
||||
if (array->type->element_type()->is_sampler()) {
|
||||
if (!state->is_version(130, 100)) {
|
||||
if (state->es_shader) {
|
||||
_mesa_glsl_warning(&loc, state,
|
||||
"sampler arrays indexed with non-constant "
|
||||
"expressions is optional in %s",
|
||||
state->get_version_string());
|
||||
} else {
|
||||
_mesa_glsl_warning(&loc, state,
|
||||
"sampler arrays indexed with non-constant "
|
||||
"expressions will be forbidden in GLSL 1.30 "
|
||||
"and later");
|
||||
}
|
||||
} else if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"sampler arrays indexed with non-constant "
|
||||
"expressions is forbidden in GLSL 1.30 and "
|
||||
"later");
|
||||
}
|
||||
if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) {
|
||||
if (!state->is_version(130, 100)) {
|
||||
if (state->es_shader) {
|
||||
_mesa_glsl_warning(&loc, state,
|
||||
"sampler arrays indexed with non-constant "
|
||||
"expressions is optional in %s",
|
||||
state->get_version_string());
|
||||
} else {
|
||||
_mesa_glsl_warning(&loc, state,
|
||||
"sampler arrays indexed with non-constant "
|
||||
"expressions will be forbidden in GLSL 1.30 "
|
||||
"and later");
|
||||
}
|
||||
} else if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"sampler arrays indexed with non-constant "
|
||||
"expressions is forbidden in GLSL 1.30 and "
|
||||
"later");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2108,7 +2108,7 @@ validate_binding_qualifier(struct _mesa_glsl_parse_state *state,
|
||||
* with an array of size N, all elements of the array from binding
|
||||
* through binding + N - 1 must be within this range."
|
||||
*/
|
||||
unsigned limit = ctx->Const.Program[state->stage].MaxTextureImageUnits;
|
||||
unsigned limit = ctx->Const.MaxCombinedTextureImageUnits;
|
||||
|
||||
if (max_index >= limit) {
|
||||
_mesa_glsl_error(loc, state, "layout(binding = %d) for %d samplers "
|
||||
|
@@ -849,9 +849,9 @@ void
|
||||
builtin_variable_generator::generate_gs_special_vars()
|
||||
{
|
||||
add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer");
|
||||
if (state->ARB_viewport_array_enable)
|
||||
if (state->is_version(410, 0) || state->ARB_viewport_array_enable)
|
||||
add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
|
||||
if (state->ARB_gpu_shader5_enable)
|
||||
if (state->is_version(400, 0) || state->ARB_gpu_shader5_enable)
|
||||
add_system_value(SYSTEM_VALUE_INVOCATION_ID, int_t, "gl_InvocationID");
|
||||
|
||||
/* Although gl_PrimitiveID appears in tessellation control and tessellation
|
||||
@@ -919,7 +919,7 @@ builtin_variable_generator::generate_fs_special_vars()
|
||||
var->enable_extension_warning("GL_AMD_shader_stencil_export");
|
||||
}
|
||||
|
||||
if (state->ARB_sample_shading_enable) {
|
||||
if (state->is_version(400, 0) || state->ARB_sample_shading_enable) {
|
||||
add_system_value(SYSTEM_VALUE_SAMPLE_ID, int_t, "gl_SampleID");
|
||||
add_system_value(SYSTEM_VALUE_SAMPLE_POS, vec2_t, "gl_SamplePosition");
|
||||
/* From the ARB_sample_shading specification:
|
||||
@@ -932,11 +932,11 @@ builtin_variable_generator::generate_fs_special_vars()
|
||||
add_output(FRAG_RESULT_SAMPLE_MASK, array(int_t, 1), "gl_SampleMask");
|
||||
}
|
||||
|
||||
if (state->ARB_gpu_shader5_enable) {
|
||||
if (state->is_version(400, 0) || state->ARB_gpu_shader5_enable) {
|
||||
add_system_value(SYSTEM_VALUE_SAMPLE_MASK_IN, array(int_t, 1), "gl_SampleMaskIn");
|
||||
}
|
||||
|
||||
if (state->ARB_fragment_layer_viewport_enable) {
|
||||
if (state->is_version(430, 0) || state->ARB_fragment_layer_viewport_enable) {
|
||||
add_input(VARYING_SLOT_LAYER, int_t, "gl_Layer");
|
||||
add_input(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
|
||||
}
|
||||
|
@@ -345,6 +345,39 @@ private:
|
||||
bool uses_non_zero_stream;
|
||||
};
|
||||
|
||||
/* Class that finds array derefs and check if indexes are dynamic. */
|
||||
class dynamic_sampler_array_indexing_visitor : public ir_hierarchical_visitor
|
||||
{
|
||||
public:
|
||||
dynamic_sampler_array_indexing_visitor() :
|
||||
dynamic_sampler_array_indexing(false)
|
||||
{
|
||||
}
|
||||
|
||||
ir_visitor_status visit_enter(ir_dereference_array *ir)
|
||||
{
|
||||
if (!ir->variable_referenced())
|
||||
return visit_continue;
|
||||
|
||||
if (!ir->variable_referenced()->type->contains_sampler())
|
||||
return visit_continue;
|
||||
|
||||
if (!ir->array_index->constant_expression_value()) {
|
||||
dynamic_sampler_array_indexing = true;
|
||||
return visit_stop;
|
||||
}
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
bool uses_dynamic_sampler_array_indexing()
|
||||
{
|
||||
return dynamic_sampler_array_indexing;
|
||||
}
|
||||
|
||||
private:
|
||||
bool dynamic_sampler_array_indexing;
|
||||
};
|
||||
|
||||
} /* anonymous namespace */
|
||||
|
||||
void
|
||||
@@ -2479,6 +2512,41 @@ check_explicit_uniform_locations(struct gl_context *ctx,
|
||||
delete uniform_map;
|
||||
}
|
||||
|
||||
/**
|
||||
* This check is done to make sure we allow only constant expression
|
||||
* indexing and "constant-index-expression" (indexing with an expression
|
||||
* that includes loop induction variable).
|
||||
*/
|
||||
static bool
|
||||
validate_sampler_array_indexing(struct gl_context *ctx,
|
||||
struct gl_shader_program *prog)
|
||||
{
|
||||
dynamic_sampler_array_indexing_visitor v;
|
||||
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||
if (prog->_LinkedShaders[i] == NULL)
|
||||
continue;
|
||||
|
||||
bool no_dynamic_indexing =
|
||||
ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectSampler;
|
||||
|
||||
/* Search for array derefs in shader. */
|
||||
v.run(prog->_LinkedShaders[i]->ir);
|
||||
if (v.uses_dynamic_sampler_array_indexing()) {
|
||||
const char *msg = "sampler arrays indexed with non-constant "
|
||||
"expressions is forbidden in GLSL %s %u";
|
||||
/* Backend has indicated that it has no dynamic indexing support. */
|
||||
if (no_dynamic_indexing) {
|
||||
linker_error(prog, msg, prog->IsES ? "ES" : "", prog->Version);
|
||||
return false;
|
||||
} else {
|
||||
linker_warning(prog, msg, prog->IsES ? "ES" : "", prog->Version);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
{
|
||||
@@ -2570,8 +2638,11 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
link_intrastage_shaders(mem_ctx, ctx, prog, shader_list[stage],
|
||||
num_shaders[stage]);
|
||||
|
||||
if (!prog->LinkStatus)
|
||||
if (!prog->LinkStatus) {
|
||||
if (sh)
|
||||
ctx->Driver.DeleteShader(ctx, sh);
|
||||
goto done;
|
||||
}
|
||||
|
||||
switch (stage) {
|
||||
case MESA_SHADER_VERTEX:
|
||||
@@ -2584,8 +2655,11 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
validate_fragment_shader_executable(prog, sh);
|
||||
break;
|
||||
}
|
||||
if (!prog->LinkStatus)
|
||||
if (!prog->LinkStatus) {
|
||||
if (sh)
|
||||
ctx->Driver.DeleteShader(ctx, sh);
|
||||
goto done;
|
||||
}
|
||||
|
||||
_mesa_reference_shader(ctx, &prog->_LinkedShaders[stage], sh);
|
||||
}
|
||||
@@ -2689,6 +2763,16 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
lower_const_arrays_to_uniforms(prog->_LinkedShaders[i]->ir);
|
||||
}
|
||||
|
||||
/* Validation for special cases where we allow sampler array indexing
|
||||
* with loop induction variable. This check emits a warning or error
|
||||
* depending if backend can handle dynamic indexing.
|
||||
*/
|
||||
if ((!prog->IsES && prog->Version < 130) ||
|
||||
(prog->IsES && prog->Version < 300)) {
|
||||
if (!validate_sampler_array_indexing(ctx, prog))
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Check and validate stream emissions in geometry shaders */
|
||||
validate_geometry_shader_emissions(ctx, prog);
|
||||
|
||||
|
@@ -100,6 +100,18 @@ public:
|
||||
|
||||
virtual ir_visitor_status visit_enter(ir_dereference_array *ir)
|
||||
{
|
||||
/* Force unroll in case of dynamic indexing with sampler arrays
|
||||
* when EmitNoIndirectSampler is set.
|
||||
*/
|
||||
if (options->EmitNoIndirectSampler) {
|
||||
if ((ir->array->type->is_array() &&
|
||||
ir->array->type->contains_sampler()) &&
|
||||
!ir->array_index->constant_expression_value()) {
|
||||
unsupported_variable_indexing = true;
|
||||
return visit_continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for arrays variably-indexed by a loop induction variable.
|
||||
* Unrolling the loop may convert that access into constant-indexing.
|
||||
*
|
||||
|
@@ -41,15 +41,11 @@ libloader_la_CPPFLAGS += \
|
||||
-I$(top_builddir)/src/mesa/drivers/dri/common/ \
|
||||
-I$(top_srcdir)/src/mesa/ \
|
||||
-I$(top_srcdir)/src/mapi/ \
|
||||
-DUSE_DRICONF \
|
||||
$(EXPAT_CFLAGS)
|
||||
-DUSE_DRICONF
|
||||
|
||||
libloader_la_SOURCES += \
|
||||
$(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
|
||||
libloader_la_LIBADD += \
|
||||
$(top_builddir)/src/mesa/drivers/dri/common/libxmlconfig.la
|
||||
|
||||
libloader_la_LIBADD += \
|
||||
-lm \
|
||||
$(EXPAT_LIBS)
|
||||
endif
|
||||
|
||||
if !HAVE_LIBDRM
|
||||
|
@@ -60,6 +60,7 @@ mesa_dri_drivers_la_LIBADD = \
|
||||
../../libmesa.la \
|
||||
common/libmegadriver_stub.la \
|
||||
common/libdricommon.la \
|
||||
common/libxmlconfig.la \
|
||||
$(MEGADRIVERS_DEPS) \
|
||||
$(DRI_LIB_DEPS) \
|
||||
$()
|
||||
|
@@ -47,7 +47,9 @@ else
|
||||
LOCAL_SHARED_LIBRARIES := libdrm
|
||||
endif
|
||||
|
||||
LOCAL_SRC_FILES := $(DRI_COMMON_FILES)
|
||||
LOCAL_SRC_FILES := \
|
||||
$(DRI_COMMON_FILES) \
|
||||
$(XMLCONFIG_FILES)
|
||||
|
||||
LOCAL_GENERATED_SOURCES := \
|
||||
$(intermediates)/xmlpool/options.h
|
||||
|
@@ -31,16 +31,20 @@ AM_CFLAGS = \
|
||||
-I$(top_srcdir)/src/mapi \
|
||||
-I$(top_srcdir)/src/mesa/ \
|
||||
$(DEFINES) \
|
||||
$(EXPAT_CFLAGS) \
|
||||
$(VISIBILITY_CFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = \
|
||||
libdricommon.la \
|
||||
libxmlconfig.la \
|
||||
libmegadriver_stub.la \
|
||||
libdri_test_stubs.la
|
||||
|
||||
libdricommon_la_SOURCES = $(DRI_COMMON_FILES)
|
||||
|
||||
libxmlconfig_la_SOURCES = $(XMLCONFIG_FILES)
|
||||
libxmlconfig_la_CFLAGS = $(AM_CFLAGS) $(EXPAT_CFLAGS)
|
||||
libxmlconfig_la_LIBADD = $(EXPAT_LIBS) -lm
|
||||
|
||||
libdri_test_stubs_la_SOURCES = $(test_stubs_FILES)
|
||||
libdri_test_stubs_la_CFLAGS = $(AM_CFLAGS) -DNO_MAIN
|
||||
|
||||
|
@@ -2,7 +2,9 @@ DRI_COMMON_FILES := \
|
||||
utils.c \
|
||||
utils.h \
|
||||
dri_util.c \
|
||||
dri_util.h \
|
||||
dri_util.h
|
||||
|
||||
XMLCONFIG_FILES := \
|
||||
xmlconfig.c \
|
||||
xmlconfig.h
|
||||
|
||||
|
@@ -37,7 +37,7 @@ drienv.PkgUseModules('DRM')
|
||||
# else
|
||||
#env.Append(CPPDEFINES = ['__NOT_HAVE_DRM_H'])
|
||||
|
||||
sources = drienv.ParseSourceList('Makefile.sources', 'DRI_COMMON_FILES')
|
||||
sources = drienv.ParseSourceList('Makefile.sources', ['DRI_COMMON_FILES', 'XMLCONFIG_FILES' ])
|
||||
|
||||
dri_common = drienv.ConvenienceLibrary(
|
||||
target = 'dri_common',
|
||||
|
@@ -255,6 +255,8 @@ i915CreateContext(int api,
|
||||
* FINISHME: vertex shaders?
|
||||
*/
|
||||
ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitCondCodes = true;
|
||||
ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitNoIndirectSampler =
|
||||
true;
|
||||
|
||||
struct gl_shader_compiler_options *const fs_options =
|
||||
& ctx->Const.ShaderCompilerOptions[MESA_SHADER_FRAGMENT];
|
||||
@@ -266,6 +268,7 @@ i915CreateContext(int api,
|
||||
fs_options->EmitNoIndirectOutput = true;
|
||||
fs_options->EmitNoIndirectUniform = true;
|
||||
fs_options->EmitNoIndirectTemp = true;
|
||||
fs_options->EmitNoIndirectSampler = true;
|
||||
|
||||
ctx->Const.MaxDrawBuffers = 1;
|
||||
ctx->Const.QueryCounterBits.SamplesPassed = 0;
|
||||
|
@@ -46,6 +46,7 @@ libi965_dri_la_LIBADD = $(INTEL_LIBS)
|
||||
TEST_LIBS = \
|
||||
libi965_dri.la \
|
||||
../common/libdricommon.la \
|
||||
../common/libxmlconfig.la \
|
||||
../common/libmegadriver_stub.la \
|
||||
../../../libmesa.la \
|
||||
$(DRI_LIB_DEPS) \
|
||||
|
@@ -562,6 +562,10 @@ brw_initialize_context_constants(struct brw_context *brw)
|
||||
(i == MESA_SHADER_FRAGMENT);
|
||||
ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectUniform = false;
|
||||
ctx->Const.ShaderCompilerOptions[i].LowerClipDistance = true;
|
||||
|
||||
/* !ARB_gpu_shader5 */
|
||||
if (brw->gen < 7)
|
||||
ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectSampler = true;
|
||||
}
|
||||
|
||||
ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = true;
|
||||
|
@@ -842,12 +842,68 @@ set_3src_source_index(struct brw_context *brw, brw_compact_inst *dst, brw_inst *
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
has_unmapped_bits(struct brw_context *brw, brw_inst *src)
|
||||
{
|
||||
/* EOT can only be mapped on a send if the src1 is an immediate */
|
||||
if ((brw_inst_opcode(brw, src) == BRW_OPCODE_SENDC ||
|
||||
brw_inst_opcode(brw, src) == BRW_OPCODE_SEND) &&
|
||||
brw_inst_eot(brw, src))
|
||||
return true;
|
||||
|
||||
/* Check for instruction bits that don't map to any of the fields of the
|
||||
* compacted instruction. The instruction cannot be compacted if any of
|
||||
* them are set. They overlap with:
|
||||
* - NibCtrl (bit 47 on Gen7, bit 11 on Gen8)
|
||||
* - Dst.AddrImm[9] (bit 47 on Gen8)
|
||||
* - Src0.AddrImm[9] (bit 95 on Gen8)
|
||||
* - Imm64[27:31] (bits 91-95 on Gen7, bit 95 on Gen8)
|
||||
* - UIP[31] (bit 95 on Gen8)
|
||||
*/
|
||||
if (brw->gen >= 8) {
|
||||
assert(!brw_inst_bits(src, 7, 7));
|
||||
return brw_inst_bits(src, 95, 95) ||
|
||||
brw_inst_bits(src, 47, 47) ||
|
||||
brw_inst_bits(src, 11, 11);
|
||||
} else {
|
||||
assert(!brw_inst_bits(src, 7, 7) &&
|
||||
!(brw->gen < 7 && brw_inst_bits(src, 90, 90)));
|
||||
return brw_inst_bits(src, 95, 91) ||
|
||||
brw_inst_bits(src, 47, 47);
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
has_3src_unmapped_bits(struct brw_context *brw, brw_inst *src)
|
||||
{
|
||||
/* Check for three-source instruction bits that don't map to any of the
|
||||
* fields of the compacted instruction. All of them seem to be reserved
|
||||
* bits currently.
|
||||
*/
|
||||
if (brw->gen >= 9 || brw->is_cherryview) {
|
||||
assert(!brw_inst_bits(src, 127, 127) &&
|
||||
!brw_inst_bits(src, 7, 7));
|
||||
} else {
|
||||
assert(brw->gen >= 8);
|
||||
assert(!brw_inst_bits(src, 127, 126) &&
|
||||
!brw_inst_bits(src, 105, 105) &&
|
||||
!brw_inst_bits(src, 84, 84) &&
|
||||
!brw_inst_bits(src, 36, 35) &&
|
||||
!brw_inst_bits(src, 7, 7));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
brw_try_compact_3src_instruction(struct brw_context *brw, brw_compact_inst *dst,
|
||||
brw_inst *src)
|
||||
{
|
||||
assert(brw->gen >= 8);
|
||||
|
||||
if (has_3src_unmapped_bits(brw, src))
|
||||
return false;
|
||||
|
||||
#define compact(field) \
|
||||
brw_compact_inst_set_3src_##field(dst, brw_inst_3src_##field(brw, src))
|
||||
|
||||
@@ -937,6 +993,9 @@ brw_try_compact_instruction(struct brw_context *brw, brw_compact_inst *dst,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (has_unmapped_bits(brw, src))
|
||||
return false;
|
||||
|
||||
memset(&temp, 0, sizeof(temp));
|
||||
|
||||
brw_compact_inst_set_opcode(&temp, brw_inst_opcode(brw, src));
|
||||
|
@@ -1036,7 +1036,7 @@ fs_visitor::implied_mrf_writes(fs_inst *inst)
|
||||
case FS_OPCODE_VARYING_PULL_CONSTANT_LOAD:
|
||||
return inst->mlen;
|
||||
case SHADER_OPCODE_GEN4_SCRATCH_WRITE:
|
||||
return 2;
|
||||
return inst->mlen;
|
||||
case SHADER_OPCODE_UNTYPED_ATOMIC:
|
||||
case SHADER_OPCODE_UNTYPED_SURFACE_READ:
|
||||
case SHADER_OPCODE_URB_WRITE_SIMD8:
|
||||
@@ -3039,7 +3039,7 @@ fs_visitor::lower_uniform_pull_constant_loads()
|
||||
assert(const_offset_reg.file == IMM &&
|
||||
const_offset_reg.type == BRW_REGISTER_TYPE_UD);
|
||||
const_offset_reg.fixed_hw_reg.dw1.ud /= 4;
|
||||
fs_reg payload = vgrf(glsl_type::uint_type);
|
||||
fs_reg payload = fs_reg(GRF, virtual_grf_alloc(1));
|
||||
|
||||
/* We have to use a message header on Skylake to get SIMD4x2 mode.
|
||||
* Reserve space for the register.
|
||||
|
@@ -435,7 +435,8 @@ public:
|
||||
void setup_payload_interference(struct ra_graph *g, int payload_reg_count,
|
||||
int first_payload_node);
|
||||
void setup_mrf_hack_interference(struct ra_graph *g,
|
||||
int first_mrf_hack_node);
|
||||
int first_mrf_hack_node,
|
||||
int *first_used_mrf);
|
||||
int choose_spill_reg(struct ra_graph *g);
|
||||
void spill_reg(int spill_reg);
|
||||
void split_virtual_grfs();
|
||||
|
@@ -498,11 +498,13 @@ fs_visitor::get_used_mrfs(bool *mrf_used)
|
||||
* messages (treated as MRFs in code generation).
|
||||
*/
|
||||
void
|
||||
fs_visitor::setup_mrf_hack_interference(struct ra_graph *g, int first_mrf_node)
|
||||
fs_visitor::setup_mrf_hack_interference(struct ra_graph *g, int first_mrf_node,
|
||||
int *first_used_mrf)
|
||||
{
|
||||
bool mrf_used[BRW_MAX_MRF];
|
||||
get_used_mrfs(mrf_used);
|
||||
|
||||
*first_used_mrf = BRW_MAX_MRF;
|
||||
for (int i = 0; i < BRW_MAX_MRF; i++) {
|
||||
/* Mark each MRF reg node as being allocated to its physical register.
|
||||
*
|
||||
@@ -515,6 +517,9 @@ fs_visitor::setup_mrf_hack_interference(struct ra_graph *g, int first_mrf_node)
|
||||
* that are used as conflicting with all virtual GRFs.
|
||||
*/
|
||||
if (mrf_used[i]) {
|
||||
if (i < *first_used_mrf)
|
||||
*first_used_mrf = i;
|
||||
|
||||
for (int j = 0; j < this->virtual_grf_count; j++) {
|
||||
ra_add_node_interference(g, first_mrf_node + i, j);
|
||||
}
|
||||
@@ -581,7 +586,8 @@ fs_visitor::assign_regs(bool allow_spilling)
|
||||
|
||||
setup_payload_interference(g, payload_node_count, first_payload_node);
|
||||
if (brw->gen >= 7) {
|
||||
setup_mrf_hack_interference(g, first_mrf_hack_node);
|
||||
int first_used_mrf = BRW_MAX_MRF;
|
||||
setup_mrf_hack_interference(g, first_mrf_hack_node, &first_used_mrf);
|
||||
|
||||
foreach_block_and_inst(block, fs_inst, inst, cfg) {
|
||||
/* When we do send-from-GRF for FB writes, we need to ensure that
|
||||
@@ -597,6 +603,13 @@ fs_visitor::assign_regs(bool allow_spilling)
|
||||
if (inst->eot) {
|
||||
int size = virtual_grf_sizes[inst->src[0].reg];
|
||||
int reg = screen->wm_reg_sets[rsi].class_to_ra_reg_range[size] - 1;
|
||||
|
||||
/* If something happened to spill, we want to push the EOT send
|
||||
* register early enough in the register file that we don't
|
||||
* conflict with any used MRF hack registers.
|
||||
*/
|
||||
reg -= BRW_MAX_MRF - first_used_mrf;
|
||||
|
||||
ra_set_node_reg(g, inst->src[0].reg, reg);
|
||||
break;
|
||||
}
|
||||
|
@@ -43,20 +43,54 @@ gen7_upload_constant_state(struct brw_context *brw,
|
||||
int dwords = brw->gen >= 8 ? 11 : 7;
|
||||
BEGIN_BATCH(dwords);
|
||||
OUT_BATCH(opcode << 16 | (dwords - 2));
|
||||
OUT_BATCH(active ? stage_state->push_const_size : 0);
|
||||
OUT_BATCH(0);
|
||||
|
||||
/* Workaround for SKL+ (we use option #2 until we have a need for more
|
||||
* constant buffers). This comes from the documentation for 3DSTATE_CONSTANT_*
|
||||
*
|
||||
* The driver must ensure The following case does not occur without a flush
|
||||
* to the 3D engine: 3DSTATE_CONSTANT_* with buffer 3 read length equal to
|
||||
* zero committed followed by a 3DSTATE_CONSTANT_* with buffer 0 read length
|
||||
* not equal to zero committed. Possible ways to avoid this condition
|
||||
* include:
|
||||
* 1. always force buffer 3 to have a non zero read length
|
||||
* 2. always force buffer 0 to a zero read length
|
||||
*/
|
||||
if (brw->gen >= 9 && active) {
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(stage_state->push_const_size);
|
||||
} else {
|
||||
OUT_BATCH(active ? stage_state->push_const_size : 0);
|
||||
OUT_BATCH(0);
|
||||
}
|
||||
/* Pointer to the constant buffer. Covered by the set of state flags
|
||||
* from gen6_prepare_wm_contants
|
||||
*/
|
||||
OUT_BATCH(active ? (stage_state->push_const_offset | mocs) : 0);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
if (brw->gen >= 8) {
|
||||
if (brw->gen >= 9 && active) {
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
/* XXX: When using buffers other than 0, you need to specify the
|
||||
* graphics virtual address regardless of INSPM/debug bits
|
||||
*/
|
||||
OUT_RELOC64(brw->batch.bo, I915_GEM_DOMAIN_RENDER, 0,
|
||||
stage_state->push_const_offset);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
} else if (brw->gen>= 8) {
|
||||
OUT_BATCH(active ? (stage_state->push_const_offset | mocs) : 0);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
} else {
|
||||
OUT_BATCH(active ? (stage_state->push_const_offset | mocs) : 0);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
}
|
||||
|
||||
ADVANCE_BATCH();
|
||||
|
@@ -412,6 +412,16 @@ gen8_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
|
||||
uint32_t surface_width = ALIGN(mt->logical_width0, level == 0 ? 8 : 1);
|
||||
uint32_t surface_height = ALIGN(mt->logical_height0, level == 0 ? 4 : 1);
|
||||
|
||||
/* From the documentation for 3DSTATE_WM_HZ_OP: "3DSTATE_MULTISAMPLE packet
|
||||
* must be used prior to this packet to change the Number of Multisamples.
|
||||
* This packet must not be used to change Number of Multisamples in a
|
||||
* rendering sequence."
|
||||
*/
|
||||
if (brw->num_samples != mt->num_samples) {
|
||||
gen8_emit_3dstate_multisample(brw, mt->num_samples);
|
||||
brw->NewGLState |= _NEW_MULTISAMPLE;
|
||||
}
|
||||
|
||||
/* The basic algorithm is:
|
||||
* - If needed, emit 3DSTATE_{DEPTH,HIER_DEPTH,STENCIL}_BUFFER and
|
||||
* 3DSTATE_CLEAR_PARAMS packets to set up the relevant buffers.
|
||||
|
@@ -130,6 +130,40 @@ set_blitter_tiling(struct brw_context *brw,
|
||||
ADVANCE_BATCH(); \
|
||||
} while (0)
|
||||
|
||||
static int
|
||||
blt_pitch(struct intel_mipmap_tree *mt)
|
||||
{
|
||||
int pitch = mt->pitch;
|
||||
if (mt->tiling)
|
||||
pitch /= 4;
|
||||
return pitch;
|
||||
}
|
||||
|
||||
bool
|
||||
intel_miptree_blit_compatible_formats(mesa_format src, mesa_format dst)
|
||||
{
|
||||
/* The BLT doesn't handle sRGB conversion */
|
||||
assert(src == _mesa_get_srgb_format_linear(src));
|
||||
assert(dst == _mesa_get_srgb_format_linear(dst));
|
||||
|
||||
/* No swizzle or format conversions possible, except... */
|
||||
if (src == dst)
|
||||
return true;
|
||||
|
||||
/* ...we can either discard the alpha channel when going from A->X,
|
||||
* or we can fill the alpha channel with 0xff when going from X->A
|
||||
*/
|
||||
if (src == MESA_FORMAT_B8G8R8A8_UNORM || src == MESA_FORMAT_B8G8R8X8_UNORM)
|
||||
return (dst == MESA_FORMAT_B8G8R8A8_UNORM ||
|
||||
dst == MESA_FORMAT_B8G8R8X8_UNORM);
|
||||
|
||||
if (src == MESA_FORMAT_R8G8B8A8_UNORM || src == MESA_FORMAT_R8G8B8X8_UNORM)
|
||||
return (dst == MESA_FORMAT_R8G8B8A8_UNORM ||
|
||||
dst == MESA_FORMAT_R8G8B8X8_UNORM);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements a rectangular block transfer (blit) of pixels between two
|
||||
* miptrees.
|
||||
@@ -172,11 +206,7 @@ intel_miptree_blit(struct brw_context *brw,
|
||||
* the X channel don't matter), and XRGB8888 to ARGB8888 by setting the A
|
||||
* channel to 1.0 at the end.
|
||||
*/
|
||||
if (src_format != dst_format &&
|
||||
((src_format != MESA_FORMAT_B8G8R8A8_UNORM &&
|
||||
src_format != MESA_FORMAT_B8G8R8X8_UNORM) ||
|
||||
(dst_format != MESA_FORMAT_B8G8R8A8_UNORM &&
|
||||
dst_format != MESA_FORMAT_B8G8R8X8_UNORM))) {
|
||||
if (!intel_miptree_blit_compatible_formats(src_format, dst_format)) {
|
||||
perf_debug("%s: Can't use hardware blitter from %s to %s, "
|
||||
"falling back.\n", __FUNCTION__,
|
||||
_mesa_get_format_name(src_format),
|
||||
@@ -197,14 +227,14 @@ intel_miptree_blit(struct brw_context *brw,
|
||||
*
|
||||
* Furthermore, intelEmitCopyBlit (which is called below) uses a signed
|
||||
* 16-bit integer to represent buffer pitch, so it can only handle buffer
|
||||
* pitches < 32k.
|
||||
* pitches < 32k. However, the pitch is measured in bytes for linear buffers
|
||||
* and dwords for tiled buffers.
|
||||
*
|
||||
* As a result of these two limitations, we can only use the blitter to do
|
||||
* this copy when the miptree's pitch is less than 32k.
|
||||
* this copy when the miptree's pitch is less than 32k linear or 128k tiled.
|
||||
*/
|
||||
if (src_mt->pitch >= 32768 ||
|
||||
dst_mt->pitch >= 32768) {
|
||||
perf_debug("Falling back due to >=32k pitch\n");
|
||||
if (blt_pitch(src_mt) >= 32768 || blt_pitch(dst_mt) >= 32768) {
|
||||
perf_debug("Falling back due to >= 32k/128k pitch\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -261,8 +291,9 @@ intel_miptree_blit(struct brw_context *brw,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (src_mt->format == MESA_FORMAT_B8G8R8X8_UNORM &&
|
||||
dst_mt->format == MESA_FORMAT_B8G8R8A8_UNORM) {
|
||||
/* XXX This could be done in a single pass using XY_FULL_MONO_PATTERN_BLT */
|
||||
if (_mesa_get_format_bits(src_format, GL_ALPHA_BITS) == 0 &&
|
||||
_mesa_get_format_bits(dst_format, GL_ALPHA_BITS) > 0) {
|
||||
intel_miptree_set_alpha_to_one(brw, dst_mt,
|
||||
dst_x, dst_y,
|
||||
width, height);
|
||||
|
@@ -46,6 +46,8 @@ intelEmitCopyBlit(struct brw_context *brw,
|
||||
GLshort w, GLshort h,
|
||||
GLenum logicop );
|
||||
|
||||
bool intel_miptree_blit_compatible_formats(mesa_format src, mesa_format dst);
|
||||
|
||||
bool intel_miptree_blit(struct brw_context *brw,
|
||||
struct intel_mipmap_tree *src_mt,
|
||||
int src_level, int src_slice,
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include "main/glheader.h"
|
||||
#include "main/enums.h"
|
||||
#include "main/image.h"
|
||||
#include "main/glformats.h"
|
||||
#include "main/mtypes.h"
|
||||
#include "main/condrender.h"
|
||||
#include "main/fbobject.h"
|
||||
@@ -76,8 +77,14 @@ do_blit_drawpixels(struct gl_context * ctx,
|
||||
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
|
||||
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
|
||||
|
||||
if (!_mesa_format_matches_format_and_type(irb->mt->format, format, type,
|
||||
false)) {
|
||||
mesa_format src_format = _mesa_format_from_format_and_type(format, type);
|
||||
mesa_format dst_format = irb->mt->format;
|
||||
|
||||
/* We can safely discard sRGB encode/decode for the DrawPixels interface */
|
||||
src_format = _mesa_get_srgb_format_linear(src_format);
|
||||
dst_format = _mesa_get_srgb_format_linear(dst_format);
|
||||
|
||||
if (!intel_miptree_blit_compatible_formats(src_format, dst_format)) {
|
||||
DBG("%s: bad format for blit\n", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
@@ -2955,6 +2955,8 @@ struct gl_pipeline_object
|
||||
|
||||
mtx_t Mutex;
|
||||
|
||||
GLchar *Label; /**< GL_KHR_debug */
|
||||
|
||||
/**
|
||||
* Programs used for rendering
|
||||
*
|
||||
@@ -3019,6 +3021,7 @@ struct gl_shader_compiler_options
|
||||
GLboolean EmitNoIndirectOutput; /**< No indirect addressing of outputs */
|
||||
GLboolean EmitNoIndirectTemp; /**< No indirect addressing of temps */
|
||||
GLboolean EmitNoIndirectUniform; /**< No indirect addressing of constants */
|
||||
GLboolean EmitNoIndirectSampler; /**< No indirect addressing of samplers */
|
||||
/*@}*/
|
||||
|
||||
GLuint MaxIfDepth; /**< Maximum nested IF blocks */
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "enums.h"
|
||||
#include "fbobject.h"
|
||||
#include "objectlabel.h"
|
||||
#include "pipelineobj.h"
|
||||
#include "queryobj.h"
|
||||
#include "samplerobj.h"
|
||||
#include "shaderobj.h"
|
||||
@@ -214,8 +215,13 @@ get_label_pointer(struct gl_context *ctx, GLenum identifier, GLuint name,
|
||||
}
|
||||
break;
|
||||
case GL_PROGRAM_PIPELINE:
|
||||
/* requires GL 4.2 */
|
||||
goto invalid_enum;
|
||||
{
|
||||
struct gl_pipeline_object *pipe =
|
||||
_mesa_lookup_pipeline_object(ctx, name);
|
||||
if (pipe)
|
||||
labelPtr = &pipe->Label;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
goto invalid_enum;
|
||||
}
|
||||
|
@@ -65,6 +65,7 @@ _mesa_delete_pipeline_object(struct gl_context *ctx,
|
||||
|
||||
_mesa_reference_shader_program(ctx, &obj->ActiveProgram, NULL);
|
||||
mtx_destroy(&obj->Mutex);
|
||||
free(obj->Label);
|
||||
ralloc_free(obj);
|
||||
}
|
||||
|
||||
@@ -136,8 +137,8 @@ _mesa_free_pipeline_data(struct gl_context *ctx)
|
||||
* a non-existent ID. The spec defines ID 0 as being technically
|
||||
* non-existent.
|
||||
*/
|
||||
static inline struct gl_pipeline_object *
|
||||
lookup_pipeline_object(struct gl_context *ctx, GLuint id)
|
||||
struct gl_pipeline_object *
|
||||
_mesa_lookup_pipeline_object(struct gl_context *ctx, GLuint id)
|
||||
{
|
||||
if (id == 0)
|
||||
return NULL;
|
||||
@@ -225,7 +226,7 @@ _mesa_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
struct gl_pipeline_object *pipe = lookup_pipeline_object(ctx, pipeline);
|
||||
struct gl_pipeline_object *pipe = _mesa_lookup_pipeline_object(ctx, pipeline);
|
||||
struct gl_shader_program *shProg = NULL;
|
||||
GLbitfield any_valid_stages;
|
||||
|
||||
@@ -337,7 +338,7 @@ _mesa_ActiveShaderProgram(GLuint pipeline, GLuint program)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_shader_program *shProg = NULL;
|
||||
struct gl_pipeline_object *pipe = lookup_pipeline_object(ctx, pipeline);
|
||||
struct gl_pipeline_object *pipe = _mesa_lookup_pipeline_object(ctx, pipeline);
|
||||
|
||||
if (program != 0) {
|
||||
shProg = _mesa_lookup_shader_program_err(ctx, program,
|
||||
@@ -399,7 +400,7 @@ _mesa_BindProgramPipeline(GLuint pipeline)
|
||||
*/
|
||||
if (pipeline) {
|
||||
/* non-default pipeline object */
|
||||
newObj = lookup_pipeline_object(ctx, pipeline);
|
||||
newObj = _mesa_lookup_pipeline_object(ctx, pipeline);
|
||||
if (!newObj) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glBindProgramPipeline(non-gen name)");
|
||||
@@ -468,7 +469,7 @@ _mesa_DeleteProgramPipelines(GLsizei n, const GLuint *pipelines)
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
struct gl_pipeline_object *obj =
|
||||
lookup_pipeline_object(ctx, pipelines[i]);
|
||||
_mesa_lookup_pipeline_object(ctx, pipelines[i]);
|
||||
|
||||
if (obj) {
|
||||
ASSERT(obj->Name == pipelines[i]);
|
||||
@@ -545,7 +546,7 @@ _mesa_IsProgramPipeline(GLuint pipeline)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
struct gl_pipeline_object *obj = lookup_pipeline_object(ctx, pipeline);
|
||||
struct gl_pipeline_object *obj = _mesa_lookup_pipeline_object(ctx, pipeline);
|
||||
if (obj == NULL)
|
||||
return GL_FALSE;
|
||||
|
||||
@@ -559,7 +560,7 @@ void GLAPIENTRY
|
||||
_mesa_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_pipeline_object *pipe = lookup_pipeline_object(ctx, pipeline);
|
||||
struct gl_pipeline_object *pipe = _mesa_lookup_pipeline_object(ctx, pipeline);
|
||||
|
||||
/* Are geometry shaders available in this context?
|
||||
*/
|
||||
@@ -797,7 +798,7 @@ _mesa_ValidateProgramPipeline(GLuint pipeline)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
struct gl_pipeline_object *pipe = lookup_pipeline_object(ctx, pipeline);
|
||||
struct gl_pipeline_object *pipe = _mesa_lookup_pipeline_object(ctx, pipeline);
|
||||
|
||||
if (!pipe) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
@@ -815,7 +816,7 @@ _mesa_GetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
struct gl_pipeline_object *pipe = lookup_pipeline_object(ctx, pipeline);
|
||||
struct gl_pipeline_object *pipe = _mesa_lookup_pipeline_object(ctx, pipeline);
|
||||
|
||||
if (!pipe) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||
|
@@ -45,6 +45,9 @@ _mesa_init_pipeline(struct gl_context *ctx);
|
||||
extern void
|
||||
_mesa_free_pipeline_data(struct gl_context *ctx);
|
||||
|
||||
extern struct gl_pipeline_object *
|
||||
_mesa_lookup_pipeline_object(struct gl_context *ctx, GLuint id);
|
||||
|
||||
extern void
|
||||
_mesa_reference_pipeline_object_(struct gl_context *ctx,
|
||||
struct gl_pipeline_object **ptr,
|
||||
|
@@ -276,6 +276,11 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
|
||||
/* For vertex shaders, make sure not to emit saturate when SM 3.0 is not supported */
|
||||
ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitNoSat = !st->has_shader_model3;
|
||||
|
||||
if (!ctx->Extensions.ARB_gpu_shader5) {
|
||||
for (i = 0; i < MESA_SHADER_STAGES; i++)
|
||||
ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectSampler = true;
|
||||
}
|
||||
|
||||
_mesa_compute_version(ctx);
|
||||
|
||||
if (ctx->Version == 0) {
|
||||
|
@@ -5339,6 +5339,7 @@ get_mesa_program(struct gl_context *ctx,
|
||||
*/
|
||||
_mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters);
|
||||
if (!shader_program->LinkStatus) {
|
||||
free_glsl_to_tgsi_visitor(v);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user