From: Anuj Phogat <anuj.pho...@gmail.com> I made the suggested changes to swrast/s_texfilter.c (see the patch listed below). Now it render polygons without any texture (black) in depth-cube-map test (see the patch sent on Nov 28 to piglit mailing list). But the expected output is polygons rendered with different greyscale (depth) textures.
Some debugging info: _mesa_choose_tex_format() returns MESA_FORMAT_Z32 _mesa_get_texstore_func() returns _mesa_texstore_z32 Based on MESA_FORMAT_Z32, selected dstType = GL_UNSIGNED_INT Verified the values stored in depthValues[i] in _mesa_unpack_depth_span(). Correct pixel values (depth values) are reflected in this variable. depthValues[i] is converted to GLuint and stored in zValues[i] But while rendering swImg->FetchTexel() (called from sample_depth_texture() in swrast/s_texfilter.c) is unable to fetch the corect texel values. Any thoughts on what could go wrong after storing the depth texture correctly? -Thanks Anuj Signed-off-by: Anuj Phogat <anuj.pho...@gmail.com> --- 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 5662625..426fa25 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -3429,7 +3429,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; @@ -3675,7 +3676,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) { @@ -3700,7 +3704,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) { @@ -3711,7 +3718,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) { -- 1.7.7 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev