<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 - No stencil buffer allocated when requested by GLUT"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=101703">101703</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>No stencil buffer allocated when requested by GLUT
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>17.0
          </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>Other
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>o.lauffenburger@topsolid.com
          </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=132472" name="attach_132472" title="Alternative implementation of stw_pixelformat_choose">attachment 132472</a> <a href="attachment.cgi?id=132472&action=edit" title="Alternative implementation of stw_pixelformat_choose">[details]</a></span>
Alternative implementation of stw_pixelformat_choose

I create an OpenGL context with Mesa 17.0 Gallium + software rasterizer with
the following GLUT command:

glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL)

Then no stencil buffer is allocated.

The problem is that the selection logic of ChoosePixelFormat() gives more
importance to the 32-bit color than to the 8-bit stencil.

I have changed the implementation of stw_pixelformat_choose() in
\src\gallium\state_trackers\wgl\stw_pixelformat.c to give the highest priority
to features requested but not available, then a lower priority to features with
less precision allocated than requested, then the lowest priority to features
with more precision allocated than requested.

My implementation is in the attached file.</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>