<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 29, 2019 at 12:28 PM Adam Jackson <<a href="mailto:ajax@redhat.com">ajax@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 2019-04-26 at 23:31 -0400, Marek Olšák wrote:<br>
<br>
I don't claim to know what this series is trying to fix, but:<br>
<br>
> + * 2) Pbuffers are back buffers from the application point of view,<br>
> + * but they are front buffers from the Mesa point of view,<br>
> + * because they are always single buffered.<br>
> + */<br>
<br>
The EGL spec (back to 1.0!) says:<br>
<br>
"The resulting pbuffer will contain color buffers and ancillary buffers<br>
as specified by config."<br>
<br>
This appears to be copied from GLX, which has something more elaborate:<br>
<br>
"The resulting pbuffer will contain color buffers and ancillary buffers<br>
as specified by config. It is possible to create a pbuffer with back<br>
buffers and to swap the front and back buffers by calling<br>
glXSwapBuffers. Note that pbuffers use framebuffer resources so<br>
applications should consider deallocating them when they are not in<br>
use."<br>
<br>
So I'm not convinced that pbuffers are "always single-buffered". The<br>
back buffer is definitely a color buffer, and at least under GLX it<br>
seems like it should be possible to draw red to back, swap, draw blue<br>
to back, glReadBuffer(GL_FRONT), and expect glReadPixels to return red.<br></blockquote><div><br></div>Yeah that's possible. The thing is that a GL context can have a doublebuffered config and begin with GL_BACK as the draw buffer, but MakeCurrent can set a pbuffer with a singlebuffered config and then nothing is rendered with Mesa because there is no back buffer. This case appears to work on NVIDIA.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Marek<br></div></div>