static INLINE void
interpolate_int_colors(struct gl_context *ctx, SWspan *span)
{
+#if CHAN_BITS != 32
const GLuint n = span->end;
GLuint i;
-#if CHAN_BITS != 32
ASSERT(!(span->arrayMask & SPAN_RGBA));
#endif
interpolate_active_attribs(ctx, span, FRAG_BIT_COL0);
break;
default:
- _mesa_problem(NULL, "bad datatype in interpolate_int_colors");
+ _mesa_problem(ctx, "bad datatype 0x%x in interpolate_int_colors",
+ span->array->ChanType);
}
span->arrayMask |= SPAN_RGBA;
}
if (obj) {
const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
- needLambda = (obj->MinFilter != obj->MagFilter)
+ const struct swrast_texture_image *swImg =
+ swrast_texture_image_const(img);
+
+ needLambda = (obj->Sampler.MinFilter != obj->Sampler.MagFilter)
|| ctx->FragmentProgram._Current;
- texW = img->WidthScale;
- texH = img->HeightScale;
+ /* LOD is calculated directly in the ansiotropic filter, we can
+ * skip the normal lambda function as the result is ignored.
+ */
+ if (obj->Sampler.MaxAnisotropy > 1.0 &&
+ obj->Sampler.MinFilter == GL_LINEAR_MIPMAP_LINEAR) {
+ needLambda = GL_FALSE;
+ }
+ texW = swImg->WidthScale;
+ texH = swImg->HeightScale;
}
else {
/* using a fragment program */
static INLINE void
shade_texture_span(struct gl_context *ctx, SWspan *span)
{
- GLbitfield inputsRead;
-
- /* Determine which fragment attributes are actually needed */
- if (ctx->FragmentProgram._Current) {
- inputsRead = ctx->FragmentProgram._Current->Base.InputsRead;
- }
- else {
- /* XXX we could be a bit smarter about this */
- inputsRead = ~0;
- }
-
if (ctx->FragmentProgram._Current ||
ctx->ATIFragmentShader._Enabled) {
/* programmable shading */
ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB ||
rb->_BaseFormat == GL_ALPHA);
- if (ctx->Color._LogicOpEnabled) {
+ if (ctx->Color.ColorLogicOpEnabled) {
_swrast_logicop_rgba_span(ctx, rb, span);
}
else if ((ctx->Color.BlendEnabled >> buf) & 1) {
ASSERT(rb);
ASSERT(rb->GetRow);
- ASSERT(rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RGBA ||
+ ASSERT(rb->_BaseFormat == GL_RGBA ||
+ rb->_BaseFormat == GL_RGB ||
+ rb->_BaseFormat == GL_RG ||
+ rb->_BaseFormat == GL_RED ||
+ rb->_BaseFormat == GL_LUMINANCE ||
+ rb->_BaseFormat == GL_INTENSITY ||
+ rb->_BaseFormat == GL_LUMINANCE_ALPHA ||
rb->_BaseFormat == GL_ALPHA);
if (rb->DataType == dstType) {