meta: Drop redundant FBO creation code in GenerateMipmaps.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 6 Mar 2014 03:21:00 +0000 (19:21 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 8 Mar 2014 06:45:11 +0000 (22:45 -0800)
fallback_required() already creates the FBO in order to check whether we
can render to the format.  So it's guaranteed to exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/common/meta_generate_mipmap.c

index 6db3f8fa7ee5cea4f933ad12ef57b4b73a341e0a..6a0ccbdb7dd1469eab3c41da9d822d7b824623ef 100644 (file)
@@ -208,10 +208,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
    if (currentTexUnitSave != 0)
       _mesa_BindTexture(target, texObj->Name);
 
-   if (!mipmap->FBO) {
-      _mesa_GenFramebuffers(1, &mipmap->FBO);
-   }
-
    if (!mipmap->Sampler) {
       _mesa_GenSamplers(1, &mipmap->Sampler);
       _mesa_BindSampler(ctx->Texture.CurrentUnit, mipmap->Sampler);
@@ -236,6 +232,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
       _mesa_BindSampler(ctx->Texture.CurrentUnit, mipmap->Sampler);
    }
 
+   assert(mipmap->FBO != 0);
    _mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, mipmap->FBO);
 
    _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE);