From 4c7883e402dd0733a56870f4517e455e46523cf4 Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Mon, 2 Feb 2004 07:46:27 +0000 Subject: fixed a bug in GL_NEAREST sampler --- src/mesa/swrast/s_texture.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/mesa/swrast/s_texture.c') diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index b5a4509c07..37e8ea86f3 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -1592,12 +1592,18 @@ sample_lambda_2d( GLcontext *ctx, GLuint texUnit, switch (tObj->MinFilter) { case GL_NEAREST: if (repeatNoBorderPOT) { - switch (tImg->Format) { - case GL_RGB: + switch (tImg->TexFormat->MesaFormat) { + case MESA_FORMAT_RGB: + case MESA_FORMAT_RGB888: + /*case MESA_FORMAT_BGR888:*/ opt_sample_rgb_2d(ctx, texUnit, tObj, m, texcoords + minStart, NULL, rgba + minStart); break; - case GL_RGBA: + case MESA_FORMAT_RGBA: + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_ARGB8888: + /*case MESA_FORMAT_ABGR8888:*/ + /*case MESA_FORMAT_BGRA8888:*/ opt_sample_rgba_2d(ctx, texUnit, tObj, m, texcoords + minStart, NULL, rgba + minStart); break; @@ -1649,12 +1655,18 @@ sample_lambda_2d( GLcontext *ctx, GLuint texUnit, switch (tObj->MagFilter) { case GL_NEAREST: if (repeatNoBorderPOT) { - switch (tImg->Format) { - case GL_RGB: + switch (tImg->TexFormat->MesaFormat) { + case MESA_FORMAT_RGB: + case MESA_FORMAT_RGB888: + /*case MESA_FORMAT_BGR888:*/ opt_sample_rgb_2d(ctx, texUnit, tObj, m, texcoords + magStart, NULL, rgba + magStart); break; - case GL_RGBA: + case MESA_FORMAT_RGBA: + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_ARGB8888: + /*case MESA_FORMAT_ABGR8888:*/ + /*case MESA_FORMAT_BGRA8888:*/ opt_sample_rgba_2d(ctx, texUnit, tObj, m, texcoords + magStart, NULL, rgba + magStart); break; -- cgit v1.2.3