* and glBitmap.
*/
void
-_swrast_span_default_attribs(GLcontext *ctx, SWspan *span)
+_swrast_span_default_attribs(struct gl_context *ctx, SWspan *span)
{
GLchan r, g, b, a;
/* Z*/
* should have computed attrStart/Step values for FRAG_ATTRIB_WPOS[3]!
*/
static INLINE void
-interpolate_active_attribs(GLcontext *ctx, SWspan *span, GLbitfield attrMask)
+interpolate_active_attribs(struct gl_context *ctx, SWspan *span, GLbitfield attrMask)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
* color array.
*/
static INLINE void
-interpolate_int_colors(GLcontext *ctx, SWspan *span)
+interpolate_int_colors(struct gl_context *ctx, SWspan *span)
{
const GLuint n = span->end;
GLuint i;
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;
}
* Fill in the span.zArray array from the span->z, zStep values.
*/
void
-_swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span )
+_swrast_span_interpolate_z( const struct gl_context *ctx, SWspan *span )
{
const GLuint n = span->end;
GLuint i;
* texels with (s/q, t/q, r/q).
*/
static void
-interpolate_texcoords(GLcontext *ctx, SWspan *span)
+interpolate_texcoords(struct gl_context *ctx, SWspan *span)
{
const GLuint maxUnit
= (ctx->Texture._EnabledCoordUnits > 1) ? ctx->Const.MaxTextureUnits : 1;
if (obj) {
const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
- needLambda = (obj->MinFilter != obj->MagFilter)
+ needLambda = (obj->Sampler.MinFilter != obj->Sampler.MagFilter)
|| ctx->FragmentProgram._Current;
+ /* 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 = img->WidthScale;
texH = img->HeightScale;
}
* Fill in the arrays->attribs[FRAG_ATTRIB_WPOS] array.
*/
static INLINE void
-interpolate_wpos(GLcontext *ctx, SWspan *span)
+interpolate_wpos(struct gl_context *ctx, SWspan *span)
{
GLfloat (*wpos)[4] = span->array->attribs[FRAG_ATTRIB_WPOS];
GLuint i;
* Apply the current polygon stipple pattern to a span of pixels.
*/
static INLINE void
-stipple_polygon_span(GLcontext *ctx, SWspan *span)
+stipple_polygon_span(struct gl_context *ctx, SWspan *span)
{
GLubyte *mask = span->array->mask;
* GL_FALSE nothing visible
*/
static INLINE GLuint
-clip_span( GLcontext *ctx, SWspan *span )
+clip_span( struct gl_context *ctx, SWspan *span )
{
const GLint xmin = ctx->DrawBuffer->_Xmin;
const GLint xmax = ctx->DrawBuffer->_Xmax;
* Result is float color array (FRAG_ATTRIB_COL0).
*/
static INLINE void
-add_specular(GLcontext *ctx, SWspan *span)
+add_specular(struct gl_context *ctx, SWspan *span)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLubyte *mask = span->array->mask;
* Apply fragment shader, fragment program or normal texturing to span.
*/
static INLINE void
-shade_texture_span(GLcontext *ctx, SWspan *span)
+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 */
* to their original values before returning.
*/
void
-_swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
+_swrast_write_rgba_span( struct gl_context *ctx, SWspan *span)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLuint *colorMask = (GLuint *) ctx->Color.ColorMask;
4 * span->end * sizeof(GLchan));
}
- ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB);
+ ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB ||
+ rb->_BaseFormat == GL_ALPHA);
if (ctx->Color._LogicOpEnabled) {
_swrast_logicop_rgba_span(ctx, rb, span);
* \param rgba the returned colors
*/
void
-_swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_read_rgba_span( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y, GLenum dstType,
GLvoid *rgba)
{
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) {
rb->GetRow(ctx, rb, length, x + skip, y,
* values array.
*/
void
-_swrast_get_values(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_get_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, const GLint x[], const GLint y[],
void *values, GLuint valueSize)
{
* \param valueSize size of each value (pixel) in bytes
*/
void
-_swrast_put_row(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_put_row(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, GLint x, GLint y,
const GLvoid *values, GLuint valueSize)
{
* \param valueSize size of each value (pixel) in bytes
*/
void
-_swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_get_row(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, GLint x, GLint y,
GLvoid *values, GLuint valueSize)
{
* \return pointer to the colors we read.
*/
void *
-_swrast_get_dest_rgba(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_get_dest_rgba(struct gl_context *ctx, struct gl_renderbuffer *rb,
SWspan *span)
{
const GLuint pixelSize = RGBA_PIXEL_SIZE(span->array->ChanType);