Bug 101703 - No stencil buffer allocated when requested by GLUT
Summary: No stencil buffer allocated when requested by GLUT
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: 17.0
Hardware: All All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-06 07:32 UTC by Olivier Lauffenburger
Modified: 2017-07-06 23:27 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Alternative implementation of stw_pixelformat_choose (2.02 KB, text/plain)
2017-07-06 07:32 UTC, Olivier Lauffenburger
Details
0001-st-wgl.patch (2.47 KB, patch)
2017-07-06 09:31 UTC, Eric Engestrom
Details | Splinter Review

Description Olivier Lauffenburger 2017-07-06 07:32:50 UTC
Created attachment 132472 [details]
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.
Comment 1 Eric Engestrom 2017-07-06 09:31:48 UTC
Created attachment 132475 [details] [review]
0001-st-wgl.patch

Hi Olivier!

Thanks for your code suggestion. I don't know anything about the code it touches,
so I'll let others talk about that.

The usual way of suggesting changes is to send a patch to the mailing-list.
You can read how to do this on our website [1], but the gist is that you should
clone the repo, make a commit with your change and send it for review.

I've attached your change as a patch, all you need to do is fill in the commit
title and body, explaining why this change is necessary (eg. "what's wrong",
then "how this fixes it"), and you can send it using:
$ git send-email --to mesa-dev@lists.freedesktop.org <patch-file>

Cheers,
  Eric

[1] https://mesa3d.org/submittingpatches.html
Comment 2 Brian Paul 2017-07-06 23:27:07 UTC
Thanks, Olivier.  I've pushed this patch and the wglUseFontBitmaps patch
(commits 80c6598cdba36edb, 43dea65ad2e8259).
Closing this bug.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.