<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Indirect rendering of multi-texture vertex arrays broken"
href="https://bugs.freedesktop.org/show_bug.cgi?id=61907">61907</a>
</td>
</tr>
<tr>
<th>Assignee</th>
<td>mesa-dev@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Summary</th>
<td>Indirect rendering of multi-texture vertex arrays broken
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Reporter</th>
<td>cjmmail10-bz@yahoo.co.uk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>9.1
</td>
</tr>
<tr>
<th>Component</th>
<td>GLX
</td>
</tr>
<tr>
<th>Product</th>
<td>Mesa
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=76023" name="attach_76023" title="Updated files with fixes for mesa src/glx">attachment 76023</a> <a href="attachment.cgi?id=76023&action=edit" title="Updated files with fixes for mesa src/glx">[details]</a></span>
Updated files with fixes for mesa src/glx
Indirect rendering of multi-texture vertex arrays is currently
broken with three separate bugs in src/glx, which I have attempted to fix
in the attached files.
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Optimizations"
href="show_bug.cgi?id=1">Bug 1</a>: For each indirect context the indirect vertex array state must be
initialised by __glXInitVertexArrayState in indirect_vertex_array.c. As
noted in the routine header it requires that the glx context has been setup
prior to the call, in order to test the server version and extensions.
Currently __glXInitVertexArrayState is called from indirect_bind_context
in indirect_glx.c, as follows:
state = gc->client_state_private;
if (state->array_state == NULL) {
glGetString(GL_EXTENSIONS);
glGetString(GL_VERSION);
__glXInitVertexArrayState(gc);
}
But, the gc context is not yet usable at this stage, so the server queries
fail, and __glXInitVertexArrayState is called without the server version
and extension information it needs. This breaks multi-texturing as
glXInitVertexArrayState doesn't get GL_MAX_TEXTURE_UNITS. It probably also
breaks setup of other arrays: fog, secondary colour, vertex attributes.
To fix this I have moved the call to __glXInitVertexArrayState to the end
of MakeContextCurrent in glxcurrent.c, where the glx context is usable.
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - submake invocation failure does not cause build failure"
href="show_bug.cgi?id=2">Bug 2</a>. There are a couple of typos in the op codes in
__indirect_glTexCoordPointer in indirect_vertex_array.c, resulting in the
wrong command op code being sent. I have corrected them.
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Should provide empty local.conf file"
href="show_bug.cgi?id=3">Bug 3</a>. There is no draw arrays protocol support for multi-texture
coordinate arrays, so it is implemented by sending batches of immediate
mode commands from emit_element_none in indirect_vertex_array.c. This
sends the target texture unit (which has been previously setup in the
array_state header field), followed by the texture coordinates. But for
GL_DOUBLE coordinates the texture unit must be sent *after* the texture
coordinates. This is documented in the glx protocol description, and can
also be seen in the indirect.c immediate mode commands generated from
gl_API.xml. Sending the target texture unit in the wrong place can crash
the remote X server.
To fix this required some more extensive changes to indirect_vertex_array.c
and indirect_vertex_array_priv.h, in order to remove the texture unit value
out of the array_state "header" field, and send it separately.
The modified files from src/glx are attached. The are based on the
latest git master branch as of 6 March 2013.
I encountered these bugs with glDrawArrays/glDrawElements calls from an
OpenSceneGraph application. I have tested the fixes on Linux x86_64,
displaying on a remote Linux X server and also on a commercial Microsoft
Windows X server.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>