#endif
-/**
- * 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.
*/
/*
* 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"),
* 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);
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];
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];
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));
/* 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 */
_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;
{
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) {
/*
* 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"),
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 );
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 );
/* 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);
}
}
}
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;
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;
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; \
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++; \
} \
-
/*
* 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"),
}
}
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 */