summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_span.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r--src/mesa/swrast/s_span.c100
1 files changed, 50 insertions, 50 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 842f3be3c2..d6959e1f4c 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -1,4 +1,4 @@
-/* $Id: s_span.c,v 1.59 2003/03/16 22:02:37 brianp Exp $ */
+/* $Id: s_span.c,v 1.60 2003/03/25 02:23:47 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -57,7 +57,7 @@
* Used during setup for glDraw/CopyPixels.
*/
void
-_mesa_span_default_z( GLcontext *ctx, struct sw_span *span )
+_swrast_span_default_z( GLcontext *ctx, struct sw_span *span )
{
if (ctx->Visual.depthBits <= 16)
span->z = FloatToFixed(ctx->Current.RasterPos[2] * ctx->DepthMax + 0.5F);
@@ -73,9 +73,9 @@ _mesa_span_default_z( GLcontext *ctx, struct sw_span *span )
* Used during setup for glDraw/CopyPixels.
*/
void
-_mesa_span_default_fog( GLcontext *ctx, struct sw_span *span )
+_swrast_span_default_fog( GLcontext *ctx, struct sw_span *span )
{
- span->fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
+ span->fog = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
span->fogStep = span->dfogdx = span->dfogdy = 0.0F;
span->interpMask |= SPAN_FOG;
}
@@ -86,7 +86,7 @@ _mesa_span_default_fog( GLcontext *ctx, struct sw_span *span )
* Used during setup for glDraw/CopyPixels.
*/
void
-_mesa_span_default_color( GLcontext *ctx, struct sw_span *span )
+_swrast_span_default_color( GLcontext *ctx, struct sw_span *span )
{
if (ctx->Visual.rgbMode) {
GLchan r, g, b, a;
@@ -124,7 +124,7 @@ _mesa_span_default_color( GLcontext *ctx, struct sw_span *span )
* Used during setup for glDraw/CopyPixels.
*/
void
-_mesa_span_default_texcoords( GLcontext *ctx, struct sw_span *span )
+_swrast_span_default_texcoords( GLcontext *ctx, struct sw_span *span )
{
GLuint i;
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
@@ -267,7 +267,7 @@ interpolate_specular(GLcontext *ctx, struct sw_span *span)
/* Fill in the span.zArray array from the interpolation values */
void
-_mesa_span_interpolate_z( const GLcontext *ctx, struct sw_span *span )
+_swrast_span_interpolate_z( const GLcontext *ctx, struct sw_span *span )
{
const GLuint n = span->end;
GLuint i;
@@ -322,7 +322,7 @@ compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
* This is a faster approximation
*/
GLfloat
-_mesa_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
+_swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
GLfloat dqdx, GLfloat dqdy, GLfloat texW, GLfloat texH,
GLfloat s, GLfloat t, GLfloat q, GLfloat invQ)
{
@@ -386,7 +386,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
texcoord[i][1] = t * invQ;
texcoord[i][2] = r * invQ;
texcoord[i][3] = q;
- lambda[i] = _mesa_compute_lambda(dsdx, dsdy, dtdx, dtdy,
+ lambda[i] = _swrast_compute_lambda(dsdx, dsdy, dtdx, dtdy,
dqdx, dqdy, texW, texH,
s, t, q, invQ);
s += dsdx;
@@ -465,7 +465,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
GLuint i;
for (i = 0; i < span->end; i++) {
const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
- lambda[i] = _mesa_compute_lambda(dsdx, dsdy, dtdx, dtdy,
+ lambda[i] = _swrast_compute_lambda(dsdx, dsdy, dtdx, dtdy,
dqdx, dqdy, texW, texH,
s, t, q, invQ);
texcoord[i][0] = s * invQ;
@@ -641,11 +641,11 @@ multi_write_index_span( GLcontext *ctx, struct sw_span *span )
MEMCPY( indexTmp, span->array->index, span->end * sizeof(GLuint) );
if (ctx->Color.IndexLogicOpEnabled) {
- _mesa_logicop_ci_span(ctx, span, indexTmp);
+ _swrast_logicop_ci_span(ctx, span, indexTmp);
}
if (ctx->Color.IndexMask != 0xffffffff) {
- _mesa_mask_index_span(ctx, span, indexTmp);
+ _swrast_mask_index_span(ctx, span, indexTmp);
}
if (span->arrayMask & SPAN_XY) {
@@ -698,14 +698,14 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
MEMCPY( rgbaTmp, span->array->rgba, 4 * span->end * sizeof(GLchan) );
if (ctx->Color.ColorLogicOpEnabled) {
- _mesa_logicop_rgba_span(ctx, span, rgbaTmp);
+ _swrast_logicop_rgba_span(ctx, span, rgbaTmp);
}
else if (ctx->Color.BlendEnabled) {
- _mesa_blend_span(ctx, span, rgbaTmp);
+ _swrast_blend_span(ctx, span, rgbaTmp);
}
if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_span(ctx, span, rgbaTmp);
+ _swrast_mask_rgba_span(ctx, span, rgbaTmp);
}
if (span->arrayMask & SPAN_XY) {
@@ -715,7 +715,7 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
(const GLchan (*)[4]) rgbaTmp,
span->array->mask);
if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_pixels(ctx, span->end,
+ _swrast_write_alpha_pixels(ctx, span->end,
span->array->x, span->array->y,
(const GLchan (*)[4]) rgbaTmp,
span->array->mask);
@@ -727,7 +727,7 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
(const GLchan (*)[4]) rgbaTmp,
span->array->mask);
if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_span(ctx, span->end, span->x, span->y,
+ _swrast_write_alpha_span(ctx, span->end, span->x, span->y,
(const GLchan (*)[4]) rgbaTmp,
span->array->mask);
}
@@ -747,7 +747,7 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
* to their original values before returning.
*/
void
-_mesa_write_index_span( GLcontext *ctx, struct sw_span *span)
+_swrast_write_index_span( GLcontext *ctx, struct sw_span *span)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLuint origInterpMask = span->interpMask;
@@ -797,17 +797,17 @@ _mesa_write_index_span( GLcontext *ctx, struct sw_span *span)
/* Depth test and stencil */
if (ctx->Depth.Test || ctx->Stencil.Enabled) {
if (span->interpMask & SPAN_Z)
- _mesa_span_interpolate_z(ctx, span);
+ _swrast_span_interpolate_z(ctx, span);
if (ctx->Stencil.Enabled) {
- if (!_mesa_stencil_and_ztest_span(ctx, span)) {
+ if (!_swrast_stencil_and_ztest_span(ctx, span)) {
span->arrayMask = origArrayMask;
return;
}
}
else {
ASSERT(ctx->Depth.Test);
- if (!_mesa_depth_test_span(ctx, span)) {
+ if (!_swrast_depth_test_span(ctx, span)) {
span->arrayMask = origArrayMask;
return;
}
@@ -833,7 +833,7 @@ _mesa_write_index_span( GLcontext *ctx, struct sw_span *span)
/* Fog */
if (ctx->Fog.Enabled) {
- _mesa_fog_ci_span(ctx, span);
+ _swrast_fog_ci_span(ctx, span);
}
/* Antialias coverage application */
@@ -854,11 +854,11 @@ _mesa_write_index_span( GLcontext *ctx, struct sw_span *span)
else {
/* normal situation: draw to exactly one buffer */
if (ctx->Color.IndexLogicOpEnabled) {
- _mesa_logicop_ci_span(ctx, span, span->array->index);
+ _swrast_logicop_ci_span(ctx, span, span->array->index);
}
if (ctx->Color.IndexMask != 0xffffffff) {
- _mesa_mask_index_span(ctx, span, span->array->index);
+ _swrast_mask_index_span(ctx, span, span->array->index);
}
/* write pixels */
@@ -904,7 +904,7 @@ _mesa_write_index_span( GLcontext *ctx, struct sw_span *span)
* to their original values before returning.
*/
void
-_mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span)
+_swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
@@ -978,7 +978,7 @@ _mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span)
/* Do the alpha test */
if (ctx->Color.AlphaEnabled) {
- if (!_mesa_alpha_test(ctx, span)) {
+ if (!_swrast_alpha_test(ctx, span)) {
span->interpMask = origInterpMask;
span->arrayMask = origArrayMask;
return;
@@ -988,10 +988,10 @@ _mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span)
/* Stencil and Z testing */
if (ctx->Stencil.Enabled || ctx->Depth.Test) {
if (span->interpMask & SPAN_Z)
- _mesa_span_interpolate_z(ctx, span);
+ _swrast_span_interpolate_z(ctx, span);
if (ctx->Stencil.Enabled) {
- if (!_mesa_stencil_and_ztest_span(ctx, span)) {
+ if (!_swrast_stencil_and_ztest_span(ctx, span)) {
span->interpMask = origInterpMask;
span->arrayMask = origArrayMask;
return;
@@ -1001,7 +1001,7 @@ _mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span)
ASSERT(ctx->Depth.Test);
ASSERT(span->arrayMask & SPAN_Z);
/* regular depth testing */
- if (!_mesa_depth_test_span(ctx, span)) {
+ if (!_swrast_depth_test_span(ctx, span)) {
span->interpMask = origInterpMask;
span->arrayMask = origArrayMask;
return;
@@ -1028,7 +1028,7 @@ _mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span)
/* Fog */
if (ctx->Fog.Enabled) {
- _mesa_fog_rgba_span(ctx, span);
+ _swrast_fog_rgba_span(ctx, span);
monoColor = GL_FALSE;
}
@@ -1049,17 +1049,17 @@ _mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span)
else {
/* normal: write to exactly one buffer */
if (ctx->Color.ColorLogicOpEnabled) {
- _mesa_logicop_rgba_span(ctx, span, span->array->rgba);
+ _swrast_logicop_rgba_span(ctx, span, span->array->rgba);
monoColor = GL_FALSE;
}
else if (ctx->Color.BlendEnabled) {
- _mesa_blend_span(ctx, span, span->array->rgba);
+ _swrast_blend_span(ctx, span, span->array->rgba);
monoColor = GL_FALSE;
}
/* Color component masking */
if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_span(ctx, span, span->array->rgba);
+ _swrast_mask_rgba_span(ctx, span, span->array->rgba);
monoColor = GL_FALSE;
}
@@ -1070,7 +1070,7 @@ _mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span)
(*swrast->Driver.WriteRGBAPixels)(ctx, span->end, span->array->x,
span->array->y, (const GLchan (*)[4]) span->array->rgba, span->array->mask);
if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_pixels(ctx, span->end,
+ _swrast_write_alpha_pixels(ctx, span->end,
span->array->x, span->array->y,
(const GLchan (*)[4]) span->array->rgba,
span->array->mask);
@@ -1088,7 +1088,7 @@ _mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span)
(*swrast->Driver.WriteMonoRGBASpan)(ctx, span->end, span->x,
span->y, color, span->array->mask);
if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_mono_alpha_span(ctx, span->end, span->x, span->y,
+ _swrast_write_mono_alpha_span(ctx, span->end, span->x, span->y,
color[ACOMP],
span->writeAll ? ((const GLubyte *) NULL) : span->array->mask);
}
@@ -1099,7 +1099,7 @@ _mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span)
(const GLchan (*)[4]) span->array->rgba,
span->writeAll ? ((const GLubyte *) NULL) : span->array->mask);
if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_span(ctx, span->end, span->x, span->y,
+ _swrast_write_alpha_span(ctx, span->end, span->x, span->y,
(const GLchan (*)[4]) span->array->rgba,
span->writeAll ? ((const GLubyte *) NULL) : span->array->mask);
}
@@ -1144,7 +1144,7 @@ add_colors(GLuint n, GLchan rgba[][4], GLchan specular[][4] )
* to their original values before returning.
*/
void
-_mesa_write_texture_span( GLcontext *ctx, struct sw_span *span)
+_swrast_write_texture_span( GLcontext *ctx, struct sw_span *span)
{
const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -1216,7 +1216,7 @@ _mesa_write_texture_span( GLcontext *ctx, struct sw_span *span)
_swrast_texture_span( ctx, span );
/* Do the alpha test */
- if (!_mesa_alpha_test(ctx, span)) {
+ if (!_swrast_alpha_test(ctx, span)) {
span->arrayMask = origArrayMask;
return;
}
@@ -1225,10 +1225,10 @@ _mesa_write_texture_span( GLcontext *ctx, struct sw_span *span)
/* Stencil and Z testing */
if (ctx->Stencil.Enabled || ctx->Depth.Test) {
if (span->interpMask & SPAN_Z)
- _mesa_span_interpolate_z(ctx, span);
+ _swrast_span_interpolate_z(ctx, span);
if (ctx->Stencil.Enabled) {
- if (!_mesa_stencil_and_ztest_span(ctx, span)) {
+ if (!_swrast_stencil_and_ztest_span(ctx, span)) {
span->arrayMask = origArrayMask;
return;
}
@@ -1237,7 +1237,7 @@ _mesa_write_texture_span( GLcontext *ctx, struct sw_span *span)
ASSERT(ctx->Depth.Test);
ASSERT(span->arrayMask & SPAN_Z);
/* regular depth testing */
- if (!_mesa_depth_test_span(ctx, span)) {
+ if (!_swrast_depth_test_span(ctx, span)) {
span->arrayMask = origArrayMask;
return;
}
@@ -1283,7 +1283,7 @@ _mesa_write_texture_span( GLcontext *ctx, struct sw_span *span)
/* Fog */
if (ctx->Fog.Enabled) {
- _mesa_fog_rgba_span(ctx, span);
+ _swrast_fog_rgba_span(ctx, span);
}
/* Antialias coverage application */
@@ -1302,14 +1302,14 @@ _mesa_write_texture_span( GLcontext *ctx, struct sw_span *span)
else {
/* normal: write to exactly one buffer */
if (ctx->Color.ColorLogicOpEnabled) {
- _mesa_logicop_rgba_span(ctx, span, span->array->rgba);
+ _swrast_logicop_rgba_span(ctx, span, span->array->rgba);
}
else if (ctx->Color.BlendEnabled) {
- _mesa_blend_span(ctx, span, span->array->rgba);
+ _swrast_blend_span(ctx, span, span->array->rgba);
}
if (colorMask != 0xffffffff) {
- _mesa_mask_rgba_span(ctx, span, span->array->rgba);
+ _swrast_mask_rgba_span(ctx, span, span->array->rgba);
}
@@ -1318,7 +1318,7 @@ _mesa_write_texture_span( GLcontext *ctx, struct sw_span *span)
(*swrast->Driver.WriteRGBAPixels)(ctx, span->end, span->array->x,
span->array->y, (const GLchan (*)[4]) span->array->rgba, span->array->mask);
if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_pixels(ctx, span->end,
+ _swrast_write_alpha_pixels(ctx, span->end,
span->array->x, span->array->y,
(const GLchan (*)[4]) span->array->rgba,
span->array->mask);
@@ -1330,7 +1330,7 @@ _mesa_write_texture_span( GLcontext *ctx, struct sw_span *span)
(const GLchan (*)[4]) span->array->rgba,
span->writeAll ? NULL : span->array->mask);
if (swrast->_RasterMask & ALPHABUF_BIT) {
- _mesa_write_alpha_span(ctx, span->end, span->x, span->y,
+ _swrast_write_alpha_span(ctx, span->end, span->x, span->y,
(const GLchan (*)[4]) span->array->rgba,
span->writeAll ? NULL : span->array->mask);
}
@@ -1347,7 +1347,7 @@ _mesa_write_texture_span( GLcontext *ctx, struct sw_span *span)
* reading ouside the buffer's boundaries.
*/
void
-_mesa_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer,
+_swrast_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer,
GLuint n, GLint x, GLint y, GLchan rgba[][4] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -1390,7 +1390,7 @@ _mesa_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer,
(*swrast->Driver.ReadRGBASpan)( ctx, length, x + skip, y, rgba + skip );
if (buffer->UseSoftwareAlphaBuffers) {
- _mesa_read_alpha_span(ctx, length, x + skip, y, rgba + skip);
+ _swrast_read_alpha_span(ctx, length, x + skip, y, rgba + skip);
}
}
}
@@ -1401,7 +1401,7 @@ _mesa_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer,
* reading ouside the buffer's boundaries.
*/
void
-_mesa_read_index_span( GLcontext *ctx, GLframebuffer *buffer,
+_swrast_read_index_span( GLcontext *ctx, GLframebuffer *buffer,
GLuint n, GLint x, GLint y, GLuint indx[] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);