mesa: added _mesa_scale_and_bias_depth_uint()
This commit is contained in:
parent
1cff4992b3
commit
5fb774ab31
|
@ -1341,6 +1341,21 @@ _mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n,
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_scale_and_bias_depth_uint(const GLcontext *ctx, GLuint n,
|
||||
GLuint depthValues[])
|
||||
{
|
||||
const GLdouble max = (double) 0xffffffff;
|
||||
const GLdouble scale = ctx->Pixel.DepthScale;
|
||||
const GLdouble bias = ctx->Pixel.DepthBias * max;
|
||||
GLuint i;
|
||||
for (i = 0; i < n; i++) {
|
||||
GLdouble d = (GLdouble) depthValues[i] * scale + bias;
|
||||
d = CLAMP(d, 0.0, max);
|
||||
depthValues[i] = (GLuint) d;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/***** State Management *****/
|
||||
|
|
|
@ -116,6 +116,9 @@ extern void
|
|||
_mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n,
|
||||
GLfloat depthValues[]);
|
||||
|
||||
extern void
|
||||
_mesa_scale_and_bias_depth_uint(const GLcontext *ctx, GLuint n,
|
||||
GLuint depthValues[]);
|
||||
|
||||
extern void
|
||||
_mesa_update_pixel( GLcontext *ctx, GLuint newstate );
|
||||
|
|
Loading…
Reference in New Issue