mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
replace GLdepth with GLuint and remove GLdepth
This commit is contained in:
parent
4092fbd55a
commit
3e37bafab0
10 changed files with 24 additions and 41 deletions
|
|
@ -84,15 +84,6 @@
|
|||
#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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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++; \
|
||||
} \
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue