<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - GLX_INTEL_swap_event crashes driver when swapping window buffers"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=54372#c13">Comment # 13</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - GLX_INTEL_swap_event crashes driver when swapping window buffers"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=54372">bug 54372</a>
              from <span class="vcard"><a class="email" href="mailto:lemody@gmail.com" title="Tapani Pälli <lemody@gmail.com>"> <span class="fn">Tapani Pälli</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=54372#c12">comment #12</a>)

<span class="quote">> Prior to GLX 1.3 there was the glxMakeCurrent() function that took a single
> drawable handle. The Drawable could be either a bare XID for a Window or an
> XID for a glxpixmap.

> GLX 1.3 added glxMakeContextCurrent that takes 2 handles: one for reading,
> one for writing. Nowadays the old glxMakeCurrent call is implemented as a
> call to glxMakeContextCurrent with the single handle duplicated.

> Because of this it is allowed to use a plain-old Window ID as an argument to
> glxMakeContextCurrent, although nobody really documents this sort of thing.
> The manpage for the NEW call specifies the arguments as GLXPixmaps, but the
> actual code accepts Window XIDs too, and handles them correctly.</span >

Can you pinpoint to such documentation? I can't find historical API reference
where glxMakeCurrent would take XID as parameter (for example GLX 1.2 does not,
it requires a GLXDrawable handle).

I think in theory you should be getting GLXBadDrawable error here.

("GLXBadDrawable is generated if drawable is not a valid GLX drawable.")

<span class="quote">> The "piglit" tests all use GLXWindows and/or GLXPixmaps. You never tested
> swap events with a bare Window XID. That is what my app was doing.</span >

We could add such a test but it should probably fail in the above way. I don't
know enough of X server to be 100% sure though, I would imagine it has unique
handles for every resource but this starts to look like it does not.

<span class="quote">> I can work around this bug by creating glxpixmaps instead of using a raw
> Window XID for my main window. But you're still stuck having to handle this
> case. I've thought deeply about your options, and my patch is the least
> painful.</span >

I would consider this not a workaround but a fix to your application as you
need to use today's API documentation and specs. I do agree that there might be
a problem with the API too to detect this situation.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>