<feed xmlns='http://www.w3.org/2005/Atom'>
<title>external_mesa3d/src/mesa/main, branch replicant-6.0</title>
<subtitle>external/mesa3d
</subtitle>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/external_mesa3d/'/>
<entry>
<title>Merge remote-tracking branch 'mesa/13.0' into nougat-x86</title>
<updated>2017-01-08T16:30:27+00:00</updated>
<author>
<name>Chih-Wei Huang</name>
<email>cwhuang@linux.org.tw</email>
</author>
<published>2017-01-08T16:30:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/external_mesa3d/commit/?id=e123ad753c152491c07a5cc6d346f62624b07949'/>
<id>e123ad753c152491c07a5cc6d346f62624b07949</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>mesa/fbobject: Update CubeMapFace when reusing textures</title>
<updated>2016-12-16T12:01:23+00:00</updated>
<author>
<name>Nanley Chery</name>
<email>nanley.g.chery@intel.com</email>
</author>
<published>2016-11-16T00:42:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/external_mesa3d/commit/?id=63bdcc5c88441c4226d3717a5fb51e01b144bc2f'/>
<id>63bdcc5c88441c4226d3717a5fb51e01b144bc2f</id>
<content type='text'>
Framebuffer attachments can be specified through FramebufferTexture*
calls. Upon specifying a depth (or stencil) framebuffer attachment that
internally reuses a texture, the cube map face of the new attachment
would not be updated (defaulting to TEXTURE_CUBE_MAP_POSITIVE_X).
Fix this issue by actually updating the CubeMapFace field.

This bug manifested itself in BindFramebuffer calls performed on
framebuffers whose stencil attachments internally reused a depth
texture.  When binding a framebuffer, we walk through the framebuffer's
attachments and update each one's corresponding gl_renderbuffer. Since
the framebuffer's depth and stencil attachments may share a
gl_renderbuffer and the walk visits the stencil attachment after
the depth attachment, the uninitialized CubeMapFace forced rendering
to TEXTURE_CUBE_MAP_POSITIVE_X.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77662
Signed-off-by: Nanley Chery &lt;nanley.g.chery@intel.com&gt;
Reviewed-by: Brian Paul &lt;brianp@vmware.com&gt;
(cherry picked from commit 63318d34acd4a5edb271d57adf3b01e2e52552f8)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Framebuffer attachments can be specified through FramebufferTexture*
calls. Upon specifying a depth (or stencil) framebuffer attachment that
internally reuses a texture, the cube map face of the new attachment
would not be updated (defaulting to TEXTURE_CUBE_MAP_POSITIVE_X).
Fix this issue by actually updating the CubeMapFace field.

This bug manifested itself in BindFramebuffer calls performed on
framebuffers whose stencil attachments internally reused a depth
texture.  When binding a framebuffer, we walk through the framebuffer's
attachments and update each one's corresponding gl_renderbuffer. Since
the framebuffer's depth and stencil attachments may share a
gl_renderbuffer and the walk visits the stencil attachment after
the depth attachment, the uninitialized CubeMapFace forced rendering
to TEXTURE_CUBE_MAP_POSITIVE_X.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77662
Signed-off-by: Nanley Chery &lt;nanley.g.chery@intel.com&gt;
Reviewed-by: Brian Paul &lt;brianp@vmware.com&gt;
(cherry picked from commit 63318d34acd4a5edb271d57adf3b01e2e52552f8)
</pre>
</div>
</content>
</entry>
<entry>
<title>mesa: only verify that enabled arrays have backing buffers</title>
<updated>2016-12-14T19:03:11+00:00</updated>
<author>
<name>Ilia Mirkin</name>
<email>imirkin@alum.mit.edu</email>
</author>
<published>2016-11-30T22:04:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/external_mesa3d/commit/?id=69a4fa0c357be8dd36ae1464f43cd8ab8b4ad46e'/>
<id>69a4fa0c357be8dd36ae1464f43cd8ab8b4ad46e</id>
<content type='text'>
We were previously also verifying that no backing buffers were available
when an array wasn't enabled. This is has no basis in the spec, and it
causes GLupeN64 to fail as a result.

Fixes: c2e146f487 ("mesa: error out in indirect draw when vertex bindings mismatch")
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Ilia Mirkin &lt;imirkin@alum.mit.edu&gt;
Reviewed-by: Timothy Arceri &lt;timothy.arceri@collabora.com&gt;
Reviewed-by: Tapani Pälli &lt;tapani.palli@intel.com&gt;
(cherry picked from commit 7c16552f8dcc869b14cf7ef443a1b5de83b07973)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We were previously also verifying that no backing buffers were available
when an array wasn't enabled. This is has no basis in the spec, and it
causes GLupeN64 to fail as a result.

Fixes: c2e146f487 ("mesa: error out in indirect draw when vertex bindings mismatch")
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Ilia Mirkin &lt;imirkin@alum.mit.edu&gt;
Reviewed-by: Timothy Arceri &lt;timothy.arceri@collabora.com&gt;
Reviewed-by: Tapani Pälli &lt;tapani.palli@intel.com&gt;
(cherry picked from commit 7c16552f8dcc869b14cf7ef443a1b5de83b07973)
</pre>
</div>
</content>
</entry>
<entry>
<title>mesa: fix active subroutine uniforms properly</title>
<updated>2016-12-14T19:03:10+00:00</updated>
<author>
<name>Timothy Arceri</name>
<email>timothy.arceri@collabora.com</email>
</author>
<published>2016-11-26T23:31:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/external_mesa3d/commit/?id=7f2ee55aacaf1aae80d276ef9b7a0b12cc1c71f1'/>
<id>7f2ee55aacaf1aae80d276ef9b7a0b12cc1c71f1</id>
<content type='text'>
07fe2d565b introduced a big hack in order to return
NumSubroutineUniforms when querying ACTIVE_RESOURCES for
&lt;shader&gt;_SUBROUTINE_UNIFORM interfaces. However this is the
wrong fix we are meant to be returning the number of active
resources i.e. the count of subroutine uniforms in the
resource list which is what the code was previously doing,
anything else will cause trouble when trying to retrieve
the resource properties based on the ACTIVE_RESOURCES count.

The real problem is that NumSubroutineUniforms was counting
array elements as separate uniforms but the innermost array
is always considered a single uniform so we fix that count
instead which was counted incorrectly in 7fa0250f9.

Idealy we could probably completely remove
NumSubroutineUniforms and just compute its value when needed
from the resource list but this works for now.

Reviewed-by: Alejandro Piñeiro &lt;apinheiro@igalia.com&gt;
Reviewed-by: Tapani Pälli &lt;tapani.palli@intel.com&gt;
Cc: 13.0 &lt;mesa-stable@lists.freedesktop.org&gt;
(cherry picked from commit 0303201dfb73c16751d5519cca7480fa678d429a)
[Emil Velikov: LinkStatus is in gl_shader_program]
Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;

Conflicts:
	src/mesa/main/program_resource.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
07fe2d565b introduced a big hack in order to return
NumSubroutineUniforms when querying ACTIVE_RESOURCES for
&lt;shader&gt;_SUBROUTINE_UNIFORM interfaces. However this is the
wrong fix we are meant to be returning the number of active
resources i.e. the count of subroutine uniforms in the
resource list which is what the code was previously doing,
anything else will cause trouble when trying to retrieve
the resource properties based on the ACTIVE_RESOURCES count.

The real problem is that NumSubroutineUniforms was counting
array elements as separate uniforms but the innermost array
is always considered a single uniform so we fix that count
instead which was counted incorrectly in 7fa0250f9.

Idealy we could probably completely remove
NumSubroutineUniforms and just compute its value when needed
from the resource list but this works for now.

Reviewed-by: Alejandro Piñeiro &lt;apinheiro@igalia.com&gt;
Reviewed-by: Tapani Pälli &lt;tapani.palli@intel.com&gt;
Cc: 13.0 &lt;mesa-stable@lists.freedesktop.org&gt;
(cherry picked from commit 0303201dfb73c16751d5519cca7480fa678d429a)
[Emil Velikov: LinkStatus is in gl_shader_program]
Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;

Conflicts:
	src/mesa/main/program_resource.c
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'mesa/13.0' into nougat-x86</title>
<updated>2016-11-25T04:05:07+00:00</updated>
<author>
<name>Chih-Wei Huang</name>
<email>cwhuang@linux.org.tw</email>
</author>
<published>2016-11-25T04:05:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/external_mesa3d/commit/?id=524121d42bfdf8c1bd3565bd2adb0ffd7b52713f'/>
<id>524121d42bfdf8c1bd3565bd2adb0ffd7b52713f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>mesa: fix empty program log length</title>
<updated>2016-11-24T16:34:41+00:00</updated>
<author>
<name>Tapani Pälli</name>
<email>tapani.palli@intel.com</email>
</author>
<published>2016-08-17T07:37:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/external_mesa3d/commit/?id=8691daef62d3a40014757426c3f25960095b8d3c'/>
<id>8691daef62d3a40014757426c3f25960095b8d3c</id>
<content type='text'>
In case we have empty log (""), we should return 0. This fixes
Khronos WebGL conformance test 'program-infolog'.

From OpenGL ES 3.1 (and OpenGL 4.5 Core) spec:
   "If pname is INFO_LOG_LENGTH , the length of the info log, including
    a null terminator, is returned. If there is no info log, zero is
    returned."

v2: apply same fix for get_shaderiv and _mesa_GetProgramPipelineiv (Ian)

Signed-off-by: Tapani Pälli &lt;tapani.palli@intel.com&gt;
Reviewed-by: Iago Toral Quiroga &lt;itoral@igalia.com&gt; (v1)
Reviewed-by: Ian Romanick &lt;ian.d.romanick@intel.com&gt;
Reviewed-by: Nicolai Hähnle &lt;nicolai.haehnle@amd.com&gt;
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97321
Cc: "13.0" &lt;mesa-stable@lists.freedesktop.org&gt;
(cherry picked from commit ec4e71f75e9b8a1c427994efa32a61593e3172f9)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In case we have empty log (""), we should return 0. This fixes
Khronos WebGL conformance test 'program-infolog'.

From OpenGL ES 3.1 (and OpenGL 4.5 Core) spec:
   "If pname is INFO_LOG_LENGTH , the length of the info log, including
    a null terminator, is returned. If there is no info log, zero is
    returned."

v2: apply same fix for get_shaderiv and _mesa_GetProgramPipelineiv (Ian)

Signed-off-by: Tapani Pälli &lt;tapani.palli@intel.com&gt;
Reviewed-by: Iago Toral Quiroga &lt;itoral@igalia.com&gt; (v1)
Reviewed-by: Ian Romanick &lt;ian.d.romanick@intel.com&gt;
Reviewed-by: Nicolai Hähnle &lt;nicolai.haehnle@amd.com&gt;
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97321
Cc: "13.0" &lt;mesa-stable@lists.freedesktop.org&gt;
(cherry picked from commit ec4e71f75e9b8a1c427994efa32a61593e3172f9)
</pre>
</div>
</content>
</entry>
<entry>
<title>mesa: Drop PATH_MAX usage.</title>
<updated>2016-11-24T16:34:41+00:00</updated>
<author>
<name>Kenneth Graunke</name>
<email>kenneth@whitecape.org</email>
</author>
<published>2016-11-15T19:53:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/external_mesa3d/commit/?id=1809f17bda56d4f9d6385f63a9c4a5df890e3cad'/>
<id>1809f17bda56d4f9d6385f63a9c4a5df890e3cad</id>
<content type='text'>
GNU/Hurd does not define PATH_MAX since it doesn't have such arbitrary
limitation, so this failed to compile.  Apparently glibc does not
enforce PATH_MAX restrictions anyway, so it's kind of a hoax:

https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html

MSVC uses a different name (_MAX_PATH) as well, which is annoying.

We don't really need it.  We can simply asprintf() the filenames.
If the filename exceeds an OS path limit, presumably fopen() will
fail, and we already check that.  (We actually use ralloc_asprintf
because Mesa provides that everywhere, and it doesn't look like we've
provided an implementation of GNU's asprintf() for all platforms.)

Fixes the build on GNU/Hurd.

Cc: "13.0" &lt;mesa-stable@lists.freedesktop.org&gt;
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632
Signed-off-by: Samuel Thibault &lt;samuel.thibault@ens-lyon.org&gt;
Signed-off-by: Kenneth Graunke &lt;kenneth@whitecape.org&gt;
Reviewed-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
(cherry picked from commit 9bfee7047b70cb0aa026ca9536465762f96cb2b1)
[Emil Velikov: s|prog-&gt;Id|base-&gt;Id|]
Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;

Conflicts:
	src/mesa/main/arbprogram.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GNU/Hurd does not define PATH_MAX since it doesn't have such arbitrary
limitation, so this failed to compile.  Apparently glibc does not
enforce PATH_MAX restrictions anyway, so it's kind of a hoax:

https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html

MSVC uses a different name (_MAX_PATH) as well, which is annoying.

We don't really need it.  We can simply asprintf() the filenames.
If the filename exceeds an OS path limit, presumably fopen() will
fail, and we already check that.  (We actually use ralloc_asprintf
because Mesa provides that everywhere, and it doesn't look like we've
provided an implementation of GNU's asprintf() for all platforms.)

Fixes the build on GNU/Hurd.

Cc: "13.0" &lt;mesa-stable@lists.freedesktop.org&gt;
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632
Signed-off-by: Samuel Thibault &lt;samuel.thibault@ens-lyon.org&gt;
Signed-off-by: Kenneth Graunke &lt;kenneth@whitecape.org&gt;
Reviewed-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
(cherry picked from commit 9bfee7047b70cb0aa026ca9536465762f96cb2b1)
[Emil Velikov: s|prog-&gt;Id|base-&gt;Id|]
Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;

Conflicts:
	src/mesa/main/arbprogram.c
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix races during _mesa_HashWalk().</title>
<updated>2016-11-24T16:34:39+00:00</updated>
<author>
<name>Steinar H. Gunderson</name>
<email>steinar+mesa@gunderson.no</email>
</author>
<published>2016-11-05T14:28:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/external_mesa3d/commit/?id=e3fe51dbeee6f9d7520e99ac83efcc57646a2253'/>
<id>e3fe51dbeee6f9d7520e99ac83efcc57646a2253</id>
<content type='text'>
There is currently no protection against walking a hash (using
_mesa_HashWalk()) and modifying it at the same time, for instance by inserting
or deleting elements. This leads to segfaults in multithreaded code if e.g.
someone calls glTexImage2D (which may have to walk the list of FBOs) while
another thread is calling glDeleteFramebuffers on another thread with the two
contexts sharing lists.

The reason for this is that _mesa_HashWalk() doesn't actually take the mutex
that normally protects the hash; it takes an entirely different mutex.
Thus, walks are only protected against other walks, and there is also no
outer lock taking this. There is an old comment saying that this is to fix
problems with deadlock if the callback needs to take a mutex; we solve this
by changing the mutex to be recursive.

A demonstration Helgrind hit from a real application:

==13412== Possible data race during write of size 8 at 0x3498C6A8 by thread #1
==13412== Locks held: 2, at addresses 0x1AF09530 0x2B3DF400
==13412==    at 0x1F040C99: _mesa_hash_table_remove (hash_table.c:395)
==13412==    by 0x1EE98174: _mesa_HashRemove_unlocked (hash.c:350)
==13412==    by 0x1EE98174: _mesa_HashRemove (hash.c:365)
==13412==    by 0x1EE2372D: _mesa_DeleteFramebuffers (fbobject.c:2669)
==13412==    by 0x6105AA4: movit::ResourcePool::cleanup_unlinked_fbos(void*) (resource_pool.cpp:473)
==13412==    by 0x610615B: movit::ResourcePool::release_fbo(unsigned int) (resource_pool.cpp:442)
[...]
==13412== This conflicts with a previous read of size 8 by thread #20
==13412== Locks held: 2, at addresses 0x1AF09558 0x1AF73318
==13412==    at 0x1F040CD9: _mesa_hash_table_next_entry (hash_table.c:415)
==13412==    by 0x1EE982A8: _mesa_HashWalk (hash.c:426)
==13412==    by 0x1EED6DFD: _mesa_update_fbo_texture.part.33 (teximage.c:2683)
==13412==    by 0x1EED9410: _mesa_update_fbo_texture (teximage.c:3043)
==13412==    by 0x1EED9410: teximage (teximage.c:3073)
==13412==    by 0x1EEDA28F: _mesa_TexImage2D (teximage.c:3105)
==13412==    by 0x166A68: operator() (mixer.cpp:454)

There are many more interactions than just these two possible.

Cc: 11.2 12.0 13.0 &lt;mesa-stable@lists.freedesktop.org&gt;
Signed-off-by: Steinar H. Gunderson &lt;steinar+mesa@gunderson.no&gt;
Reviewed-by: Timothy Arceri &lt;timothy.arceri@collabora.com&gt;
(cherry picked from commit 2e2562cabbe9a1d3fb997ccaccc20ba31b2006c3)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is currently no protection against walking a hash (using
_mesa_HashWalk()) and modifying it at the same time, for instance by inserting
or deleting elements. This leads to segfaults in multithreaded code if e.g.
someone calls glTexImage2D (which may have to walk the list of FBOs) while
another thread is calling glDeleteFramebuffers on another thread with the two
contexts sharing lists.

The reason for this is that _mesa_HashWalk() doesn't actually take the mutex
that normally protects the hash; it takes an entirely different mutex.
Thus, walks are only protected against other walks, and there is also no
outer lock taking this. There is an old comment saying that this is to fix
problems with deadlock if the callback needs to take a mutex; we solve this
by changing the mutex to be recursive.

A demonstration Helgrind hit from a real application:

==13412== Possible data race during write of size 8 at 0x3498C6A8 by thread #1
==13412== Locks held: 2, at addresses 0x1AF09530 0x2B3DF400
==13412==    at 0x1F040C99: _mesa_hash_table_remove (hash_table.c:395)
==13412==    by 0x1EE98174: _mesa_HashRemove_unlocked (hash.c:350)
==13412==    by 0x1EE98174: _mesa_HashRemove (hash.c:365)
==13412==    by 0x1EE2372D: _mesa_DeleteFramebuffers (fbobject.c:2669)
==13412==    by 0x6105AA4: movit::ResourcePool::cleanup_unlinked_fbos(void*) (resource_pool.cpp:473)
==13412==    by 0x610615B: movit::ResourcePool::release_fbo(unsigned int) (resource_pool.cpp:442)
[...]
==13412== This conflicts with a previous read of size 8 by thread #20
==13412== Locks held: 2, at addresses 0x1AF09558 0x1AF73318
==13412==    at 0x1F040CD9: _mesa_hash_table_next_entry (hash_table.c:415)
==13412==    by 0x1EE982A8: _mesa_HashWalk (hash.c:426)
==13412==    by 0x1EED6DFD: _mesa_update_fbo_texture.part.33 (teximage.c:2683)
==13412==    by 0x1EED9410: _mesa_update_fbo_texture (teximage.c:3043)
==13412==    by 0x1EED9410: teximage (teximage.c:3073)
==13412==    by 0x1EEDA28F: _mesa_TexImage2D (teximage.c:3105)
==13412==    by 0x166A68: operator() (mixer.cpp:454)

There are many more interactions than just these two possible.

Cc: 11.2 12.0 13.0 &lt;mesa-stable@lists.freedesktop.org&gt;
Signed-off-by: Steinar H. Gunderson &lt;steinar+mesa@gunderson.no&gt;
Reviewed-by: Timothy Arceri &lt;timothy.arceri@collabora.com&gt;
(cherry picked from commit 2e2562cabbe9a1d3fb997ccaccc20ba31b2006c3)
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'mesa/13.0' into nougat-x86</title>
<updated>2016-11-16T02:46:46+00:00</updated>
<author>
<name>Chih-Wei Huang</name>
<email>cwhuang@linux.org.tw</email>
</author>
<published>2016-11-15T08:02:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/external_mesa3d/commit/?id=f43ac65d6166f73eb439391b463218d97c65cce9'/>
<id>f43ac65d6166f73eb439391b463218d97c65cce9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>mesa/glsl: delete previously linked shaders earlier when linking</title>
<updated>2016-11-09T13:53:50+00:00</updated>
<author>
<name>Timothy Arceri</name>
<email>timothy.arceri@collabora.com</email>
</author>
<published>2016-11-01T22:49:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/external_mesa3d/commit/?id=bd3fde40681171d91b058e016847f4b69470ba8e'/>
<id>bd3fde40681171d91b058e016847f4b69470ba8e</id>
<content type='text'>
This moves the delete linked shaders call to
_mesa_clear_shader_program_data() which makes sure we delete them
before returning due to any validation problems.

It also reduces some code duplication.

From the OpenGL 4.5 Core spec:

   "If LinkProgram failed, any information about a previous link of
   that program object is lost. Thus, a failed link does not restore
   the old state of program.

   ...

   If one of these commands is called with a program for which
   LinkProgram failed, no error is generated unless otherwise noted.
   Implementations may return information on variables and interface
   blocks that would have been active had the program been linked
   successfully. In cases where the link failed because the program
   required too many resources, these commands may help applications
   determine why limits were exceeded."

Therefore it's expected that we shouldn't be able to query the
program that failed to link and retrieve information about a
previously successful link.

Before this change the linker was doing validation before freeing
the previously linked shaders and therefore could exit on failure
before they were freed.

This change also fixes an issue in compat profile where a program
with no shaders attached is expect to fall back to fixed function
but was instead trying to relink IR from a previous link.

Reviewed-by: Tapani Pälli &lt;tapani.palli@intel.com&gt;
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97715
Cc: "13.0" &lt;mesa-stable@lists.freedesktop.org&gt;
(cherry picked from commit d2861d682a235993844989f7742c9539c3e10245)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This moves the delete linked shaders call to
_mesa_clear_shader_program_data() which makes sure we delete them
before returning due to any validation problems.

It also reduces some code duplication.

From the OpenGL 4.5 Core spec:

   "If LinkProgram failed, any information about a previous link of
   that program object is lost. Thus, a failed link does not restore
   the old state of program.

   ...

   If one of these commands is called with a program for which
   LinkProgram failed, no error is generated unless otherwise noted.
   Implementations may return information on variables and interface
   blocks that would have been active had the program been linked
   successfully. In cases where the link failed because the program
   required too many resources, these commands may help applications
   determine why limits were exceeded."

Therefore it's expected that we shouldn't be able to query the
program that failed to link and retrieve information about a
previously successful link.

Before this change the linker was doing validation before freeing
the previously linked shaders and therefore could exit on failure
before they were freed.

This change also fixes an issue in compat profile where a program
with no shaders attached is expect to fall back to fixed function
but was instead trying to relink IR from a previous link.

Reviewed-by: Tapani Pälli &lt;tapani.palli@intel.com&gt;
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97715
Cc: "13.0" &lt;mesa-stable@lists.freedesktop.org&gt;
(cherry picked from commit d2861d682a235993844989f7742c9539c3e10245)
</pre>
</div>
</content>
</entry>
</feed>
