diff options
author | Anuj Phogat <anuj.phogat@gmail.com> | 2011-11-30 11:39:57 -0800 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2011-12-05 17:02:13 -0800 |
commit | c3aae7745a648d5d8f8386e09cd6d965f919c7d9 (patch) | |
tree | acd339fda42c8b85a2b96b045292797fac833f44 /src | |
parent | 29a7d7784def4f37d3fe38a123a17836dd7fafc0 (diff) |
swrast: Add depth cube map support.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/swrast/s_texfilter.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index fb172f3a80d..21b55a8017e 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -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) { |