<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:itoral@igalia.com" title="Iago Toral <itoral@igalia.com>"> <span class="fn">Iago Toral</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - glDrawPixels with GL_COLOR_INDEX never returns."
href="https://bugs.freedesktop.org/show_bug.cgi?id=90213">bug 90213</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>itoral@igalia.com, jason@jlekstrand.net
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - glDrawPixels with GL_COLOR_INDEX never returns."
href="https://bugs.freedesktop.org/show_bug.cgi?id=90213#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - glDrawPixels with GL_COLOR_INDEX never returns."
href="https://bugs.freedesktop.org/show_bug.cgi?id=90213">bug 90213</a>
from <span class="vcard"><a class="email" href="mailto:itoral@igalia.com" title="Iago Toral <itoral@igalia.com>"> <span class="fn">Iago Toral</span></a>
</span></b>
<pre>Hi Mark, Juha:
Some "special" formats, like GL_COLOR_INDEX, MESA_FORMAT_YCBCR or byte-swapped
scenarios need special handling before we can call _mesa_format_convert (see
the implementation of texstore_rgba() in texstore.c for example).
The problem in this case is that we are not doing that and it seems that the
old _mesa_unpack_color_span_float that was used here before the format
conversion overhaul did handle at least GL_COLOR_INDEX (and byte-swapped
scenarios too as far as I can see), so this is a regression.
If the test was asserting before the overhaul that would explain that we did
not catch it when we where in development, but it is a regression nonetheless.
The solution is to add the same code we have in texstore.c to handle
GL_COLOR_INDEX, which basically converts GL_COLOR_INDEX to GL_RGBA ubyte before
calling _mesa_format_convert. We should probably also add the code we have
there for byte-swapped formats. I think it could be useful to have a helper
function for this so we don't have to replicate the code wherever we need to
handle things like GL_COLOR_INDEX.
Also, we should probably return something in _mesa_format_from_format_and_type
even when we reach the assertion to make things less confusing in non-debug
builds.
Jason, what do you think?</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>