From: Brian Paul Date: Wed, 28 Sep 2005 02:27:22 +0000 (+0000) Subject: added _mesa_scale_and_bias_depth() X-Git-Tag: 062012170305~21950 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac3ec5096a760daabb1f2be7400bd9723e5058a5;p=profile%2Fivi%2Fmesa.git added _mesa_scale_and_bias_depth() --- diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index e8912c7..1f7bfc8 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -1838,6 +1838,19 @@ _mesa_map_stencil( const GLcontext *ctx, GLuint n, GLstencil stencil[] ) } +void +_mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n, + GLfloat depthValues[]) +{ + const GLfloat scale = ctx->Pixel.DepthScale; + const GLfloat bias = ctx->Pixel.DepthBias; + GLuint i; + for (i = 0; i < n; i++) { + GLfloat d = depthValues[i] * scale + bias; + depthValues[i] = CLAMP(d, 0.0F, 1.0F); + } +} + /* * This function converts an array of GLchan colors to GLfloat colors. diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h index 9eef0cf..1619900 100644 --- a/src/mesa/main/pixel.h +++ b/src/mesa/main/pixel.h @@ -5,9 +5,9 @@ /* * 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"), @@ -138,6 +138,11 @@ _mesa_map_stencil(const GLcontext *ctx, GLuint n, GLstencil index[]); extern void +_mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n, + GLfloat depthValues[]); + + +extern void _mesa_chan_to_float_span(const GLcontext *ctx, GLuint n, CONST GLchan rgba[][4], GLfloat rgbaf[][4]);