<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:imirkin@alum.mit.edu" title="Ilia Mirkin <imirkin@alum.mit.edu>"> <span class="fn">Ilia Mirkin</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - The Witcher 2 (native) fails to start, throws "Assertion `img->_BaseFormat != -1' failed.""
href="https://bugs.freedesktop.org/show_bug.cgi?id=91314">bug 91314</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>imirkin@alum.mit.edu, itoral@igalia.com
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - The Witcher 2 (native) fails to start, throws "Assertion `img->_BaseFormat != -1' failed.""
href="https://bugs.freedesktop.org/show_bug.cgi?id=91314#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - The Witcher 2 (native) fails to start, throws "Assertion `img->_BaseFormat != -1' failed.""
href="https://bugs.freedesktop.org/show_bug.cgi?id=91314">bug 91314</a>
from <span class="vcard"><a class="email" href="mailto:imirkin@alum.mit.edu" title="Ilia Mirkin <imirkin@alum.mit.edu>"> <span class="fn">Ilia Mirkin</span></a>
</span></b>
<pre>So from the backtrace on IRC we see:
#5 0xb6ab9a64 in init_teximage_fields_ms (ctx=<optimized out>, img=0x204c7420,
width=<optimized out>, height=0, depth=0, border=0,
internalFormat=0, format=MESA_FORMAT_NONE, numSamples=0,
fixedSampleLocations=1 '\001') at main/teximage.c:1320
#6 0xb6ab9d4a in _mesa_init_teximage_fields (ctx=0x2055bed0, img=0x204c7420,
width=0, height=0, depth=0, border=0, internalFormat=0,
format=MESA_FORMAT_NONE) at main/teximage.c:1420
#7 0xb6abee31 in _mesa_texture_image_multisample (ctx=0x2055bed0, dims=2,
texObj=0x204a55d8, target=37120, samples=5, internalformat=34836,
width=32, height=32, depth=1, fixedsamplelocations=0 '\000', immutable=0
'\000', func=0xb6ec6f81 "glTexImage2DMultisample")
at main/teximage.c:5703
#8 0xb6abeecc in _mesa_TexImage2DMultisample (target=37120, samples=5,
internalformat=34836, width=32, height=32,
fixedsamplelocations=0 '\000') at main/teximage.c:5731
So the culprit is:
if (width > 0 && height > 0 && depth > 0) {
if (!ctx->Driver.AllocTextureStorage(ctx, texObj, 1,
width, height, depth)) {
/* tidy up the texture image state. strictly speaking,
* we're allowed to just leave this in whatever state we
* like, but being tidy is good.
*/
_mesa_init_teximage_fields(ctx, texImage,
0, 0, 0, 0, GL_NONE, MESA_FORMAT_NONE);
}
}
The texture storage allocation fails because nv50 doesn't support GL_RGBA32F
with > 4 samples.
Of course the sample count check above (samplesOK) passes because in st/mesa
format choosing, GL_RGBA32F will happily fall back to RGBA16F, which is
perfectly allowed to have 8 samples on nv50.
However st_AllocTextureStorage is blissfully unaware of such a restriction, and
fails when it can't create a RGBA32F MS8 texture.
So the bug is 2-fold:
(a) st_AllocateTextureStorage should use st_choose_format (or equivalent) so
that it deals with any sample count limitations
(b) _mesa_init_teximage_fields with MESA_FORMAT_NONE appears to trigger the
assert no matter what -- this should be handled better. Iago, should we just
let MESA_FORMAT_NONE through the assert, as was done before? (By the way,
GLenum, which is the type of baseFormat, appears to be unsigned, so a check
against -1 is a bit dangerous.)</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>