From b7339d70237ffb460f158c61860ca225fec02e81 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 4 Apr 2006 10:22:05 +0000 Subject: Fix texcoord interpolation for fragment shaders. --- src/mesa/swrast/s_triangle.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 440bbebce5..2716bb1fa2 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -883,7 +883,7 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, /* * This is the big one! - * Interpolate Z, RGB, Alpha, specular, fog, and N sets of texture coordinates. + * Interpolate Z, RGB, Alpha, specular, fog, N sets of texture coordinates, and varying floats. * Yup, it's slow. */ #define NAME multitextured_triangle @@ -893,7 +893,8 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, #define INTERP_RGB 1 #define INTERP_ALPHA 1 #define INTERP_SPEC 1 -#define INTERP_MULTITEX 1 +#define INTERP_MULTITEX 1 +#define INTERP_VARYING 1 #define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span); #include "s_tritemp.h" @@ -1072,9 +1073,10 @@ _swrast_choose_triangle( GLcontext *ctx ) } } - if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled) { + if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Active || + ctx->ATIFragmentShader._Enabled || ctx->ShaderObjects._FragmentShaderPresent) { /* Ugh, we do a _lot_ of tests to pick the best textured tri func */ - const struct gl_texture_object *texObj2D; + const struct gl_texture_object *texObj2D; const struct gl_texture_image *texImg; GLenum minFilter, magFilter, envMode; GLint format; @@ -1088,17 +1090,18 @@ _swrast_choose_triangle( GLcontext *ctx ) /* First see if we can use an optimized 2-D texture function */ if (ctx->Texture._EnabledCoordUnits == 0x1 && !ctx->FragmentProgram._Active - && !ctx->ATIFragmentShader._Enabled + && !ctx->ATIFragmentShader._Enabled + && !ctx->ShaderObjects._FragmentShaderPresent && ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT && texObj2D->WrapS == GL_REPEAT - && texObj2D->WrapT == GL_REPEAT + && texObj2D->WrapT == GL_REPEAT && texImg->_IsPowerOfTwo && texImg->Border == 0 && texImg->Width == texImg->RowStride && (format == MESA_FORMAT_RGB || format == MESA_FORMAT_RGBA) - && minFilter == magFilter - && ctx->Light.Model.ColorControl == GL_SINGLE_COLOR - && ctx->Texture.Unit[0].EnvMode != GL_COMBINE_EXT) { + && minFilter == magFilter + && ctx->Light.Model.ColorControl == GL_SINGLE_COLOR + && ctx->Texture.Unit[0].EnvMode != GL_COMBINE_EXT) { if (ctx->Hint.PerspectiveCorrection==GL_FASTEST) { if (minFilter == GL_NEAREST && format == MESA_FORMAT_RGB -- cgit v1.2.3