From: Simon Farnsworth Subject: Regression in i965 Mesa driver caused by commit c7c64d97836c71eaf2ee3fc6d384877170b8c844 Date: Tue, 22 Jun 2010 18:37:46 +0100 Message-ID: <201006221837.46614.simon.farnsworth@onelan.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from claranet-outbound-smtp03.uk.clara.net (claranet-outbound-smtp03.uk.clara.net [195.8.89.36]) by gabe.freedesktop.org (Postfix) with ESMTP id 7710C9E732 for ; Tue, 22 Jun 2010 10:37:53 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Kristian =?iso-8859-1?q?H=F8gsberg?= Cc: mesa-dev , "intel-gfx@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org Hello Kristian, Your commit: commit c7c64d97836c71eaf2ee3fc6d384877170b8c844 Author: Kristian H=F8gsberg Date: Tue Jun 1 14:33:43 2010 -0400 intel: Fallback to meta if we're asked to CopyTexImage2D from RGB to RG= BA = The pixel transfer rules state that we must set alpha to 1.0 in this ca= se which we can't easily do with the blitter. We can do to passes: one th= at sets the alpha to 0xff and one that copies the RGB bits or we can just use the 3D engine. Neither approach seems worth it for this case. has broken my use of Mesa to snapshot the display using an FBO. In my code,= I = do (where width and height are the size of the screen, snapshot_width and = snapshot_height are the target size of my snapshot): glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, = framebuffer_object ); glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, renderbuffer ); glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, GL_RGB8, snapshot_width, snapshot_height ); glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, renderbuffer ); glBindFramebufferEXT( GL_READ_FRAMEBUFFER_EXT, 0 ); glBlitFramebufferEXT( 0, 0, width, height, 0, snapshot_height, snapshot_width, 0, GL_COLOR_BUFFER_BIT, GL_LINEAR ); glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 ); to get a snapshot of the current screen contents in my FBO. I then have a = separate thread (using its own GL context) get the pixel contents of the FB= O = with glReadPixels() and turn it into a PNG file. With current Mesa master (eb7ef433bbbeabda963e74adf0ef61c47883f292), the = glBlitFramebufferEXT() call causes my fullscreen application to get stuck -= the = front buffer and back buffer at the time of the glBlitFramebufferEXT() call= swap = back and forth as I call glXSwapBuffers(), but no further changes to screen = contents occur. The FBO appears to have the correct contents the first time= I = do this, but not on future attempts to snapshot the screen. git bisect fingered this commit as the cause - reverting just this commit m= akes = things work as they used to. Is there a better fix (either to my code or to = Mesa) that I should work on; I can't glReadPixels() directly from the main = framebuffer, as (not entirely surprisingly) this causes my rendering thread= to = stall for a short but visible period - and while I can stall the snapshotti= ng = thread indefinitely, I'm not permitted to stall the rendering thread. I've tried using both GL_RGBA8 and GL_RGB8 renderbuffers, which hasn't help= ed - = but it looks from the code like it's the format of the source buffer (the = system framebuffer) that matters, not the format of the destination buffer. -- = Thanks in advance for any advice you can offer, Simon Farnsworth