<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - OSMesaGetProcAdress always fails on mangled OSMesa"
href="https://bugs.freedesktop.org/show_bug.cgi?id=94994">94994</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>OSMesaGetProcAdress always fails on mangled OSMesa
</td>
</tr>
<tr>
<th>Product</th>
<td>Mesa
</td>
</tr>
<tr>
<th>Version</th>
<td>11.2
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>Mesa core
</td>
</tr>
<tr>
<th>Assignee</th>
<td>mesa-dev@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>frederic.devernay@m4x.org
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>mesa-dev@lists.freedesktop.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=123027" name="attach_123027" title="patch">attachment 123027</a> <a href="attachment.cgi?id=123027&action=edit" title="patch">[details]</a></span>
patch
OSMesaGetProcAdress on mangled OSMesa checks that the first three characters
are "mgl", but the functions in the table are stored without the leading "m",
thus OSMesaGetProcAddress always returns a dummy function.
The proposed solution is similar to
<a href="https://lists.freedesktop.org/archives/mesa-dev/2015-September/095251.html">https://lists.freedesktop.org/archives/mesa-dev/2015-September/095251.html</a> :
If we are on mangled osmesa and the first character is "m", skip it and
proceed.
Thus OSMesaGetProcAddress("mglCreateShader") and
OSMesaGetProcAddress("glCreateShader") return the same thing on mangled OSMesa,
and the former doesn't work on non-mangled OSMesa.
This bug also depends on <a class="bz_bug_link
bz_status_NEW "
title="NEW - GL/gl_mangle.h misses symbols from GLES/gl.h"
href="show_bug.cgi?id=91724">https://bugs.freedesktop.org/show_bug.cgi?id=91724</a>
(which has a proposed solution)
Plese note that mangled OSMesa is a very useful feature, and may even be
necessary in some situations, as I discussed in
<a class="bz_bug_link
bz_status_NEW "
title="NEW - GL/gl_mangle.h misses symbols from GLES/gl.h"
href="show_bug.cgi?id=91724#c4">https://bugs.freedesktop.org/show_bug.cgi?id=91724#c4</a>
I provide scripts for building and installing various flavors of OSMesa, as
well as a simple test program that checks the return values of
OSMesaGetProcAddress at: <a href="https://github.com/devernay/osmesa-install">https://github.com/devernay/osmesa-install</a>
Fred (early Mesa contributor, see the Mesa 1.2.1 README!)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>