diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-09-21 02:47:32 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-09-21 02:47:32 +0000 |
commit | 3e37bafab0a339021354b9c78f983d05d433d735 (patch) | |
tree | 624d1c39e30f8a74bf0860f9389cd772f9dfe0f5 /src/mesa | |
parent | 4092fbd55ac92a59d09d5167ced328683bed049c (diff) |
replace GLdepth with GLuint and remove GLdepth
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/mtypes.h | 9 | ||||
-rw-r--r-- | src/mesa/swrast/s_aalinetemp.h | 6 | ||||
-rw-r--r-- | src/mesa/swrast/s_context.h | 4 | ||||
-rw-r--r-- | src/mesa/swrast/s_copypix.c | 4 | ||||
-rw-r--r-- | src/mesa/swrast/s_drawpix.c | 4 | ||||
-rw-r--r-- | src/mesa/swrast/s_linetemp.h | 8 | ||||
-rw-r--r-- | src/mesa/swrast/s_readpix.c | 15 | ||||
-rw-r--r-- | src/mesa/swrast/s_span.c | 4 | ||||
-rw-r--r-- | src/mesa/swrast/s_triangle.c | 4 | ||||
-rw-r--r-- | src/mesa/swrast/s_zoom.c | 7 |
10 files changed, 24 insertions, 41 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 85b15b8399..a076f82a22 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -85,15 +85,6 @@ /** - * Used for storing intermediate depth buffer values. - * The actual depth/Z buffer might use 16 or 32-bit values. - * - * \note Must be 32-bits! - */ -typedef GLuint GLdepth; - - -/** * Fixed point data type. */ typedef int GLfixed; diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index 4a1e1ebda2..34c95fc34e 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -58,7 +58,7 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy) * solving the plane equations at (ix,iy). */ #ifdef DO_Z - line->span.array->z[i] = (GLdepth) IROUND(solve_plane(fx, fy, line->zPlane)); + line->span.array->z[i] = (GLuint) solve_plane(fx, fy, line->zPlane); #endif #ifdef DO_FOG line->span.array->fog[i] = solve_plane(fx, fy, line->fPlane); diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 79250b315b..9deaa6d42d 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -85,7 +85,7 @@ struct span_arrays { GLchan spec[MAX_WIDTH][4]; /* specular color */ GLint x[MAX_WIDTH]; /**< X/Y used for point/line rendering only */ GLint y[MAX_WIDTH]; /**< X/Y used for point/line rendering only */ - GLdepth z[MAX_WIDTH]; + GLuint z[MAX_WIDTH]; GLfloat fog[MAX_WIDTH]; GLfloat texcoords[MAX_TEXTURE_COORD_UNITS][MAX_WIDTH][4]; GLfloat lambda[MAX_TEXTURE_COORD_UNITS][MAX_WIDTH]; @@ -161,7 +161,7 @@ struct sw_span { GLfixed specBlue, specBlueStep; #endif GLfixed index, indexStep; - GLfixed z, zStep; + GLfixed z, zStep; /* XXX z should probably be GLuint */ GLfloat fog, fogStep; GLfloat tex[MAX_TEXTURE_COORD_UNITS][4]; /* s, t, r, q */ GLfloat texStepX[MAX_TEXTURE_COORD_UNITS][4]; diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 75d2defa21..caf68ecd9d 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -569,7 +569,6 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, for (j = 0; j < height; j++, sy += stepy, dy += stepy) { GLfloat depth[MAX_WIDTH]; - float sum = 0; /* get depth values */ if (overlapping) { MEMCPY(depth, p, width * sizeof(GLfloat)); @@ -582,8 +581,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, /* apply scale and bias */ for (i = 0; i < width; i++) { GLfloat d = depth[i] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias; - sum += d; - span.array->z[i] = (GLdepth) (CLAMP(d, 0.0F, 1.0F) * depthMax); + span.array->z[i] = (GLuint) (CLAMP(d, 0.0F, 1.0F) * depthMax); } /* write depth values */ diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index db3232b04f..5f4ea7f8ba 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -643,7 +643,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, _mesa_image_address2d(unpack, pixels, width, height, GL_DEPTH_COMPONENT, type, row, 0); if (shift == 0) { - MEMCPY(span.array->z, zSrc, width * sizeof(GLdepth)); + MEMCPY(span.array->z, zSrc, width * sizeof(GLuint)); } else { GLint col; @@ -688,7 +688,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, { GLuint i; for (i = 0; i < span.end; i++) { - span.array->z[i] = (GLdepth) (floatSpan[i] * depthMax); + span.array->z[i] = (GLuint) (floatSpan[i] * depthMax); } } if (zoom) { diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index af7aeabf62..f7c5ab4923 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -354,7 +354,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) for (i = 0; i < dx; i++) { #ifdef DEPTH_TYPE - GLdepth Z = FixedToDepth(span.z); + GLuint Z = FixedToDepth(span.z); #endif #ifdef PLOT PLOT( x0, y0 ); @@ -394,7 +394,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) for (i=0;i<dy;i++) { #ifdef DEPTH_TYPE - GLdepth Z = FixedToDepth(span.z); + GLuint Z = FixedToDepth(span.z); #endif #ifdef PLOT PLOT( x0, y0 ); diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 07e24d6cae..ab83a2995a 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -169,16 +169,11 @@ read_depth_pixels( GLcontext *ctx, /* General case (slower) */ GLint j; for (j = 0; j < height; j++, y++) { - GLfloat depth[MAX_WIDTH]; - GLvoid *dest; - - _swrast_read_depth_span_float(ctx, rb, width, x, y, depth); - - dest = _mesa_image_address2d(packing, pixels, width, height, - GL_DEPTH_COMPONENT, type, j, 0); - - _mesa_pack_depth_span(ctx, width, (GLdepth *) dest, type, - depth, packing); + GLfloat depthValues[MAX_WIDTH]; + GLvoid *dest = _mesa_image_address2d(packing, pixels, width, height, + GL_DEPTH_COMPONENT, type, j, 0); + _swrast_read_depth_span_float(ctx, rb, width, x, y, depthValues); + _mesa_pack_depth_span(ctx, width, dest, type, depthValues, packing); } } } diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 50463f4c61..38a7f95f27 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -313,7 +313,7 @@ _swrast_span_interpolate_z( const GLcontext *ctx, struct sw_span *span ) if (ctx->Visual.depthBits <= 16) { GLfixed zval = span->z; - GLdepth *z = span->array->z; + GLuint *z = span->array->z; for (i = 0; i < n; i++) { z[i] = FixedToInt(zval); zval += span->zStep; @@ -322,7 +322,7 @@ _swrast_span_interpolate_z( const GLcontext *ctx, struct sw_span *span ) else { /* Deep Z buffer, no fixed->int shift */ GLuint zval = span->z; - GLdepth *z = span->array->z; + GLuint *z = span->array->z; for (i = 0; i < n; i++) { z[i] = zval; zval += span->zStep; diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 08796471c5..6ed405f053 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -218,7 +218,7 @@ _swrast_culltriangle( GLcontext *ctx, span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \ span.intTex[1] -= FIXED_HALF; \ for (i = 0; i < span.end; i++) { \ - const GLdepth z = FixedToDepth(span.z); \ + const GLuint z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ GLint s = FixedToInt(span.intTex[0]) & smask; \ GLint t = FixedToInt(span.intTex[1]) & tmask; \ @@ -920,7 +920,7 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, const GLushort *zRow = (const GLushort *) \ rb->GetPointer(ctx, rb, span.x, span.y); \ for (i = 0; i < span.end; i++) { \ - GLdepth z = FixedToDepth(span.z); \ + GLuint z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ q->Result++; \ } \ diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index b67a297010..580e25e945 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.5 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -232,7 +231,7 @@ zoom_span( GLcontext *ctx, const struct sw_span *span, } } else { - const GLdepth *zValues = (const GLuint *) src; + const GLuint *zValues = (const GLuint *) src; assert(format == GL_DEPTH_COMPONENT); if (ctx->Pixel.ZoomX == -1.0F) { /* common case */ |