Mesa (master): mesa/main: condition GL_DEPTH_STENCIL on ARB_depth_texture

Ilia Mirkin imirkin at kemper.freedesktop.org
Wed Mar 19 22:22:24 UTC 2014


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Thu Mar 13 07:01:15 2014 -0400

mesa/main: condition GL_DEPTH_STENCIL on ARB_depth_texture

EXT_packed_depth_stencil is supported by all drivers, but
ARB_depth_texture isn't (notably nouveau_vieux). This should avoid
passing unexpected values down to ChooseTextureFormat.

The EXT_packed_depth_stencil spec does not make any explicit references
to requiring ARB_depth_texture in order to allow textures with that
format, however if there is no dependency, ARB_depth_texture would be
practically implied by the extension.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez at riseup.net>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: "10.0 10.1" <mesa-stable at lists.freedesktop.org>

Note for 10.0 backport: This will produce a conflict, the solution is to
move the surrounding if as well.

---

 src/mesa/main/teximage.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index a6c3581..a57a535 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -160,6 +160,9 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
          case GL_DEPTH_COMPONENT24:
          case GL_DEPTH_COMPONENT32:
             return GL_DEPTH_COMPONENT;
+         case GL_DEPTH_STENCIL:
+         case GL_DEPTH24_STENCIL8:
+            return GL_DEPTH_STENCIL;
          default:
             ; /* fallthrough */
       }
@@ -301,14 +304,6 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
       }
    }
 
-   switch (internalFormat) {
-   case GL_DEPTH_STENCIL:
-   case GL_DEPTH24_STENCIL8:
-      return GL_DEPTH_STENCIL;
-   default:
-      ; /* fallthrough */
-   }
-
    if (ctx->Extensions.EXT_texture_sRGB) {
       switch (internalFormat) {
       case GL_SRGB_EXT:




More information about the mesa-commit mailing list