/**
* Interpolate primary colors to fill in the span->array->color array.
*/
-static void
+static INLINE void
interpolate_colors(SWspan *span)
{
const GLuint n = span->end;
/**
* Interpolate specular/secondary colors.
*/
-static void
+static INLINE void
interpolate_specular(SWspan *span)
{
const GLuint n = span->end;
/* Fill in the span.color.index array from the interpolation values */
-static void
+static INLINE void
interpolate_indexes(GLcontext *ctx, SWspan *span)
{
GLfixed index = span->index;
/* Fill in the span.array.fog values from the interpolation values */
-static void
+static INLINE void
interpolate_fog(const GLcontext *ctx, SWspan *span)
{
GLfloat *fog = span->array->fog;
/**
* Fill in the span.varying array from the interpolation values.
*/
-static void
+static INLINE void
interpolate_varying(GLcontext *ctx, SWspan *span)
{
GLuint i, j;
/**
* Apply the current polygon stipple pattern to a span of pixels.
*/
-static void
+static INLINE void
stipple_polygon_span( GLcontext *ctx, SWspan *span )
{
const GLuint highbit = 0x80000000;
* Return: GL_TRUE some pixels still visible
* GL_FALSE nothing visible
*/
-static GLuint
+static INLINE GLuint
clip_span( GLcontext *ctx, SWspan *span )
{
const GLint xmin = ctx->DrawBuffer->_Xmin;
* Add specular color to base color. This is used only when
* GL_LIGHT_MODEL_COLOR_CONTROL = GL_SEPARATE_SPECULAR_COLOR.
*/
-static void
+static INLINE void
add_specular(GLcontext *ctx, SWspan *span)
{
switch (span->array->ChanType) {
/**
* Apply antialiasing coverage value to alpha values.
*/
-static void
+static INLINE void
apply_aa_coverage(SWspan *span)
{
const GLfloat *coverage = span->array->coverage;
/**
* Clamp span's float colors to [0,1]
*/
-static void
+static INLINE void
clamp_colors(SWspan *span)
{
GLfloat (*rgba)[4] = span->array->color.sz4.rgba;
/**
* Convert the span's color arrays to the given type.
*/
-static void
+static INLINE void
convert_color_type(GLcontext *ctx, SWspan *span, GLenum newType)
{
GLvoid *src, *dst;
/**
* Apply fragment shader, fragment program or normal texturing to span.
*/
-static void
+static INLINE void
shade_texture_span(GLcontext *ctx, SWspan *span)
{
/* Now we need the rgba array, fill it in if needed */
if (span->interpMask & SPAN_RGBA)
interpolate_colors(span);
+ if (ctx->Texture._EnabledCoordUnits && (span->interpMask & SPAN_TEXTURE))
+ interpolate_texcoords(ctx, span);
+
if (ctx->ShaderObjects._FragmentShaderPresent ||
ctx->FragmentProgram._Enabled ||
ctx->ATIFragmentShader._Enabled) {
if (span->interpMask & SPAN_Z)
_swrast_span_interpolate_z (ctx, span);
+ if (ctx->ShaderObjects._FragmentShaderPresent)
+ interpolate_varying(ctx, span);
+
/* Run fragment program/shader now */
if (ctx->ShaderObjects._FragmentShaderPresent) {
_swrast_exec_arbshader (ctx, span);
stipple_polygon_span(ctx, span);
}
- /* Interpolate texcoords? */
- if (ctx->Texture._EnabledCoordUnits && (span->interpMask & SPAN_TEXTURE)) {
- interpolate_texcoords(ctx, span);
- }
-
- if (ctx->ShaderObjects._FragmentShaderPresent) {
- interpolate_varying(ctx, span);
- }
-
/* This is the normal place to compute the resulting fragment color/Z.
* As an optimization, we try to defer this until after Z/stencil
* testing in order to try to avoid computing colors that we won't