projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
652a14a
)
interpolate fog valus as floats, not fixed - fixed the swrast fog problem
author
Brian Paul
<brian.paul@tungstengraphics.com>
Thu, 3 May 2001 22:13:32 +0000
(22:13 +0000)
committer
Brian Paul
<brian.paul@tungstengraphics.com>
Thu, 3 May 2001 22:13:32 +0000
(22:13 +0000)
14 files changed:
src/mesa/swrast/s_aalinetemp.h
patch
|
blob
|
history
src/mesa/swrast/s_aatritemp.h
patch
|
blob
|
history
src/mesa/swrast/s_bitmap.c
patch
|
blob
|
history
src/mesa/swrast/s_fog.c
patch
|
blob
|
history
src/mesa/swrast/s_fog.h
patch
|
blob
|
history
src/mesa/swrast/s_lines.c
patch
|
blob
|
history
src/mesa/swrast/s_linetemp.h
patch
|
blob
|
history
src/mesa/swrast/s_span.c
patch
|
blob
|
history
src/mesa/swrast/s_span.h
patch
|
blob
|
history
src/mesa/swrast/s_texstore.c
patch
|
blob
|
history
src/mesa/swrast/s_triangle.c
patch
|
blob
|
history
src/mesa/swrast/s_tritemp.h
patch
|
blob
|
history
src/mesa/swrast/s_zoom.c
patch
|
blob
|
history
src/mesa/swrast/s_zoom.h
patch
|
blob
|
history
diff --git
a/src/mesa/swrast/s_aalinetemp.h
b/src/mesa/swrast/s_aalinetemp.h
index 9ab1abb292eab08f59c5971a8f2041fead1999d5..53a2b55ddf5225f3f4553a206be6874c68a44846 100644
(file)
--- a/
src/mesa/swrast/s_aalinetemp.h
+++ b/
src/mesa/swrast/s_aalinetemp.h
@@
-1,4
+1,4
@@
-/* $Id: s_aalinetemp.h,v 1.
7 2001/03/12 00:48:41 gareth
Exp $ */
+/* $Id: s_aalinetemp.h,v 1.
8 2001/05/03 22:13:32 brianp
Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-41,7
+41,7
@@
NAME(plot)(GLcontext *ctx, const struct LineInfo *line,
const GLfloat fy = (GLfloat) iy;
const GLfloat coverage = compute_coveragef(line, ix, iy);
GLdepth z;
const GLfloat fy = (GLfloat) iy;
const GLfloat coverage = compute_coveragef(line, ix, iy);
GLdepth z;
- GLf
ixed
fog;
+ GLf
loat
fog;
GLchan red, green, blue, alpha;
GLint frac, indx, index;
GLchan specRed, specGreen, specBlue;
GLchan red, green, blue, alpha;
GLint frac, indx, index;
GLchan specRed, specGreen, specBlue;
@@
-60,9
+60,9
@@
NAME(plot)(GLcontext *ctx, const struct LineInfo *line,
z = 0.0;
#endif
#ifdef DO_FOG
z = 0.0;
#endif
#ifdef DO_FOG
- fog =
FloatToFixed( solve_plane(fx, fy, line->fPlane)
);
+ fog =
solve_plane(fx, fy, line->fPlane
);
#else
#else
- fog = 0;
+ fog = 0
.0
;
#endif
#ifdef DO_RGBA
red = solve_plane_chan(fx, fy, line->rPlane);
#endif
#ifdef DO_RGBA
red = solve_plane_chan(fx, fy, line->rPlane);
diff --git
a/src/mesa/swrast/s_aatritemp.h
b/src/mesa/swrast/s_aatritemp.h
index 41ef99cbfbd63fc3147433254b2c930c6d650e81..ae5abfcd7eab89e131bb4d5bc27873211432725e 100644
(file)
--- a/
src/mesa/swrast/s_aatritemp.h
+++ b/
src/mesa/swrast/s_aatritemp.h
@@
-1,4
+1,4
@@
-/* $Id: s_aatritemp.h,v 1.
9 2001/03/28 21:36:31
brianp Exp $ */
+/* $Id: s_aatritemp.h,v 1.
10 2001/05/03 22:13:32
brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-56,7
+56,7
@@
GLfloat zPlane[4]; /* Z (depth) */
GLdepth z[MAX_WIDTH];
GLfloat fogPlane[4];
GLfloat zPlane[4]; /* Z (depth) */
GLdepth z[MAX_WIDTH];
GLfloat fogPlane[4];
- GLf
ixed
fog[MAX_WIDTH];
+ GLf
loat
fog[MAX_WIDTH];
#endif
#ifdef DO_RGBA
GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4]; /* color */
#endif
#ifdef DO_RGBA
GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4]; /* color */
@@
-270,7
+270,7
@@
while (coverage > 0.0F) {
#ifdef DO_Z
z[count] = (GLdepth) solve_plane(ix, iy, zPlane);
while (coverage > 0.0F) {
#ifdef DO_Z
z[count] = (GLdepth) solve_plane(ix, iy, zPlane);
- fog[count] =
FloatToFixed(solve_plane(ix, iy, fogPlane)
);
+ fog[count] =
solve_plane(ix, iy, fogPlane
);
#endif
#ifdef DO_RGBA
rgba[count][RCOMP] = solve_plane_chan(ix, iy, rPlane);
#endif
#ifdef DO_RGBA
rgba[count][RCOMP] = solve_plane_chan(ix, iy, rPlane);
@@
-386,7
+386,7
@@
while (coverage > 0.0F) {
#ifdef DO_Z
z[ix] = (GLdepth) solve_plane(ix, iy, zPlane);
while (coverage > 0.0F) {
#ifdef DO_Z
z[ix] = (GLdepth) solve_plane(ix, iy, zPlane);
- fog[ix] =
FloatToFixed(solve_plane(ix, iy, fogPlane)
);
+ fog[ix] =
solve_plane(ix, iy, fogPlane
);
#endif
#ifdef DO_RGBA
rgba[ix][RCOMP] = solve_plane_chan(ix, iy, rPlane);
#endif
#ifdef DO_RGBA
rgba[ix][RCOMP] = solve_plane_chan(ix, iy, rPlane);
diff --git
a/src/mesa/swrast/s_bitmap.c
b/src/mesa/swrast/s_bitmap.c
index d22579c02f38d855b2f172def88e938b17998baa..d91319c01b8268e2a089ff04a8cac16c75fac17e 100644
(file)
--- a/
src/mesa/swrast/s_bitmap.c
+++ b/
src/mesa/swrast/s_bitmap.c
@@
-1,4
+1,4
@@
-/* $Id: s_bitmap.c,v 1.
7 2001/03/19 02:25:36 keithw
Exp $ */
+/* $Id: s_bitmap.c,v 1.
8 2001/05/03 22:13:32 brianp
Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-49,7
+49,7
@@
_swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
struct pixel_buffer *PB = swrast->PB;
GLint row, col;
GLdepth fragZ;
struct pixel_buffer *PB = swrast->PB;
GLint row, col;
GLdepth fragZ;
- GLf
ixed
fogCoord;
+ GLf
loat
fogCoord;
ASSERT(ctx->RenderMode == GL_RENDER);
ASSERT(bitmap);
ASSERT(ctx->RenderMode == GL_RENDER);
ASSERT(bitmap);
diff --git
a/src/mesa/swrast/s_fog.c
b/src/mesa/swrast/s_fog.c
index cc55913f37d0c982806e2f47d6a461e878ef6030..4b8c4f0c71e26893c49228d68857aeb2f21a201c 100644
(file)
--- a/
src/mesa/swrast/s_fog.c
+++ b/
src/mesa/swrast/s_fog.c
@@
-1,4
+1,4
@@
-/* $Id: s_fog.c,v 1.1
1 2001/03/12 00:48:42 gareth
Exp $ */
+/* $Id: s_fog.c,v 1.1
2 2001/05/03 22:13:32 brianp
Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-46,7
+46,7
@@
void
_mesa_fog_rgba_pixels( const GLcontext *ctx,
GLuint n,
void
_mesa_fog_rgba_pixels( const GLcontext *ctx,
GLuint n,
- const GLf
ixed
fog[],
+ const GLf
loat
fog[],
GLchan rgba[][4] )
{
GLuint i;
GLchan rgba[][4] )
{
GLuint i;
@@
-56,24
+56,13
@@
_mesa_fog_rgba_pixels( const GLcontext *ctx,
UNCLAMPED_FLOAT_TO_CHAN(gFog, ctx->Fog.Color[GCOMP]);
UNCLAMPED_FLOAT_TO_CHAN(bFog, ctx->Fog.Color[BCOMP]);
UNCLAMPED_FLOAT_TO_CHAN(gFog, ctx->Fog.Color[GCOMP]);
UNCLAMPED_FLOAT_TO_CHAN(bFog, ctx->Fog.Color[BCOMP]);
-#if CHAN_TYPE == GL_FLOAT
for (i = 0; i < n; i++) {
for (i = 0; i < n; i++) {
- const GLfixed cf = CLAMP(fog[i], 0, FIXED_ONE);
- const GLfloat f = FixedToFloat(cf);
- const GLfloat g = 1.0F - f;
+ const GLfloat f = fog[i];
+ const GLfloat g = 1.0 - f;
rgba[i][RCOMP] = f * rgba[i][RCOMP] + g * rFog;
rgba[i][GCOMP] = f * rgba[i][GCOMP] + g * gFog;
rgba[i][BCOMP] = f * rgba[i][BCOMP] + g * bFog;
}
rgba[i][RCOMP] = f * rgba[i][RCOMP] + g * rFog;
rgba[i][GCOMP] = f * rgba[i][GCOMP] + g * gFog;
rgba[i][BCOMP] = f * rgba[i][BCOMP] + g * bFog;
}
-#else
- for (i = 0; i < n; i++) {
- const GLfixed f = CLAMP(fog[i], 0, FIXED_ONE);
- const GLfixed g = FIXED_ONE - f;
- rgba[i][0] = (f * rgba[i][0] + g * rFog) >> FIXED_SHIFT;
- rgba[i][1] = (f * rgba[i][1] + g * gFog) >> FIXED_SHIFT;
- rgba[i][2] = (f * rgba[i][2] + g * bFog) >> FIXED_SHIFT;
- }
-#endif
}
}
@@
-87,14
+76,14
@@
_mesa_fog_rgba_pixels( const GLcontext *ctx,
*/
void
_mesa_fog_ci_pixels( const GLcontext *ctx,
*/
void
_mesa_fog_ci_pixels( const GLcontext *ctx,
- GLuint n, const GLf
ixed
fog[], GLuint index[] )
+ GLuint n, const GLf
loat
fog[], GLuint index[] )
{
GLuint idx = (GLuint) ctx->Fog.Index;
GLuint i;
{
GLuint idx = (GLuint) ctx->Fog.Index;
GLuint i;
- for (i
=0;i<n;
i++) {
-
GLfloat f = FixedToFloat(CLAMP(fog[i], 0, FIXED_ONE)
);
- index[i] = (GLuint) ((GLfloat) index[i] + (1.0F
-
f) * idx);
+ for (i
= 0; i < n;
i++) {
+
const GLfloat f = CLAMP(fog[i], 0.0, 1.0
);
+ index[i] = (GLuint) ((GLfloat) index[i] + (1.0F
-
f) * idx);
}
}
}
}
@@
-113,7
+102,7
@@
void
_mesa_win_fog_coords_from_z( const GLcontext *ctx,
GLuint n,
const GLdepth z[],
_mesa_win_fog_coords_from_z( const GLcontext *ctx,
GLuint n,
const GLdepth z[],
- GLf
ixed
fogcoord[] )
+ GLf
loat
fogcoord[] )
{
const GLboolean ortho = (ctx->ProjectionMatrix.m[15] != 0.0F);
const GLfloat p10 = ctx->ProjectionMatrix.m[10];
{
const GLboolean ortho = (ctx->ProjectionMatrix.m[15] != 0.0F);
const GLfloat p10 = ctx->ProjectionMatrix.m[10];
@@
-165,7
+154,7
@@
_mesa_win_fog_coords_from_z( const GLcontext *ctx,
GLfloat eyez = (ndcz - p14) / p10;
if (eyez < 0.0)
eyez = -eyez;
GLfloat eyez = (ndcz - p14) / p10;
if (eyez < 0.0)
eyez = -eyez;
- fogcoord[i] =
FloatToFixed((fogEnd - eyez) * fogScale)
;
+ fogcoord[i] =
(fogEnd - eyez) * fogScale
;
}
}
else {
}
}
else {
@@
-175,7
+164,7
@@
_mesa_win_fog_coords_from_z( const GLcontext *ctx,
GLfloat eyez = p14 / (ndcz + p10);
if (eyez < 0.0)
eyez = -eyez;
GLfloat eyez = p14 / (ndcz + p10);
if (eyez < 0.0)
eyez = -eyez;
- fogcoord[i] =
FloatToFixed((fogEnd - eyez) * fogScale)
;
+ fogcoord[i] =
(fogEnd - eyez) * fogScale
;
}
}
}
}
}
}
@@
-187,7
+176,7
@@
_mesa_win_fog_coords_from_z( const GLcontext *ctx,
GLfloat eyez = (ndcz - p14) / p10;
if (eyez < 0.0)
eyez = -eyez;
GLfloat eyez = (ndcz - p14) / p10;
if (eyez < 0.0)
eyez = -eyez;
- fogcoord[i] =
FloatToFixed(exp( -ctx->Fog.Density * eyez )
);
+ fogcoord[i] =
exp( -ctx->Fog.Density * eyez
);
}
}
else {
}
}
else {
@@
-197,7
+186,7
@@
_mesa_win_fog_coords_from_z( const GLcontext *ctx,
GLfloat eyez = p14 / (ndcz + p10);
if (eyez < 0.0)
eyez = -eyez;
GLfloat eyez = p14 / (ndcz + p10);
if (eyez < 0.0)
eyez = -eyez;
- fogcoord[i] =
FloatToFixed(exp( -ctx->Fog.Density * eyez )
);
+ fogcoord[i] =
exp( -ctx->Fog.Density * eyez
);
}
}
break;
}
}
break;
@@
-214,7
+203,7
@@
_mesa_win_fog_coords_from_z( const GLcontext *ctx,
if (tmp < FLT_MIN_10_EXP)
tmp = FLT_MIN_10_EXP;
#endif
if (tmp < FLT_MIN_10_EXP)
tmp = FLT_MIN_10_EXP;
#endif
- fogcoord[i] =
FloatToFixed(exp( tmp )
);
+ fogcoord[i] =
exp( tmp
);
}
}
else {
}
}
else {
@@
-228,7
+217,7
@@
_mesa_win_fog_coords_from_z( const GLcontext *ctx,
if (tmp < FLT_MIN_10_EXP)
tmp = FLT_MIN_10_EXP;
#endif
if (tmp < FLT_MIN_10_EXP)
tmp = FLT_MIN_10_EXP;
#endif
- fogcoord[i] =
FloatToFixed(exp( tmp )
);
+ fogcoord[i] =
exp( tmp
);
}
}
}
}
}
}
@@
-251,7
+240,7
@@
void
_mesa_depth_fog_rgba_pixels( const GLcontext *ctx,
GLuint n, const GLdepth z[], GLchan rgba[][4] )
{
_mesa_depth_fog_rgba_pixels( const GLcontext *ctx,
GLuint n, const GLdepth z[], GLchan rgba[][4] )
{
- GLf
ixed
fog[PB_SIZE];
+ GLf
loat
fog[PB_SIZE];
ASSERT(n <= PB_SIZE);
_mesa_win_fog_coords_from_z( ctx, n, z, fog );
_mesa_fog_rgba_pixels( ctx, n, fog, rgba );
ASSERT(n <= PB_SIZE);
_mesa_win_fog_coords_from_z( ctx, n, z, fog );
_mesa_fog_rgba_pixels( ctx, n, fog, rgba );
@@
-269,7
+258,7
@@
void
_mesa_depth_fog_ci_pixels( const GLcontext *ctx,
GLuint n, const GLdepth z[], GLuint index[] )
{
_mesa_depth_fog_ci_pixels( const GLcontext *ctx,
GLuint n, const GLdepth z[], GLuint index[] )
{
- GLf
ixed
fog[PB_SIZE];
+ GLf
loat
fog[PB_SIZE];
ASSERT(n <= PB_SIZE);
_mesa_win_fog_coords_from_z( ctx, n, z, fog );
_mesa_fog_ci_pixels( ctx, n, fog, index );
ASSERT(n <= PB_SIZE);
_mesa_win_fog_coords_from_z( ctx, n, z, fog );
_mesa_fog_ci_pixels( ctx, n, fog, index );
diff --git
a/src/mesa/swrast/s_fog.h
b/src/mesa/swrast/s_fog.h
index 9c487e13d11731a474c5cfd4ae8daf5919b6c6bf..88f9964cb5b21e6056a7e62d6410737f54bcbbfe 100644
(file)
--- a/
src/mesa/swrast/s_fog.h
+++ b/
src/mesa/swrast/s_fog.h
@@
-1,4
+1,4
@@
-/* $Id: s_fog.h,v 1.
3 2001/03/12 00:48:42 gareth
Exp $ */
+/* $Id: s_fog.h,v 1.
4 2001/05/03 22:13:32 brianp
Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-33,22
+33,20
@@
#include "swrast.h"
#include "swrast.h"
-
-
extern void
_mesa_fog_rgba_pixels( const GLcontext *ctx,
extern void
_mesa_fog_rgba_pixels( const GLcontext *ctx,
- GLuint n, const GLf
ixed
fog[],
+ GLuint n, const GLf
loat
fog[],
GLchan rgba[][4] );
extern void
_mesa_fog_ci_pixels( const GLcontext *ctx,
GLchan rgba[][4] );
extern void
_mesa_fog_ci_pixels( const GLcontext *ctx,
- GLuint n, const GLf
ixed
fog[], GLuint indx[] );
+ GLuint n, const GLf
loat
fog[], GLuint indx[] );
extern void
_mesa_win_fog_coords_from_z( const GLcontext *ctx,
GLuint n,
const GLdepth z[],
extern void
_mesa_win_fog_coords_from_z( const GLcontext *ctx,
GLuint n,
const GLdepth z[],
- GLf
ixed
fogcoord[] );
+ GLf
loat
fogcoord[] );
extern void
_mesa_depth_fog_rgba_pixels( const GLcontext *ctx,
extern void
_mesa_depth_fog_rgba_pixels( const GLcontext *ctx,
@@
-59,5
+57,4
@@
_mesa_depth_fog_ci_pixels( const GLcontext *ctx,
GLuint n, const GLdepth z[], GLuint index[] );
GLuint n, const GLdepth z[], GLuint index[] );
-
#endif
#endif
diff --git
a/src/mesa/swrast/s_lines.c
b/src/mesa/swrast/s_lines.c
index 8971993ef56e7281929df2032e213a3854f5e063..eec354b84ad0db84484c1fb07e67c0ea23c5f1ca 100644
(file)
--- a/
src/mesa/swrast/s_lines.c
+++ b/
src/mesa/swrast/s_lines.c
@@
-1,4
+1,4
@@
-/* $Id: s_lines.c,v 1.1
5 2001/03/29 16:50
:32 brianp Exp $ */
+/* $Id: s_lines.c,v 1.1
6 2001/05/03 22:13
:32 brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-239,7
+239,7
@@
static void smooth_rgba_z_line( GLcontext *ctx,
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
- GLf
ixed
*pbfog = PB->fog;
+ GLf
loat
*pbfog = PB->fog;
GLchan (*pbrgba)[4] = PB->rgba;
GLchan (*pbrgba)[4] = PB->rgba;
@@
-288,7
+288,7
@@
static void general_smooth_ci_line( GLcontext *ctx,
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
- GLf
ixed
*pbfog = PB->fog;
+ GLf
loat
*pbfog = PB->fog;
GLuint *pbi = PB->index;
PB->mono = GL_FALSE;
GLuint *pbi = PB->index;
PB->mono = GL_FALSE;
@@
-371,7
+371,7
@@
static void general_flat_ci_line( GLcontext *ctx,
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
- GLf
ixed
*pbfog = PB->fog;
+ GLf
loat
*pbfog = PB->fog;
PB_SET_INDEX( PB, vert0->index );
count = PB->count;
PB_SET_INDEX( PB, vert0->index );
count = PB->count;
@@
-446,7
+446,7
@@
static void general_smooth_rgba_line( GLcontext *ctx,
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
- GLf
ixed
*pbfog = PB->fog;
+ GLf
loat
*pbfog = PB->fog;
GLchan (*pbrgba)[4] = PB->rgba;
PB->mono = GL_FALSE;
GLchan (*pbrgba)[4] = PB->rgba;
PB->mono = GL_FALSE;
@@
-598,7
+598,7
@@
static void flat_textured_line( GLcontext *ctx,
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
- GLf
ixed
*pbfog = PB->fog;
+ GLf
loat
*pbfog = PB->fog;
GLfloat *pbs = PB->s[0];
GLfloat *pbt = PB->t[0];
GLfloat *pbu = PB->u[0];
GLfloat *pbs = PB->s[0];
GLfloat *pbt = PB->t[0];
GLfloat *pbu = PB->u[0];
@@
-666,7
+666,7
@@
static void smooth_textured_line( GLcontext *ctx,
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
- GLf
ixed
*pbfog = PB->fog;
+ GLf
loat
*pbfog = PB->fog;
GLfloat *pbs = PB->s[0];
GLfloat *pbt = PB->t[0];
GLfloat *pbu = PB->u[0];
GLfloat *pbs = PB->s[0];
GLfloat *pbt = PB->t[0];
GLfloat *pbu = PB->u[0];
@@
-747,7
+747,7
@@
static void smooth_multitextured_line( GLcontext *ctx,
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
- GLf
ixed
*pbfog = PB->fog;
+ GLf
loat
*pbfog = PB->fog;
GLchan (*pbrgba)[4] = PB->rgba;
GLchan (*pbspec)[3] = PB->spec;
GLchan (*pbrgba)[4] = PB->rgba;
GLchan (*pbspec)[3] = PB->spec;
@@
-846,7
+846,7
@@
static void flat_multitextured_line( GLcontext *ctx,
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
GLint *pbx = PB->x;
GLint *pby = PB->y;
GLdepth *pbz = PB->z;
- GLf
ixed
*pbfog = PB->fog;
+ GLf
loat
*pbfog = PB->fog;
GLchan (*pbrgba)[4] = PB->rgba;
GLchan (*pbspec)[3] = PB->spec;
GLchan *color = (GLchan*) vert1->color;
GLchan (*pbrgba)[4] = PB->rgba;
GLchan (*pbspec)[3] = PB->spec;
GLchan *color = (GLchan*) vert1->color;
diff --git
a/src/mesa/swrast/s_linetemp.h
b/src/mesa/swrast/s_linetemp.h
index 5792b46a4a9103abf7b064488ee1badf1c568264..f8fa310d765d04012cd8fdb38df090b2336f6da5 100644
(file)
--- a/
src/mesa/swrast/s_linetemp.h
+++ b/
src/mesa/swrast/s_linetemp.h
@@
-1,4
+1,4
@@
-/* $Id: s_linetemp.h,v 1.
7 2001/03/12 00:48:42 gareth
Exp $ */
+/* $Id: s_linetemp.h,v 1.
8 2001/05/03 22:13:32 brianp
Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-95,8
+95,8
@@
# endif
#endif
#ifdef INTERP_FOG
# endif
#endif
#ifdef INTERP_FOG
- GLf
ixed fog0 = FloatToFixed(vert0->fog)
;
- GLf
ixed dfog = FloatToFixed(vert1->fog)
- fog0;
+ GLf
loat fog0 = vert0->fog
;
+ GLf
loat dfog = vert1->fog
- fog0;
#endif
#ifdef INTERP_RGB
GLfixed r0 = IntToFixed(vert0->color[0]);
#endif
#ifdef INTERP_RGB
GLfixed r0 = IntToFixed(vert0->color[0]);
diff --git
a/src/mesa/swrast/s_span.c
b/src/mesa/swrast/s_span.c
index d26b04218749ca99988774b7c0b42f7dd01ff123..c0c47f82b1869fe965a1d0bc8d25d43fe5c0f0d6 100644
(file)
--- a/
src/mesa/swrast/s_span.c
+++ b/
src/mesa/swrast/s_span.c
@@
-1,4
+1,4
@@
-/* $Id: s_span.c,v 1.1
2 2001/03/19 02:25:36 keithw
Exp $ */
+/* $Id: s_span.c,v 1.1
3 2001/05/03 22:13:32 brianp
Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-180,7
+180,7
@@
static void multi_write_index_span( GLcontext *ctx, GLuint n,
*/
void _mesa_write_index_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
*/
void _mesa_write_index_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLf
ixed
fog[],
+ const GLf
loat
fog[],
GLuint indexIn[], GLenum primitive )
{
const GLuint modBits = FOG_BIT | BLEND_BIT | MASKING_BIT | LOGIC_OP_BIT;
GLuint indexIn[], GLenum primitive )
{
const GLuint modBits = FOG_BIT | BLEND_BIT | MASKING_BIT | LOGIC_OP_BIT;
@@
-272,7
+272,7
@@
void _mesa_write_index_span( GLcontext *ctx,
void _mesa_write_monoindex_span( GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLdepth z[],
void _mesa_write_monoindex_span( GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLdepth z[],
- const GLf
ixed
fog[],
+ const GLf
loat
fog[],
GLuint index, GLenum primitive )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint index, GLenum primitive )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@
-444,7
+444,7
@@
static void multi_write_rgba_span( GLcontext *ctx, GLuint n,
void _mesa_write_rgba_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
void _mesa_write_rgba_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLf
ixed
*fog,
+ const GLf
loat
*fog,
GLchan rgbaIn[][4],
GLenum primitive )
{
GLchan rgbaIn[][4],
GLenum primitive )
{
@@
-580,7
+580,7
@@
void _mesa_write_rgba_span( GLcontext *ctx,
*/
void _mesa_write_monocolor_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
*/
void _mesa_write_monocolor_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLf
ixed
fog[],
+ const GLf
loat
fog[],
const GLchan color[4],
GLenum primitive )
{
const GLchan color[4],
GLenum primitive )
{
@@
-763,7
+763,7
@@
static void add_colors(GLuint n, GLchan rgba[][4], CONST GLchan specular[][4] )
*/
void _mesa_write_texture_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
*/
void _mesa_write_texture_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLf
ixed
fog[],
+ const GLf
loat
fog[],
const GLfloat s[], const GLfloat t[],
const GLfloat u[], GLfloat lambda[],
GLchan rgbaIn[][4], CONST GLchan spec[][4],
const GLfloat s[], const GLfloat t[],
const GLfloat u[], GLfloat lambda[],
GLchan rgbaIn[][4], CONST GLchan spec[][4],
@@
-906,7
+906,7
@@
void
_mesa_write_multitexture_span( GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLdepth z[],
_mesa_write_multitexture_span( GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLdepth z[],
- const GLf
ixed
fog[],
+ const GLf
loat
fog[],
CONST GLfloat s[MAX_TEXTURE_UNITS][MAX_WIDTH],
CONST GLfloat t[MAX_TEXTURE_UNITS][MAX_WIDTH],
CONST GLfloat u[MAX_TEXTURE_UNITS][MAX_WIDTH],
CONST GLfloat s[MAX_TEXTURE_UNITS][MAX_WIDTH],
CONST GLfloat t[MAX_TEXTURE_UNITS][MAX_WIDTH],
CONST GLfloat u[MAX_TEXTURE_UNITS][MAX_WIDTH],
diff --git
a/src/mesa/swrast/s_span.h
b/src/mesa/swrast/s_span.h
index aa7e3b3664b0b4631a0f954fa8d7277f2e1d1122..b1bb847bf6712b7308b65ae695d42930684625c5 100644
(file)
--- a/
src/mesa/swrast/s_span.h
+++ b/
src/mesa/swrast/s_span.h
@@
-1,4
+1,4
@@
-/* $Id: s_span.h,v 1.
4 2001/03/12 00:48:42 gareth
Exp $ */
+/* $Id: s_span.h,v 1.
5 2001/05/03 22:13:32 brianp
Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-38,27
+38,27
@@
extern void _mesa_write_index_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
extern void _mesa_write_index_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLf
ixed
fog[],
+ const GLf
loat
fog[],
GLuint index[], GLenum primitive );
extern void _mesa_write_monoindex_span( GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLdepth z[],
GLuint index[], GLenum primitive );
extern void _mesa_write_monoindex_span( GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLdepth z[],
- const GLf
ixed
fog[],
+ const GLf
loat
fog[],
GLuint index, GLenum primitive );
extern void _mesa_write_rgba_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
GLuint index, GLenum primitive );
extern void _mesa_write_rgba_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLf
ixed
fog[],
+ const GLf
loat
fog[],
GLchan rgba[][4], GLenum primitive );
extern void _mesa_write_monocolor_span( GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLdepth z[],
GLchan rgba[][4], GLenum primitive );
extern void _mesa_write_monocolor_span( GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLdepth z[],
- const GLf
ixed
fog[],
+ const GLf
loat
fog[],
const GLchan color[4],
GLenum primitive );
const GLchan color[4],
GLenum primitive );
@@
-66,7
+66,7
@@
extern void _mesa_write_monocolor_span( GLcontext *ctx,
extern void _mesa_write_texture_span( GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLdepth z[],
extern void _mesa_write_texture_span( GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLdepth z[],
- const GLf
ixed
fog[],
+ const GLf
loat
fog[],
const GLfloat s[], const GLfloat t[],
const GLfloat u[], GLfloat lambda[],
GLchan rgba[][4], CONST GLchan spec[][4],
const GLfloat s[], const GLfloat t[],
const GLfloat u[], GLfloat lambda[],
GLchan rgba[][4], CONST GLchan spec[][4],
@@
-77,7
+77,7
@@
extern void
_mesa_write_multitexture_span( GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLdepth z[],
_mesa_write_multitexture_span( GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLdepth z[],
- const GLf
ixed
fog[],
+ const GLf
loat
fog[],
CONST GLfloat s[MAX_TEXTURE_UNITS][MAX_WIDTH],
CONST GLfloat t[MAX_TEXTURE_UNITS][MAX_WIDTH],
CONST GLfloat u[MAX_TEXTURE_UNITS][MAX_WIDTH],
CONST GLfloat s[MAX_TEXTURE_UNITS][MAX_WIDTH],
CONST GLfloat t[MAX_TEXTURE_UNITS][MAX_WIDTH],
CONST GLfloat u[MAX_TEXTURE_UNITS][MAX_WIDTH],
diff --git
a/src/mesa/swrast/s_texstore.c
b/src/mesa/swrast/s_texstore.c
index f01dab5fdd3ce91425a7699d71f3c5a9c3e98a07..b7ca0abf3589ac172080fc34e54189bd0eb0c59b 100644
(file)
--- a/
src/mesa/swrast/s_texstore.c
+++ b/
src/mesa/swrast/s_texstore.c
@@
-1,4
+1,4
@@
-/* $Id: s_texstore.c,v 1.
3 2001/04/13 00:13:51
brianp Exp $ */
+/* $Id: s_texstore.c,v 1.
4 2001/05/03 22:13:32
brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-274,6
+274,7
@@
_swrast_copy_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
return;
}
return;
}
+#if 0
/*
* XXX this is a bit of a hack. We need to be sure that the alpha
* channel is 1.0 if the internal texture format is not supposed to
/*
* XXX this is a bit of a hack. We need to be sure that the alpha
* channel is 1.0 if the internal texture format is not supposed to
@@
-289,7
+290,7
@@
_swrast_copy_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
image[i + 3] = CHAN_MAX;
}
}
image[i + 3] = CHAN_MAX;
}
}
-
+#endif
/* now call glTexSubImage1D to do the real work */
(*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width,
GL_RGBA, CHAN_TYPE, image,
/* now call glTexSubImage1D to do the real work */
(*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width,
GL_RGBA, CHAN_TYPE, image,
@@
-342,6
+343,7
@@
_swrast_copy_texsubimage2d( GLcontext *ctx,
return;
}
return;
}
+#if 0
/*
* XXX this is a bit of a hack. We need to be sure that the alpha
* channel is 1.0 if the internal texture format is not supposed to
/*
* XXX this is a bit of a hack. We need to be sure that the alpha
* channel is 1.0 if the internal texture format is not supposed to
@@
-357,7
+359,7
@@
_swrast_copy_texsubimage2d( GLcontext *ctx,
image[i + 3] = CHAN_MAX;
}
}
image[i + 3] = CHAN_MAX;
}
}
-
+#endif
/* now call glTexSubImage2D to do the real work */
(*ctx->Driver.TexSubImage2D)(ctx, target, level,
xoffset, yoffset, width, height,
/* now call glTexSubImage2D to do the real work */
(*ctx->Driver.TexSubImage2D)(ctx, target, level,
xoffset, yoffset, width, height,
@@
-411,7
+413,7
@@
_swrast_copy_texsubimage3d( GLcontext *ctx,
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D" );
return;
}
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D" );
return;
}
-
+#if 0
/*
* XXX this is a bit of a hack. We need to be sure that the alpha
* channel is 1.0 if the internal texture format is not supposed to
/*
* XXX this is a bit of a hack. We need to be sure that the alpha
* channel is 1.0 if the internal texture format is not supposed to
@@
-427,7
+429,7
@@
_swrast_copy_texsubimage3d( GLcontext *ctx,
image[i + 3] = CHAN_MAX;
}
}
image[i + 3] = CHAN_MAX;
}
}
-
+#endif
/* now call glTexSubImage3D to do the real work */
(*ctx->Driver.TexSubImage3D)(ctx, target, level,
xoffset, yoffset, zoffset, width, height, 1,
/* now call glTexSubImage3D to do the real work */
(*ctx->Driver.TexSubImage3D)(ctx, target, level,
xoffset, yoffset, zoffset, width, height, 1,
diff --git
a/src/mesa/swrast/s_triangle.c
b/src/mesa/swrast/s_triangle.c
index e61b5765926a93ab481f62684386acfc659318c1..82c690502bff8e539016179136e2607f06b9c4cb 100644
(file)
--- a/
src/mesa/swrast/s_triangle.c
+++ b/
src/mesa/swrast/s_triangle.c
@@
-1,4
+1,4
@@
-/* $Id: s_triangle.c,v 1.2
4 2001/03/29 16:50
:32 brianp Exp $ */
+/* $Id: s_triangle.c,v 1.2
5 2001/05/03 22:13
:32 brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-83,13
+83,13
@@
static void flat_ci_triangle( GLcontext *ctx,
const GLint n = RIGHT-LEFT; \
GLint i; \
GLdepth zspan[MAX_WIDTH]; \
const GLint n = RIGHT-LEFT; \
GLint i; \
GLdepth zspan[MAX_WIDTH]; \
- GLf
ixed
fogspan[MAX_WIDTH]; \
+ GLf
loat
fogspan[MAX_WIDTH]; \
if (n>0) { \
for (i=0;i<n;i++) { \
zspan[i] = FixedToDepth(ffz); \
ffz += fdzdx; \
if (n>0) { \
for (i=0;i<n;i++) { \
zspan[i] = FixedToDepth(ffz); \
ffz += fdzdx; \
- fogspan[i] = ff
fog / 256;
\
-
fffog += fdfogdx;
\
+ fogspan[i] = ff
og;
\
+
ffog += dfogdx;
\
} \
_mesa_write_monoindex_span( ctx, n, LEFT, Y, zspan, \
fogspan, v0->index, GL_POLYGON ); \
} \
_mesa_write_monoindex_span( ctx, n, LEFT, Y, zspan, \
fogspan, v0->index, GL_POLYGON ); \
@@
-118,7
+118,7
@@
static void smooth_ci_triangle( GLcontext *ctx,
const GLint n = RIGHT-LEFT; \
GLint i; \
GLdepth zspan[MAX_WIDTH]; \
const GLint n = RIGHT-LEFT; \
GLint i; \
GLdepth zspan[MAX_WIDTH]; \
- GLf
ixed
fogspan[MAX_WIDTH]; \
+ GLf
loat
fogspan[MAX_WIDTH]; \
GLuint index[MAX_WIDTH]; \
if (n>0) { \
for (i=0;i<n;i++) { \
GLuint index[MAX_WIDTH]; \
if (n>0) { \
for (i=0;i<n;i++) { \
@@
-126,8
+126,8
@@
static void smooth_ci_triangle( GLcontext *ctx,
ffz += fdzdx; \
index[i] = FixedToInt(ffi); \
ffi += fdidx; \
ffz += fdzdx; \
index[i] = FixedToInt(ffi); \
ffi += fdidx; \
- fogspan[i] = ff
fog / 256;
\
- ff
fog += fdfogdx;
\
+ fogspan[i] = ff
og;
\
+ ff
og += dfogdx;
\
} \
_mesa_write_index_span( ctx, n, LEFT, Y, zspan, fogspan, \
index, GL_POLYGON ); \
} \
_mesa_write_index_span( ctx, n, LEFT, Y, zspan, fogspan, \
index, GL_POLYGON ); \
@@
-156,13
+156,13
@@
static void flat_rgba_triangle( GLcontext *ctx,
const GLint n = RIGHT-LEFT; \
GLint i; \
GLdepth zspan[MAX_WIDTH]; \
const GLint n = RIGHT-LEFT; \
GLint i; \
GLdepth zspan[MAX_WIDTH]; \
- GLf
ixed
fogspan[MAX_WIDTH]; \
+ GLf
loat
fogspan[MAX_WIDTH]; \
if (n>0) { \
for (i=0;i<n;i++) { \
zspan[i] = FixedToDepth(ffz); \
ffz += fdzdx; \
if (n>0) { \
for (i=0;i<n;i++) { \
zspan[i] = FixedToDepth(ffz); \
ffz += fdzdx; \
- fogspan[i] = ff
fog / 256;
\
- ff
fog += fdfogdx;
\
+ fogspan[i] = ff
og;
\
+ ff
og += dfogdx;
\
} \
_mesa_write_monocolor_span( ctx, n, LEFT, Y, zspan, \
fogspan, v2->color, \
} \
_mesa_write_monocolor_span( ctx, n, LEFT, Y, zspan, \
fogspan, v2->color, \
@@
-199,7
+199,7
@@
static void smooth_rgba_triangle( GLcontext *ctx,
GLint i; \
GLdepth zspan[MAX_WIDTH]; \
GLchan rgba[MAX_WIDTH][4]; \
GLint i; \
GLdepth zspan[MAX_WIDTH]; \
GLchan rgba[MAX_WIDTH][4]; \
- GLf
ixed
fogspan[MAX_WIDTH]; \
+ GLf
loat
fogspan[MAX_WIDTH]; \
if (n>0) { \
for (i=0;i<n;i++) { \
zspan[i] = FixedToDepth(ffz); \
if (n>0) { \
for (i=0;i<n;i++) { \
zspan[i] = FixedToDepth(ffz); \
@@
-207,13
+207,13
@@
static void smooth_rgba_triangle( GLcontext *ctx,
rgba[i][GCOMP] = FixedToInt(ffg); \
rgba[i][BCOMP] = FixedToInt(ffb); \
rgba[i][ACOMP] = FixedToInt(ffa); \
rgba[i][GCOMP] = FixedToInt(ffg); \
rgba[i][BCOMP] = FixedToInt(ffb); \
rgba[i][ACOMP] = FixedToInt(ffa); \
- fogspan[i] = fffog / 256; \
- fffog += fdfogdx; \
+ fogspan[i] = ffog;; \
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
ffb += fdbdx; \
ffa += fdadx; \
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
ffb += fdbdx; \
ffa += fdadx; \
+ ffog += dfogdx; \
} \
_mesa_write_rgba_span( ctx, n, LEFT, Y, \
(CONST GLdepth *) zspan, \
} \
_mesa_write_rgba_span( ctx, n, LEFT, Y, \
(CONST GLdepth *) zspan, \
@@
-299,7
+299,6
@@
static void simple_z_textured_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
#define INTERP_Z 1
const SWvertex *v2 )
{
#define INTERP_Z 1
-#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_INT_TEX 1
#define S_SCALE twidth
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_INT_TEX 1
#define S_SCALE twidth
@@
-325,7
+324,6
@@
static void simple_z_textured_triangle( GLcontext *ctx,
GLint i; \
GLchan rgb[MAX_WIDTH][3]; \
GLubyte mask[MAX_WIDTH]; \
GLint i; \
GLchan rgb[MAX_WIDTH][3]; \
GLubyte mask[MAX_WIDTH]; \
- (void) fffog; \
if (n>0) { \
ffs -= FIXED_HALF; /* off-by-one error? */ \
fft -= FIXED_HALF; \
if (n>0) { \
ffs -= FIXED_HALF; /* off-by-one error? */ \
fft -= FIXED_HALF; \
@@
-505,9
+503,9
@@
static void affine_textured_triangle( GLcontext *ctx,
GLint pos = (t << twidth_log2) + s; \
const GLchan *tex00 = texture + COMP * pos; \
zspan[i] = FixedToDepth(ffz); \
GLint pos = (t << twidth_log2) + s; \
const GLchan *tex00 = texture + COMP * pos; \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;;
\
DO_TEX; \
DO_TEX; \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
@@
-540,9
+538,9
@@
static void affine_textured_triangle( GLcontext *ctx,
tex11 -= tbytesline; \
} \
zspan[i] = FixedToDepth(ffz); \
tex11 -= tbytesline; \
} \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
DO_TEX; \
DO_TEX; \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
@@
-559,7
+557,7
@@
static void affine_textured_triangle( GLcontext *ctx,
CONST GLint n = RIGHT-LEFT; \
GLint i; \
GLdepth zspan[MAX_WIDTH]; \
CONST GLint n = RIGHT-LEFT; \
GLint i; \
GLdepth zspan[MAX_WIDTH]; \
- GLf
ixed
fogspan[MAX_WIDTH]; \
+ GLf
loat
fogspan[MAX_WIDTH]; \
GLchan rgba[MAX_WIDTH][4]; \
if (n>0) { \
GLchan *dest = rgba[0]; \
GLchan rgba[MAX_WIDTH][4]; \
if (n>0) { \
GLchan *dest = rgba[0]; \
@@
-740,9
+738,9
@@
static void near_persp_textured_triangle(GLcontext *ctx,
GLint pos = COMP * ((t << twidth_log2) + s); \
const GLchan *tex00 = texture + pos; \
zspan[i] = FixedToDepth(ffz); \
GLint pos = COMP * ((t << twidth_log2) + s); \
const GLchan *tex00 = texture + pos; \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
DO_TEX; \
DO_TEX; \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
@@
-910,9
+908,9
@@
static void near_persp_textured_triangle(GLcontext *ctx,
j = n; \
while (i<j) { \
zspan[i] = FixedToDepth(ffz); \
j = n; \
while (i<j) { \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
DO_TEX; \
DO_TEX; \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
@@
-928,7
+926,7
@@
static void near_persp_textured_triangle(GLcontext *ctx,
GLint i = 0; \
const GLint n = RIGHT-LEFT; \
GLdepth zspan[MAX_WIDTH]; \
GLint i = 0; \
const GLint n = RIGHT-LEFT; \
GLdepth zspan[MAX_WIDTH]; \
- GLf
ixed
fogspan[MAX_WIDTH]; \
+ GLf
loat
fogspan[MAX_WIDTH]; \
GLchan rgba[MAX_WIDTH][4]; \
(void)uu; /* please GCC */ \
if (n > 0) { \
GLchan rgba[MAX_WIDTH][4]; \
(void)uu; /* please GCC */ \
if (n > 0) { \
@@
-1510,9
+1508,9
@@
static void lin_persp_textured_triangle( GLcontext *ctx,
tex11 -= tbytesline; \
} \
zspan[i] = FixedToDepth(ffz); \
tex11 -= tbytesline; \
} \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
DO_TEX; \
DO_TEX; \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
@@
-1529,7
+1527,7
@@
static void lin_persp_textured_triangle( GLcontext *ctx,
GLint i; \
const GLint n = RIGHT-LEFT; \
GLdepth zspan[MAX_WIDTH]; \
GLint i; \
const GLint n = RIGHT-LEFT; \
GLdepth zspan[MAX_WIDTH]; \
- GLf
ixed
fogspan[MAX_WIDTH]; \
+ GLf
loat
fogspan[MAX_WIDTH]; \
GLchan rgba[MAX_WIDTH][4]; \
(void) uu; /* please GCC */ \
if (n > 0) { \
GLchan rgba[MAX_WIDTH][4]; \
(void) uu; /* please GCC */ \
if (n > 0) { \
@@
-1625,7
+1623,7
@@
static void general_textured_triangle( GLcontext *ctx,
GLint i; \
const GLint n = RIGHT-LEFT; \
GLdepth zspan[MAX_WIDTH]; \
GLint i; \
const GLint n = RIGHT-LEFT; \
GLdepth zspan[MAX_WIDTH]; \
- GLf
ixed
fogspan[MAX_WIDTH]; \
+ GLf
loat
fogspan[MAX_WIDTH]; \
GLchan rgba[MAX_WIDTH][4]; \
GLfloat s[MAX_WIDTH], t[MAX_WIDTH], u[MAX_WIDTH]; \
if (n>0) { \
GLchan rgba[MAX_WIDTH][4]; \
GLfloat s[MAX_WIDTH], t[MAX_WIDTH], u[MAX_WIDTH]; \
if (n>0) { \
@@
-1633,7
+1631,7
@@
static void general_textured_triangle( GLcontext *ctx,
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
rgba[i][RCOMP] = r; \
rgba[i][GCOMP] = g; \
rgba[i][BCOMP] = b; \
rgba[i][RCOMP] = r; \
rgba[i][GCOMP] = g; \
rgba[i][BCOMP] = b; \
@@
-1641,7
+1639,7
@@
static void general_textured_triangle( GLcontext *ctx,
s[i] = ss*invQ; \
t[i] = tt*invQ; \
u[i] = uu*invQ; \
s[i] = ss*invQ; \
t[i] = tt*invQ; \
u[i] = uu*invQ; \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ffz += fdzdx; \
ss += dsdx; \
tt += dtdx; \
ffz += fdzdx; \
ss += dsdx; \
tt += dtdx; \
@@
-1657,11
+1655,11
@@
static void general_textured_triangle( GLcontext *ctx,
rgba[i][GCOMP] = FixedToInt(ffg); \
rgba[i][BCOMP] = FixedToInt(ffb); \
rgba[i][ACOMP] = FixedToInt(ffa); \
rgba[i][GCOMP] = FixedToInt(ffg); \
rgba[i][BCOMP] = FixedToInt(ffb); \
rgba[i][ACOMP] = FixedToInt(ffa); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
s[i] = ss*invQ; \
t[i] = tt*invQ; \
u[i] = uu*invQ; \
s[i] = ss*invQ; \
t[i] = tt*invQ; \
u[i] = uu*invQ; \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
@@
-1673,10
+1671,9
@@
static void general_textured_triangle( GLcontext *ctx,
vv += dvdx; \
} \
} \
vv += dvdx; \
} \
} \
- _mesa_write_texture_span( ctx, n, LEFT, Y, zspan, fogspan, \
- s, t, u, NULL, \
- rgba, \
- NULL, GL_POLYGON ); \
+ _mesa_write_texture_span( ctx, n, LEFT, Y, zspan, \
+ fogspan, s, t, u, NULL, \
+ rgba, NULL, GL_POLYGON ); \
} \
}
} \
}
@@
-1696,7
+1693,7
@@
static void general_textured_spec_triangle1( GLcontext *ctx,
const SWvertex *v1,
const SWvertex *v2,
GLdepth zspan[MAX_WIDTH],
const SWvertex *v1,
const SWvertex *v2,
GLdepth zspan[MAX_WIDTH],
- GLf
ixed
fogspan[MAX_WIDTH],
+ GLf
loat
fogspan[MAX_WIDTH],
GLchan rgba[MAX_WIDTH][4],
GLchan spec[MAX_WIDTH][4] )
{
GLchan rgba[MAX_WIDTH][4],
GLchan spec[MAX_WIDTH][4] )
{
@@
-1729,7
+1726,7
@@
static void general_textured_spec_triangle1( GLcontext *ctx,
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
rgba[i][RCOMP] = r; \
rgba[i][GCOMP] = g; \
rgba[i][BCOMP] = b; \
rgba[i][RCOMP] = r; \
rgba[i][GCOMP] = g; \
rgba[i][BCOMP] = b; \
@@
-1740,7
+1737,7
@@
static void general_textured_spec_triangle1( GLcontext *ctx,
s[i] = ss*invQ; \
t[i] = tt*invQ; \
u[i] = uu*invQ; \
s[i] = ss*invQ; \
t[i] = tt*invQ; \
u[i] = uu*invQ; \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ffz += fdzdx; \
ss += dsdx; \
tt += dtdx; \
ffz += fdzdx; \
ss += dsdx; \
tt += dtdx; \
@@
-1752,7
+1749,7
@@
static void general_textured_spec_triangle1( GLcontext *ctx,
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
rgba[i][RCOMP] = FixedToInt(ffr); \
rgba[i][GCOMP] = FixedToInt(ffg); \
rgba[i][BCOMP] = FixedToInt(ffb); \
rgba[i][RCOMP] = FixedToInt(ffr); \
rgba[i][GCOMP] = FixedToInt(ffg); \
rgba[i][BCOMP] = FixedToInt(ffb); \
@@
-1763,7
+1760,7
@@
static void general_textured_spec_triangle1( GLcontext *ctx,
s[i] = ss*invQ; \
t[i] = tt*invQ; \
u[i] = uu*invQ; \
s[i] = ss*invQ; \
t[i] = tt*invQ; \
u[i] = uu*invQ; \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
@@
-1833,7
+1830,7
@@
static void lambda_textured_triangle1( GLcontext *ctx,
GLint i; \
const GLint n = RIGHT-LEFT; \
GLdepth zspan[MAX_WIDTH]; \
GLint i; \
const GLint n = RIGHT-LEFT; \
GLdepth zspan[MAX_WIDTH]; \
- GLf
ixed
fogspan[MAX_WIDTH]; \
+ GLf
loat
fogspan[MAX_WIDTH]; \
GLchan rgba[MAX_WIDTH][4]; \
GLfloat lambda[MAX_WIDTH]; \
if (n>0) { \
GLchan rgba[MAX_WIDTH][4]; \
GLfloat lambda[MAX_WIDTH]; \
if (n>0) { \
@@
-1841,7
+1838,7
@@
static void lambda_textured_triangle1( GLcontext *ctx,
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
rgba[i][RCOMP] = r; \
rgba[i][GCOMP] = g; \
rgba[i][BCOMP] = b; \
rgba[i][RCOMP] = r; \
rgba[i][GCOMP] = g; \
rgba[i][BCOMP] = b; \
@@
-1851,7
+1848,7
@@
static void lambda_textured_triangle1( GLcontext *ctx,
u[i] = uu*invQ; \
COMPUTE_LAMBDA(lambda[i], invQ); \
ffz += fdzdx; \
u[i] = uu*invQ; \
COMPUTE_LAMBDA(lambda[i], invQ); \
ffz += fdzdx; \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ss += dsdx; \
tt += dtdx; \
uu += dudx; \
ss += dsdx; \
tt += dtdx; \
uu += dudx; \
@@
-1862,7
+1859,7
@@
static void lambda_textured_triangle1( GLcontext *ctx,
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
rgba[i][RCOMP] = FixedToInt(ffr); \
rgba[i][GCOMP] = FixedToInt(ffg); \
rgba[i][BCOMP] = FixedToInt(ffb); \
rgba[i][RCOMP] = FixedToInt(ffr); \
rgba[i][GCOMP] = FixedToInt(ffg); \
rgba[i][BCOMP] = FixedToInt(ffb); \
@@
-1872,7
+1869,7
@@
static void lambda_textured_triangle1( GLcontext *ctx,
u[i] = uu*invQ; \
COMPUTE_LAMBDA(lambda[i], invQ); \
ffz += fdzdx; \
u[i] = uu*invQ; \
COMPUTE_LAMBDA(lambda[i], invQ); \
ffz += fdzdx; \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ffr += fdrdx; \
ffg += fdgdx; \
ffb += fdbdx; \
ffr += fdrdx; \
ffg += fdgdx; \
ffb += fdbdx; \
@@
-1941,7
+1938,7
@@
static void lambda_textured_spec_triangle1( GLcontext *ctx,
GLint i; \
const GLint n = RIGHT-LEFT; \
GLdepth zspan[MAX_WIDTH]; \
GLint i; \
const GLint n = RIGHT-LEFT; \
GLdepth zspan[MAX_WIDTH]; \
- GLf
ixed
fogspan[MAX_WIDTH]; \
+ GLf
loat
fogspan[MAX_WIDTH]; \
GLchan spec[MAX_WIDTH][4]; \
GLchan rgba[MAX_WIDTH][4]; \
GLfloat lambda[MAX_WIDTH]; \
GLchan spec[MAX_WIDTH][4]; \
GLchan rgba[MAX_WIDTH][4]; \
GLfloat lambda[MAX_WIDTH]; \
@@
-1950,7
+1947,7
@@
static void lambda_textured_spec_triangle1( GLcontext *ctx,
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
rgba[i][RCOMP] = r; \
rgba[i][GCOMP] = g; \
rgba[i][BCOMP] = b; \
rgba[i][RCOMP] = r; \
rgba[i][GCOMP] = g; \
rgba[i][BCOMP] = b; \
@@
-1962,7
+1959,7
@@
static void lambda_textured_spec_triangle1( GLcontext *ctx,
t[i] = tt*invQ; \
u[i] = uu*invQ; \
COMPUTE_LAMBDA(lambda[i], invQ); \
t[i] = tt*invQ; \
u[i] = uu*invQ; \
COMPUTE_LAMBDA(lambda[i], invQ); \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ffz += fdzdx; \
ss += dsdx; \
tt += dtdx; \
ffz += fdzdx; \
ss += dsdx; \
tt += dtdx; \
@@
-1974,7
+1971,7
@@
static void lambda_textured_spec_triangle1( GLcontext *ctx,
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
for (i=0;i<n;i++) { \
GLdouble invQ = vv ? (1.0 / vv) : 1.0; \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
rgba[i][RCOMP] = FixedToInt(ffr); \
rgba[i][GCOMP] = FixedToInt(ffg); \
rgba[i][BCOMP] = FixedToInt(ffb); \
rgba[i][RCOMP] = FixedToInt(ffr); \
rgba[i][GCOMP] = FixedToInt(ffg); \
rgba[i][BCOMP] = FixedToInt(ffb); \
@@
-1986,7
+1983,7
@@
static void lambda_textured_spec_triangle1( GLcontext *ctx,
t[i] = tt*invQ; \
u[i] = uu*invQ; \
COMPUTE_LAMBDA(lambda[i], invQ); \
t[i] = tt*invQ; \
u[i] = uu*invQ; \
COMPUTE_LAMBDA(lambda[i], invQ); \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
ffz += fdzdx; \
ffr += fdrdx; \
ffg += fdgdx; \
@@
-2001,8
+1998,8
@@
static void lambda_textured_spec_triangle1( GLcontext *ctx,
vv += dvdx; \
} \
} \
vv += dvdx; \
} \
} \
- _mesa_write_texture_span( ctx, n, LEFT, Y, zspan,
fogspan,
\
-
s, t, u, lambda,
\
+ _mesa_write_texture_span( ctx, n, LEFT, Y, zspan, \
+
fogspan, s, t, u, lambda,
\
rgba, (CONST GLchan (*)[4]) spec, \
GL_POLYGON ); \
} \
rgba, (CONST GLchan (*)[4]) spec, \
GL_POLYGON ); \
} \
@@
-2063,15
+2060,15
@@
lambda_multitextured_triangle1( GLcontext *ctx,
GLint i; \
const GLint n = RIGHT-LEFT; \
GLdepth zspan[MAX_WIDTH]; \
GLint i; \
const GLint n = RIGHT-LEFT; \
GLdepth zspan[MAX_WIDTH]; \
- GLf
ixed
fogspan[MAX_WIDTH]; \
+ GLf
loat
fogspan[MAX_WIDTH]; \
GLfloat lambda[MAX_TEXTURE_UNITS][MAX_WIDTH]; \
if (n > 0) { \
if (flat_shade) { \
for (i=0;i<n;i++) { \
GLuint unit; \
zspan[i] = FixedToDepth(ffz); \
GLfloat lambda[MAX_TEXTURE_UNITS][MAX_WIDTH]; \
if (n > 0) { \
if (flat_shade) { \
for (i=0;i<n;i++) { \
GLuint unit; \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
- ff
fog += fdfogdx;
\
+ fogspan[i] = ff
og;
\
+ ff
og += dfogdx;
\
ffz += fdzdx; \
rgba[i][RCOMP] = r; \
rgba[i][GCOMP] = g; \
ffz += fdzdx; \
rgba[i][RCOMP] = r; \
rgba[i][GCOMP] = g; \
@@
-2096,9
+2093,9
@@
lambda_multitextured_triangle1( GLcontext *ctx,
for (i=0;i<n;i++) { \
GLuint unit; \
zspan[i] = FixedToDepth(ffz); \
for (i=0;i<n;i++) { \
GLuint unit; \
zspan[i] = FixedToDepth(ffz); \
- fogspan[i] = ff
fog / 256;
\
+ fogspan[i] = ff
og;
\
ffz += fdzdx; \
ffz += fdzdx; \
- ff
fog += fdfogdx;
\
+ ff
og += dfogdx;
\
rgba[i][RCOMP] = FixedToInt(ffr); \
rgba[i][GCOMP] = FixedToInt(ffg); \
rgba[i][BCOMP] = FixedToInt(ffb); \
rgba[i][RCOMP] = FixedToInt(ffr); \
rgba[i][GCOMP] = FixedToInt(ffg); \
rgba[i][BCOMP] = FixedToInt(ffb); \
@@
-2146,7
+2143,7
@@
static void general_textured_spec_triangle(GLcontext *ctx,
const SWvertex *v2 )
{
GLdepth zspan[MAX_WIDTH];
const SWvertex *v2 )
{
GLdepth zspan[MAX_WIDTH];
- GLf
ixed
fogspan[MAX_WIDTH];
+ GLf
loat
fogspan[MAX_WIDTH];
GLchan rgba[MAX_WIDTH][4], spec[MAX_WIDTH][4];
general_textured_spec_triangle1(ctx,v0,v1,v2,zspan,fogspan,rgba,spec);
}
GLchan rgba[MAX_WIDTH][4], spec[MAX_WIDTH][4];
general_textured_spec_triangle1(ctx,v0,v1,v2,zspan,fogspan,rgba,spec);
}
@@
-2201,7
+2198,6
@@
static void occlusion_zless_triangle( GLcontext *ctx,
#define DO_OCCLUSION_TEST
#define INTERP_Z 1
#define DO_OCCLUSION_TEST
#define INTERP_Z 1
-#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
@@
-2209,7
+2205,6
@@
static void occlusion_zless_triangle( GLcontext *ctx,
const GLint len = RIGHT-LEFT; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
const GLint len = RIGHT-LEFT; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
- (void) fffog; \
if (z < zRow[i]) { \
ctx->OcclusionResult = GL_TRUE; \
return; \
if (z < zRow[i]) { \
ctx->OcclusionResult = GL_TRUE; \
return; \
diff --git
a/src/mesa/swrast/s_tritemp.h
b/src/mesa/swrast/s_tritemp.h
index 062795debb2b8c857539053a4b49125fa0a2c70a..3bdb1537a0102f1b457ac997913b389f24655786 100644
(file)
--- a/
src/mesa/swrast/s_tritemp.h
+++ b/
src/mesa/swrast/s_tritemp.h
@@
-1,4
+1,4
@@
-/* $Id: s_tritemp.h,v 1.1
4 2001/03/12 00:48:42 gareth
Exp $ */
+/* $Id: s_tritemp.h,v 1.1
5 2001/05/03 22:13:32 brianp
Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-256,7
+256,7
@@
GLfloat dzdx, dzdy; GLfixed fdzdx;
#endif
#ifdef INTERP_FOG
GLfloat dzdx, dzdy; GLfixed fdzdx;
#endif
#ifdef INTERP_FOG
- GLfloat dfogdx, dfogdy;
GLfixed fdfogdx;
+ GLfloat dfogdx, dfogdy;
#endif
#ifdef INTERP_RGB
GLfloat drdx, drdy; GLfixed fdrdx;
#endif
#ifdef INTERP_RGB
GLfloat drdx, drdy; GLfixed fdrdx;
@@
-338,11
+338,9
@@
#endif
#ifdef INTERP_FOG
{
#endif
#ifdef INTERP_FOG
{
- GLfloat eMaj_dfog, eBot_dfog;
- eMaj_dfog = (vMax->fog - vMin->fog) * 256;
- eBot_dfog = (vMid->fog - vMin->fog) * 256;
+ const GLfloat eMaj_dfog = vMax->fog - vMin->fog;
+ const GLfloat eBot_dfog = vMid->fog - vMin->fog;
dfogdx = oneOverArea * (eMaj_dfog * eBot.dy - eMaj.dy * eBot_dfog);
dfogdx = oneOverArea * (eMaj_dfog * eBot.dy - eMaj.dy * eBot_dfog);
- fdfogdx = SignedFloatToFixed(dfogdx);
dfogdy = oneOverArea * (eMaj.dx * eBot_dfog - eMaj_dfog * eBot.dx);
}
#endif
dfogdy = oneOverArea * (eMaj.dx * eBot_dfog - eMaj_dfog * eBot.dx);
}
#endif
@@
-566,53
+564,54
@@
{
int subTriangle;
{
int subTriangle;
- GLfixed fx, fxLeftEdge, fxRightEdge, fdxLeftEdge, fdxRightEdge;
+ GLfixed fx;
+ GLfixed fxLeftEdge=0, fxRightEdge=0, fdxLeftEdge=0, fdxRightEdge=0;
GLfixed fdxOuter;
int idxOuter;
float dxOuter;
GLfixed fdxOuter;
int idxOuter;
float dxOuter;
- GLfixed fError
, fdError
;
+ GLfixed fError
=0, fdError=0
;
float adjx, adjy;
GLfixed fy;
float adjx, adjy;
GLfixed fy;
- int iy;
+ int iy
=0
;
#ifdef PIXEL_ADDRESS
#ifdef PIXEL_ADDRESS
- PIXEL_TYPE *pRow;
- int dPRowOuter
, dPRowInner
; /* offset in bytes */
+ PIXEL_TYPE *pRow
=NULL
;
+ int dPRowOuter
=0, dPRowInner=0
; /* offset in bytes */
#endif
#ifdef INTERP_Z
# ifdef DEPTH_TYPE
#endif
#ifdef INTERP_Z
# ifdef DEPTH_TYPE
- DEPTH_TYPE *zRow;
- int dZRowOuter
, dZRowInner
; /* offset in bytes */
+ DEPTH_TYPE *zRow
=NULL
;
+ int dZRowOuter
=0, dZRowInner=0
; /* offset in bytes */
# endif
# endif
- GLfixed fz
, fdzOuter
, fdzInner;
+ GLfixed fz
=0, fdzOuter=0
, fdzInner;
#endif
#ifdef INTERP_FOG
#endif
#ifdef INTERP_FOG
- GLf
ixed ffog, fdfogOuter, f
dfogInner;
+ GLf
loat fogLeft, dfogOuter,
dfogInner;
#endif
#ifdef INTERP_RGB
#endif
#ifdef INTERP_RGB
- GLfixed fr
, fdrOuter
, fdrInner;
- GLfixed fg
, fdgOuter
, fdgInner;
- GLfixed fb
, fdbOuter
, fdbInner;
+ GLfixed fr
=0, fdrOuter=0
, fdrInner;
+ GLfixed fg
=0, fdgOuter=0
, fdgInner;
+ GLfixed fb
=0, fdbOuter=0
, fdbInner;
#endif
#ifdef INTERP_SPEC
#endif
#ifdef INTERP_SPEC
- GLfixed fsr
, fdsrOuter
, fdsrInner;
- GLfixed fsg
, fdsgOuter
, fdsgInner;
- GLfixed fsb
, fdsbOuter
, fdsbInner;
+ GLfixed fsr
=0, fdsrOuter=0
, fdsrInner;
+ GLfixed fsg
=0, fdsgOuter=0
, fdsgInner;
+ GLfixed fsb
=0, fdsbOuter=0
, fdsbInner;
#endif
#ifdef INTERP_ALPHA
#endif
#ifdef INTERP_ALPHA
- GLfixed fa
, fdaOuter
, fdaInner;
+ GLfixed fa
=0, fdaOuter=0
, fdaInner;
#endif
#ifdef INTERP_INDEX
#endif
#ifdef INTERP_INDEX
- GLfixed fi
, fdiOuter
, fdiInner;
+ GLfixed fi
=0, fdiOuter=0
, fdiInner;
#endif
#ifdef INTERP_INT_TEX
#endif
#ifdef INTERP_INT_TEX
- GLfixed fs
, fdsOuter
, fdsInner;
- GLfixed ft
, fdtOuter
, fdtInner;
+ GLfixed fs
=0, fdsOuter=0
, fdsInner;
+ GLfixed ft
=0, fdtOuter=0
, fdtInner;
#endif
#ifdef INTERP_TEX
#endif
#ifdef INTERP_TEX
- GLfloat sLeft
, dsOuter
, dsInner;
- GLfloat tLeft
, dtOuter
, dtInner;
- GLfloat uLeft
, duOuter
, duInner;
- GLfloat vLeft
, dvOuter
, dvInner;
+ GLfloat sLeft
=0, dsOuter=0
, dsInner;
+ GLfloat tLeft
=0, dtOuter=0
, dtInner;
+ GLfloat uLeft
=0, duOuter=0
, duInner;
+ GLfloat vLeft
=0, dvOuter=0
, dvInner;
#endif
#ifdef INTERP_MULTITEX
GLfloat sLeft[MAX_TEXTURE_UNITS];
#endif
#ifdef INTERP_MULTITEX
GLfloat sLeft[MAX_TEXTURE_UNITS];
@@
-733,9
+732,9
@@
}
#endif
#ifdef INTERP_FOG
}
#endif
#ifdef INTERP_FOG
- f
fog = FloatToFixed(vLower->fog * 256 + dfogdx * adjx
-
+ dfogdy * adjy) + FIXED_HALF
;
-
fdfogOuter = SignedFloatToFixed(dfogdy + dxOuter * dfogdx)
;
+ f
ogLeft = vLower->fog + (dfogdx * adjx + dfogdy * adjy)
+
* (1.0F/FIXED_SCALE)
;
+
dfogOuter = dfogdy + dxOuter * dfogdx
;
#endif
#ifdef INTERP_RGB
fr = (GLfixed)(IntToFixed(vLower->color[0])
#endif
#ifdef INTERP_RGB
fr = (GLfixed)(IntToFixed(vLower->color[0])
@@
-851,7
+850,7
@@
fdzInner = fdzOuter + fdzdx;
#endif
#ifdef INTERP_FOG
fdzInner = fdzOuter + fdzdx;
#endif
#ifdef INTERP_FOG
-
fdfogInner = fdfogOuter + f
dfogdx;
+
dfogInner = dfogOuter +
dfogdx;
#endif
#ifdef INTERP_RGB
fdrInner = fdrOuter + fdrdx;
#endif
#ifdef INTERP_RGB
fdrInner = fdrOuter + fdrdx;
@@
-902,7
+901,7
@@
GLfixed ffz = fz;
#endif
#ifdef INTERP_FOG
GLfixed ffz = fz;
#endif
#ifdef INTERP_FOG
- GLf
ixed fffog = ffog
;
+ GLf
loat ffog = fogLeft
;
#endif
#ifdef INTERP_RGB
GLfixed ffr = fr, ffg = fg, ffb = fb;
#endif
#ifdef INTERP_RGB
GLfixed ffr = fr, ffg = fg, ffb = fb;
@@
-1064,7
+1063,7
@@
fz += fdzOuter;
#endif
#ifdef INTERP_FOG
fz += fdzOuter;
#endif
#ifdef INTERP_FOG
- f
fog += f
dfogOuter;
+ f
ogLeft +=
dfogOuter;
#endif
#ifdef INTERP_RGB
fr += fdrOuter; fg += fdgOuter; fb += fdbOuter;
#endif
#ifdef INTERP_RGB
fr += fdrOuter; fg += fdgOuter; fb += fdbOuter;
@@
-1112,7
+1111,7
@@
fz += fdzInner;
#endif
#ifdef INTERP_FOG
fz += fdzInner;
#endif
#ifdef INTERP_FOG
- f
fog += f
dfogInner;
+ f
ogLeft +=
dfogInner;
#endif
#ifdef INTERP_RGB
fr += fdrInner; fg += fdgInner; fb += fdbInner;
#endif
#ifdef INTERP_RGB
fr += fdrInner; fg += fdgInner; fb += fdbInner;
diff --git
a/src/mesa/swrast/s_zoom.c
b/src/mesa/swrast/s_zoom.c
index daace6920fd2fdca36135cf4e1a877cc6cff44ee..74053d0a5b29a1c8804c876fe5281930d97e2449 100644
(file)
--- a/
src/mesa/swrast/s_zoom.c
+++ b/
src/mesa/swrast/s_zoom.c
@@
-1,4
+1,4
@@
-/* $Id: s_zoom.c,v 1.
4 2001/03/12 00:48:42 gareth
Exp $ */
+/* $Id: s_zoom.c,v 1.
5 2001/05/03 22:13:32 brianp
Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-46,7
+46,7
@@
void
_mesa_write_zoomed_rgba_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
void
_mesa_write_zoomed_rgba_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLf
ixed
*fog,
+ const GLf
loat
*fog,
CONST GLchan rgba[][4], GLint y0 )
{
GLint m;
CONST GLchan rgba[][4], GLint y0 )
{
GLint m;
@@
-54,7
+54,7
@@
_mesa_write_zoomed_rgba_span( GLcontext *ctx,
GLint i, j, skipcol;
GLchan zrgba[MAX_WIDTH][4]; /* zoomed pixel colors */
GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
GLint i, j, skipcol;
GLchan zrgba[MAX_WIDTH][4]; /* zoomed pixel colors */
GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
- GLf
ixed
zfog[MAX_WIDTH]; /* zoomed fog values */
+ GLf
loat
zfog[MAX_WIDTH]; /* zoomed fog values */
GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
const GLuint *srcRGBA32 = (const GLuint *) rgba;
GLuint *dstRGBA32 = (GLuint *) zrgba;
GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
const GLuint *srcRGBA32 = (const GLuint *) rgba;
GLuint *dstRGBA32 = (GLuint *) zrgba;
@@
-153,7
+153,7
@@
_mesa_write_zoomed_rgba_span( GLcontext *ctx,
void
_mesa_write_zoomed_rgb_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
void
_mesa_write_zoomed_rgb_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLf
ixed
*fog,
+ const GLf
loat
*fog,
CONST GLchan rgb[][3], GLint y0 )
{
GLint m;
CONST GLchan rgb[][3], GLint y0 )
{
GLint m;
@@
-161,7
+161,7
@@
_mesa_write_zoomed_rgb_span( GLcontext *ctx,
GLint i, j, skipcol;
GLchan zrgba[MAX_WIDTH][4]; /* zoomed pixel colors */
GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
GLint i, j, skipcol;
GLchan zrgba[MAX_WIDTH][4]; /* zoomed pixel colors */
GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
- GLf
ixed
zfog[MAX_WIDTH]; /* zoomed fog values */
+ GLf
loat
zfog[MAX_WIDTH]; /* zoomed fog values */
GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
/* compute width of output row */
GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
/* compute width of output row */
@@
-266,7
+266,7
@@
_mesa_write_zoomed_rgb_span( GLcontext *ctx,
void
_mesa_write_zoomed_index_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
void
_mesa_write_zoomed_index_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLf
ixed
*fog,
+ const GLf
loat
*fog,
const GLuint indexes[], GLint y0 )
{
GLint m;
const GLuint indexes[], GLint y0 )
{
GLint m;
@@
-274,7
+274,7
@@
_mesa_write_zoomed_index_span( GLcontext *ctx,
GLint i, j, skipcol;
GLuint zindexes[MAX_WIDTH]; /* zoomed color indexes */
GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
GLint i, j, skipcol;
GLuint zindexes[MAX_WIDTH]; /* zoomed color indexes */
GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
- GLf
ixed
zfog[MAX_WIDTH]; /* zoomed fog values */
+ GLf
loat
zfog[MAX_WIDTH]; /* zoomed fog values */
GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
/* compute width of output row */
GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
/* compute width of output row */
diff --git
a/src/mesa/swrast/s_zoom.h
b/src/mesa/swrast/s_zoom.h
index 170133c3dffddd608432ce0c879f9dae5de46f30..940970d7abf6bef646f1c2cfc18d44b3e7683a5c 100644
(file)
--- a/
src/mesa/swrast/s_zoom.h
+++ b/
src/mesa/swrast/s_zoom.h
@@
-1,4
+1,4
@@
-/* $Id: s_zoom.h,v 1.
4 2001/03/12 00:48:42 gareth
Exp $ */
+/* $Id: s_zoom.h,v 1.
5 2001/05/03 22:13:32 brianp
Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-35,21
+35,21
@@
extern void
_mesa_write_zoomed_rgba_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
extern void
_mesa_write_zoomed_rgba_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLf
ixed
*fog,
+ const GLf
loat
*fog,
CONST GLchan rgba[][4], GLint y0 );
extern void
_mesa_write_zoomed_rgb_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
CONST GLchan rgba[][4], GLint y0 );
extern void
_mesa_write_zoomed_rgb_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLf
ixed
*fog,
+ const GLf
loat
*fog,
CONST GLchan rgb[][3], GLint y0 );
extern void
_mesa_write_zoomed_index_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
CONST GLchan rgb[][3], GLint y0 );
extern void
_mesa_write_zoomed_index_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, const GLdepth z[],
- const GLf
ixed
*fog,
+ const GLf
loat
*fog,
const GLuint indexes[], GLint y0 );
const GLuint indexes[], GLint y0 );