[Mesa-dev] [PATCH] mesa: skip level checking for FramebufferTexture*D if texture is zero

Marek Olšák maraeo at gmail.com
Fri May 27 20:11:27 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

>From the OpenGL 4.5 core spec:
  "An INVALID_VALUE error is generated if texture is not zero and level is
  not a supported texture level for textarget, as described above."

Other FramebufferTexture functions already do the same thing.

This fixes the main menu in F1 2015.

Cc: 11.1 11.2 <mesa-stable at lists.freedesktop.org>
---
 src/mesa/main/fbobject.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 44696c0..fa5baa3 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -3240,10 +3240,10 @@ framebuffer_texture_with_dims(int dims, GLenum target,
 
       if ((dims == 3) && !check_layer(ctx, texObj->Target, layer, caller))
          return;
-   }
 
-   if (!check_level(ctx, textarget, level, caller))
-      return;
+      if (!check_level(ctx, textarget, level, caller))
+         return;
+   }
 
    _mesa_framebuffer_texture(ctx, fb, attachment, texObj, textarget, level,
                              layer, GL_FALSE, caller);
-- 
2.7.4



More information about the mesa-dev mailing list