From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcD0m-0008Ef-4T for qemu-devel@nongnu.org; Wed, 16 Sep 2015 09:44:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcD0h-0006de-57 for qemu-devel@nongnu.org; Wed, 16 Sep 2015 09:44:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcD0g-0006cn-VC for qemu-devel@nongnu.org; Wed, 16 Sep 2015 09:44:31 -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 07C8D8E3FC for ; Wed, 16 Sep 2015 13:44:29 +0000 (UTC) References: <1441797654-15350-1-git-send-email-kraxel@redhat.com> <1441797654-15350-7-git-send-email-kraxel@redhat.com> <55F716AA.4080508@redhat.com> <1442303686.2895.11.camel@redhat.com> From: Max Reitz Message-ID: <55F9723A.2060509@redhat.com> Date: Wed, 16 Sep 2015 15:44:26 +0200 MIME-Version: 1.0 In-Reply-To: <1442303686.2895.11.camel@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8WtJXkdP3o73txaK9MVpXFbWXTOnji6pl" 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: Gerd Hoffmann Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8WtJXkdP3o73txaK9MVpXFbWXTOnji6pl Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 15.09.2015 09:54, Gerd Hoffmann wrote: > Hi, >=20 >>> + scon->scanout_mode =3D 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. >=20 > Fixed. >=20 >>> + 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 =3D scon->y0_top ? 0 : scon->h; >>> + y2 =3D 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 oper= ation? >=20 > Isn't READ/DRAW used for framebuffer blits only? Normal rendering goes= > to GL_FRAMEBUFFER I think ... http://docs.gl/gl4/glBindFramebuffer says: "Calling glBindFramebuffer with target set to GL_FRAMEBUFFER binds framebuffer to both the read and draw framebuffer targets.", so to me it looks like GL_FRAMEBUFFER is just an alias for GL_{DRAW,READ}_FRAMEBUFFER at the same time. Max --8WtJXkdP3o73txaK9MVpXFbWXTOnji6pl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJV+XI6AAoJEDuxQgLoOKytLJQIAKsqlpIT6VZ4vLL0tNLHGQ61 d8BrANAMEcISUwZNprRqIo6yW03IOqrmt6FcOKp9HoR3HUtMunFztMMAsyjVLIiQ N2yvJKf0AgncqbVWtBHVaVMToIDSQunEeaNv+5BUOBTWAwV96TWp9h+mW7rvPEQY TmcLNchTLafODSKO4s8RSi4T9mEt8kh0yl1bRVeA7j07P+81/GaszK9JVKt5vIIQ snMeVNsAcklWaUJSsDxNiOwOwTffvajtQCaDLRAn4h+ZagHyyhW8xZjAb0Rdgncz mzL3ergmHGJP9H8WMfyKZxEmpFxF471R+LP902uy9zTwM6QNmfIVHOywBiIqPBw= =Wczs -----END PGP SIGNATURE----- --8WtJXkdP3o73txaK9MVpXFbWXTOnji6pl--