<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Debug mesa only]. Crash happens when calling drawArrays"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=107987#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Debug mesa only]. Crash happens when calling drawArrays"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=107987">bug 107987</a>
              from <span class="vcard"><a class="email" href="mailto:andrey.simiklit@gmail.com" title="asimiklit <andrey.simiklit@gmail.com>"> <span class="fn">asimiklit</span></a>
</span></b>
        <pre>Created <span class=""><a href="attachment.cgi?id=141837" name="attach_141837" title="simple reproduccer to simplify the debugging process.">attachment 141837</a> <a href="attachment.cgi?id=141837&action=edit" title="simple reproduccer to simplify the debugging process.">[details]</a></span>
simple reproduccer to simplify the debugging process.

Hi,

I have created the simple reproducer because debugging the chrome not very
convenient.

My current progress in this issue:

I managed to reproduce this issue in the following way:
1. Use shader program which is used at least one 'texture sample' in FS instead
of 'FF'.
2. Setup following property for texture GL_TEXTURE_MIN_FILTER = GL_LINEAR or
GL_NEAREST
3. The program must upload level 2 = 4x4, 1 = 2x2, 0 = 1x1. The pixels values
is not matter but must be uploaded and sequence of uploading is very matter,
firstly level 2 then 1 and lastly 0.
4. The last operation which should cause the assertion is glDrawArrays which
uses shader and texture mentioned above to draw some rectangle.

I found out that when we try to re-create miptree in
'intel_finalize_mipmap_tree' function we don't consider the 'base level' in
width0, height0, depth0 calculations.
I not very familiar with this part of the mesa code but I found that the
'intel_miptree_create_for_teximage' function consider the 'base level'. 
So I tried to do it in 'intel_finalize_mipmap_tree' and that fixes this issue
for me. So I hope that this is a possible fix:
<a href="https://patchwork.freedesktop.org/patch/254397/">https://patchwork.freedesktop.org/patch/254397/</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>