From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zbl4m-0006Rp-RR for qemu-devel@nongnu.org; Tue, 15 Sep 2015 03:54:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zbl4j-00060c-Kn for qemu-devel@nongnu.org; Tue, 15 Sep 2015 03:54:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zbl4j-00060D-GE for qemu-devel@nongnu.org; Tue, 15 Sep 2015 03:54:49 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id CEA482589E for ; Tue, 15 Sep 2015 07:54:48 +0000 (UTC) Message-ID: <1442303686.2895.11.camel@redhat.com> From: Gerd Hoffmann Date: Tue, 15 Sep 2015 09:54:46 +0200 In-Reply-To: <55F716AA.4080508@redhat.com> References: <1441797654-15350-1-git-send-email-kraxel@redhat.com> <1441797654-15350-7-git-send-email-kraxel@redhat.com> <55F716AA.4080508@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/9] sdl2/opengl: add opengl context and scanout support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-devel@nongnu.org Hi, > > + scon->scanout_mode = scanout; > > + if (!scon->scanout_mode) { > > + if (scon->fbo_id) { > > + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, > > + GL_COLOR_ATTACHMENT0_EXT, > > + GL_TEXTURE_2D, 0, 0); > > + glDeleteFramebuffers(1, &scon->fbo_id); > > I'm not sure, but maybe the framebuffer itself should be unbound here, > too? (i.e., glBindFramebuffer(GL_FRAMEBUFFER, 0)) > > I know it's deleted but I don't know whether that's enough. Fixed. > > + glBindFramebuffer(GL_READ_FRAMEBUFFER, scon->fbo_id); > > + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); > > + > > + SDL_GetWindowSize(scon->real_window, &ww, &wh); > > + glViewport(0, 0, ww, wh); > > + y1 = scon->y0_top ? 0 : scon->h; > > + y2 = scon->y0_top ? scon->h : 0; > > + glBlitFramebuffer(0, y1, scon->w, y2, > > + 0, 0, ww, wh, > > + GL_COLOR_BUFFER_BIT, GL_NEAREST); > > Should we bind the FBO back to GL_DRAW_FRAMEBUFFER after the blit operation? Isn't READ/DRAW used for framebuffer blits only? Normal rendering goes to GL_FRAMEBUFFER I think ... cheers, Gerd