diff options
author | Yuanhan Liu <[email protected]> | 2011-11-02 14:46:06 +0800 |
---|---|---|
committer | Yuanhan Liu <[email protected]> | 2011-11-03 10:24:28 +0800 |
commit | 9f7b6a39f6ebc070ff5020578cea2d299b21d476 (patch) | |
tree | f77fd866679bcb0a0b2e92abf5a7028d56ae897d | |
parent | 49f8447acc430944504c658c2d2b4a2ccb3af0bc (diff) |
swrast: simplify the condition test for _swrast_choose_texture_sample_func
remove another long if condition test. I don't feel a strong need of
this patch. But for it make the code a little simpler(I do think so),
I send it out.
Signed-off-by: Yuanhan Liu <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
-rw-r--r-- | src/mesa/swrast/s_texfilter.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 9de5c0276e1..56626255744 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -3647,25 +3647,21 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, const struct gl_texture_image *img = t->Image[0][t->BaseLevel]; const struct swrast_texture_image *swImg = swrast_texture_image_const(img); + texture_sample_func func; ASSERT(t->Sampler.MinFilter == GL_NEAREST); + func = &sample_nearest_2d; if (t->Sampler.WrapS == GL_REPEAT && t->Sampler.WrapT == GL_REPEAT && swImg->_IsPowerOfTwo && - img->Border == 0 && - img->TexFormat == MESA_FORMAT_RGB888) { - return &opt_sample_rgb_2d; - } - else if (t->Sampler.WrapS == GL_REPEAT && - t->Sampler.WrapT == GL_REPEAT && - swImg->_IsPowerOfTwo && - img->Border == 0 && - img->TexFormat == MESA_FORMAT_RGBA8888) { - return &opt_sample_rgba_2d; - } - else { - return &sample_nearest_2d; + img->Border == 0) { + if (img->TexFormat == MESA_FORMAT_RGB888) + func = &opt_sample_rgb_2d; + else if (img->TexFormat == MESA_FORMAT_RGBA8888) + func = &opt_sample_rgba_2d; } + + return func; } case GL_TEXTURE_3D: if (needLambda) { |