<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - glCallLists/glBitmap calls slow on Intel implementation of Mesa drivers"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=61412#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - glCallLists/glBitmap calls slow on Intel implementation of Mesa drivers"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=61412">bug 61412</a>
              from <span class="vcard"><a class="email" href="mailto:idr@freedesktop.org" title="Ian Romanick <idr@freedesktop.org>"> <span class="fn">Ian Romanick</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=61412#c4">comment #4</a>)
<span class="quote">> (In reply to <a href="show_bug.cgi?id=61412#c3">comment #3</a>)
> > Please, please, please don't use display lists, and don't use bitmaps. 
> > Display lists are basically nvidia-only for performance, so it's a bad route
> > to go.  Use normal texturing and "discard" instructions to render your
> > bitmaps, or normal texturing and alhpa blending if you're doing fixed
> > function.  Sticking your textures in one big atlas and vertex data in a vbo,
> > you'll get way better performance than you'd ever get out of bitmap.

> Really dude, did you not read anything I said?  It's a compatibility thing,
> plus the people who play this game are mostly either kids or computer
> illiterates so if a font texture goes bye bye because of something silly
> they did, I'll be the one who has to personally troubleshoot their issue. I</span >

Can you elaborate on what you mean by this?  I believe that Eric's proposal was
for you to change the way the application is rendering.  I'm not sure how this
has any affect on end-users troubleshooting things.

<span class="quote">> *want* to use the proper method, but I've had that many issues in the past
> with relying on users being intelligent enough to keep track of their file
> system that I now know better.  I know they're slow, I know they're
> deprecated and I do care, but I don't have much choice if I want to stay
> sane.</span >

I'm assuming that you have fonts stored on disk as bitmap (1-bit per pixel)
images, and that's why you're mentioning filesystems.  You can use this data as
a texture by using the GL_PIXEL_MAP_I_TO_A table.  The data is sent to
glTexImage2D like:

    glTexImage2D(GL_TEXTURE_2D, 0, width, height, 0,
                 GL_ALPHA4, GL_COLOR_INDEX, GL_BITMAP, pixels);

Configure the GL 1.2 texture combiners and blend mode to blend the font the way
you want:

    glTexEnvi(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_REPLACE);
    glBlendFunc(GL_SRC_ALPHA, GL_ZERO);
    glBlendEquation(GL_FUNC_ADD);

Then draw a single quad in the color you want the font to be:

    glColor3f(1.0f, 0.0f, 0.0f);
    glBegin(GL_QUADS);  // or your favorite way to draw
    glTexCoord2f(...);  // location of the character in the atlas
    glVertex2f(...);
    ...
    glEnd();

You could even build those calls into display lists (as you currently do with
the glBitmap calls) to keep the changes isolated from the reset of your code.

Excluding the call to glBlendEquation, that will work on every OpenGL
implementation since GL 1.1, and it will probably be faster than glBitmap on
every GL implementation since the data doesn't need to be re-uploaded for each
drawing operation.

Some implementations may cache the bitmap data in GPU memory with the display
list, but there's no guarantee.

<span class="quote">> Oh and my last machine was an AMD ATi setup, dual radeon graphics, display
> lists worked fine using the official drivers, or 3rd party ones, I just hate
> APUs which is why I upgraded as soon as the laptop died before the warranty
> ran out. So this isn't a case of nvidia drivers being better than the rest.</span >

(In reply to <a href="show_bug.cgi?id=61412#c6">comment #6</a>)
<span class="quote">> (In reply to <a href="show_bug.cgi?id=61412#c5">comment #5</a>)
> > I did read it.  But alpha blended texturing would also do the job that
> > glBitmap does, and is just fine with fixed function GL.
> You clearly DID NOT read it:

> > The people who play this game are mostly either kids or computer illiterates
> > so if a font texture goes bye bye because of something silly they did, I'll
> > be the one who has to personally troubleshoot their issue. I *want* to use
> > the proper method, but I've had that many issues in the past with relying on
> > users being intelligent enough to keep track of their file system that I now
> > know better.  I know they're slow, I know they're deprecated and I do care,
> > but I don't have much choice if I want to stay sane.

> Besides, I have reported a clearly broken feature of the driver, which
> appears to be related to glBitmap, perhaps instead of solely glCallLists,
> and it should be fixed. So stop telling me what I should do instead of using
> it when I've given my perfectly reasonable reasons and am not interested in
> people such as yourself arrogantly parading around like you do.  Either help
> with fixing the issue that is the driver seemingly falling back to some slow
> software implementation or bugger off.</span >

We have a small team, and a lot of other things to work on.  The probably that
we will have time to optimize this case is very, very small.  We have never
encountered any other application that depends on the performance of glBitmap.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>