diff options
author | Michal Krol <mjkrol@gmail.org> | 2006-04-04 10:22:05 +0000 |
---|---|---|
committer | Michal Krol <mjkrol@gmail.org> | 2006-04-04 10:22:05 +0000 |
commit | b7339d70237ffb460f158c61860ca225fec02e81 (patch) | |
tree | ef2053c99478e3b8efaafe36b6d3680a166e3990 | |
parent | b4e9750bf4996ca5bb622bbbe28be4f071811bc6 (diff) |
Fix texcoord interpolation for fragment shaders.
-rw-r--r-- | src/mesa/swrast/s_triangle.c | 21 |
1 files changed, 12 insertions, 9 deletions
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 |