swrast: Add depth cube map support.
authorAnuj Phogat <anuj.phogat@gmail.com>
Wed, 30 Nov 2011 19:39:57 +0000 (11:39 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 6 Dec 2011 01:02:13 +0000 (17:02 -0800)
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/swrast/s_texfilter.c

index fb172f3a80de2031cafb816b72498ef201d73350..21b55a8017ed67cc715f75a766158da1fa32e860 100644 (file)
@@ -3437,7 +3437,8 @@ sample_depth_texture( struct gl_context *ctx,
           tObj->Target == GL_TEXTURE_2D ||
           tObj->Target == GL_TEXTURE_RECTANGLE_NV ||
           tObj->Target == GL_TEXTURE_1D_ARRAY_EXT ||
-          tObj->Target == GL_TEXTURE_2D_ARRAY_EXT);
+          tObj->Target == GL_TEXTURE_2D_ARRAY_EXT ||
+          tObj->Target == GL_TEXTURE_CUBE_MAP);
 
    ambient = tObj->Sampler.CompareFailValue;
 
@@ -3684,7 +3685,10 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
             return &sample_nearest_3d;
          }
       case GL_TEXTURE_CUBE_MAP:
-         if (needLambda) {
+         if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
+           return &sample_depth_texture;
+        }
+        else if (needLambda) {
             return &sample_lambda_cube;
          }
          else if (t->Sampler.MinFilter == GL_LINEAR) {
@@ -3709,7 +3713,10 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
             return &sample_nearest_rect;
          }
       case GL_TEXTURE_1D_ARRAY_EXT:
-         if (needLambda) {
+         if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
+            return &sample_depth_texture;
+         }
+        else if (needLambda) {
             return &sample_lambda_1d_array;
          }
          else if (t->Sampler.MinFilter == GL_LINEAR) {
@@ -3720,7 +3727,10 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
             return &sample_nearest_1d_array;
          }
       case GL_TEXTURE_2D_ARRAY_EXT:
-         if (needLambda) {
+         if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
+            return &sample_depth_texture;
+         }
+        else if (needLambda) {
             return &sample_lambda_2d_array;
          }
          else if (t->Sampler.MinFilter == GL_LINEAR) {