Module: Mesa
Branch: master
Commit: 68c4af1c1942d30665f3f99654e8f35b175d1256
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=68c4af1c1942d30665f3f99654e8f35b175d1256

Author: Ilia Mirkin <[email protected]>
Date:   Wed Feb 17 20:31:38 2016 -0500

mesa: check fbo completeness based on internal format, not driver format

The base format is a function of the user-requested format, while the
driver format is not. So we should use the base format instead.

The driver format can be anything. Specifically in the stencil-only
case, it might be a depth/stencil format. However we still want to
refuse such an attachment when bound to GL_DEPTH.

Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Brian Paul <[email protected]>

---

 src/mesa/main/fbobject.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 1b9b692..1f10050 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -811,7 +811,7 @@ test_attachment_completeness(const struct gl_context *ctx, 
GLenum format,
          break;
       }
 
-      baseFormat = _mesa_get_format_base_format(texImage->TexFormat);
+      baseFormat = texImage->_BaseFormat;
 
       if (format == GL_COLOR) {
          if (!_mesa_is_legal_color_format(ctx, baseFormat)) {
@@ -868,8 +868,7 @@ test_attachment_completeness(const struct gl_context *ctx, 
GLenum format,
       }
    }
    else if (att->Type == GL_RENDERBUFFER_EXT) {
-      const GLenum baseFormat =
-         _mesa_get_format_base_format(att->Renderbuffer->Format);
+      const GLenum baseFormat = att->Renderbuffer->_BaseFormat;
 
       assert(att->Renderbuffer);
       if (!att->Renderbuffer->InternalFormat ||

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to