ARB_texture_rg: Add GL_RED as a valid GL_DEPTH_TEXTURE_MODE
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 28 Sep 2010 20:50:34 +0000 (13:50 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 1 Oct 2010 22:49:13 +0000 (15:49 -0700)
src/mesa/main/texparam.c
src/mesa/swrast/s_texfilter.c

index 58d785812eac2c3bf4607ecf46cb0eeaabcec194..e96ace734035c12b7b6b50b51bcd59f84180ea0a 100644 (file)
@@ -351,7 +351,8 @@ set_tex_parameteri(GLcontext *ctx,
       if (ctx->Extensions.ARB_depth_texture &&
           (params[0] == GL_LUMINANCE ||
            params[0] == GL_INTENSITY ||
-           params[0] == GL_ALPHA)) {
+           params[0] == GL_ALPHA ||
+          (ctx->Extensions.ARB_texture_rg && params[0] == GL_RED))) {
          if (texObj->DepthMode != params[0]) {
             flush(ctx, texObj);
             texObj->DepthMode = params[0];
index 1aa2bcaf74d224f9f1b115effc856da5d3a2dfdf..de694c31bf1ab3f96300cfe9ea84cbcd5be843e8 100644 (file)
@@ -3051,6 +3051,9 @@ sample_depth_texture( GLcontext *ctx,
          case GL_ALPHA:
             ASSIGN_4V(texel[i], 0.0F, 0.0F, 0.0F, result);
             break;
+         case GL_RED:
+            ASSIGN_4V(texel[i], result, 0.0F, 0.0F, 1.0F);
+            break;
          default:
             _mesa_problem(ctx, "Bad depth texture mode");
          }