Mesa (master): mesa: Make _mesa_is_stencil_format() consistent with _mesa_is_depth_format().

Eric Anholt anholt at kemper.freedesktop.org
Wed Nov 30 00:55:33 UTC 2011


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Nov 21 18:03:30 2011 -0800

mesa: Make _mesa_is_stencil_format() consistent with _mesa_is_depth_format().

There was only one consumer of this API, meta.c, which was intending
to ask "is this format just stencil index (and nothing else)?".
Instead, if one tried to glDrawPixels of GL_DEPTH_STENCIL-type
formats, it would just try to draw the stencil parts.  Nothing good
came of this.

This function looks rather silly at this point, but I'm leaving it in
place to be the obvious parallel API to _mesa_is_depth_format().  Note
that if you want the old behavior, you should use it as
(_mesa_is_stencil_format() || _mesa_is_depthstencil_format()) like is
commonly done for depth-related tests.

Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/main/image.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 9b9e838..446d52e 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -853,7 +853,6 @@ _mesa_is_stencil_format(GLenum format)
 {
    switch (format) {
       case GL_STENCIL_INDEX:
-      case GL_DEPTH_STENCIL:
          return GL_TRUE;
       default:
          return GL_FALSE;




More information about the mesa-commit mailing list