On 02/17/2016 06:35 PM, Ilia Mirkin wrote:
The underlying 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, so we must check the
base format that the texture was created with, rather than backed out
from the driver-supplied underlying format.

Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu>
Cc: Brian Paul <bri...@vmware.com>
---

Brian, this is the patch I was alluding to in 
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_archives_mesa-2Ddev_2016-2DFebruary_108009.html&d=BQIBAg&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=T0t4QG7chq2ZwJo6wilkFznRSFy-8uDKartPGbomVj8&m=SQKtt9_Ei2i3dxD4vvLK3QDLOMlQNcmWEnm2QTUT7yg&s=NDB6v5Ez1Jy49Vo3Vvon4B0uhhAXGOUncYpTm8gDvCE&e=
  . It fixes the dEQP tests in question.

  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 ||


Looks good.  For textures, that's what we do.

Perhaps the check-in comment should say the base format is a function of the user-requested format and not the actual hardware format. And maybe mention the depth/stencil case as an example.

Reviewed-by: Brian Paul <bri...@vmware.com>

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to