summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-05-07 16:14:13 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-05-07 16:14:13 +0000
commitca8b2351884e602f32b3e7ad23cf4beeae1c01fc (patch)
treeec60a1f2a2f77d4c7ec8d2fb72f0f8c53dc9c4ef /src
parent8a1848bf9972f7a131a754f030ccf7c8945fba36 (diff)
minor clean-ups around DepthScale/Bias
Diffstat (limited to 'src')
-rw-r--r--src/mesa/swrast/s_drawpix.c4
-rw-r--r--src/mesa/swrast/s_readpix.c11
2 files changed, 7 insertions, 8 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index debfcde045..b2d6b1ef79 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -834,8 +834,8 @@ draw_depth_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
const GLvoid *pixels)
{
const GLint imgX = x, imgY = y;
- const GLboolean scaleOrBias =
- ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
+ const GLboolean scaleOrBias
+ = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
const GLfloat depthScale = ctx->DrawBuffer->_DepthMaxF;
const GLuint stencilMask = ctx->Stencil.WriteMask[0];
const GLuint stencilType = (STENCIL_BITS == 8) ?
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 3fdd4c727a..be6c2649d6 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -88,7 +88,8 @@ read_depth_pixels( GLcontext *ctx,
{
struct gl_framebuffer *fb = ctx->ReadBuffer;
struct gl_renderbuffer *rb = fb->_DepthBuffer;
- GLboolean bias_or_scale;
+ const GLboolean biasOrScale
+ = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
/* clipping should have been done already */
ASSERT(x >= 0);
@@ -100,10 +101,8 @@ read_depth_pixels( GLcontext *ctx,
ASSERT(rb);
- bias_or_scale = ctx->Pixel.DepthBias != 0.0 || ctx->Pixel.DepthScale != 1.0;
-
if (type == GL_UNSIGNED_SHORT && fb->Visual.depthBits == 16
- && !bias_or_scale && !packing->SwapBytes) {
+ && !biasOrScale && !packing->SwapBytes) {
/* Special case: directly read 16-bit unsigned depth values. */
GLint j;
ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT16);
@@ -115,7 +114,7 @@ read_depth_pixels( GLcontext *ctx,
}
}
else if (type == GL_UNSIGNED_INT && fb->Visual.depthBits == 24
- && !bias_or_scale && !packing->SwapBytes) {
+ && !biasOrScale && !packing->SwapBytes) {
/* Special case: directly read 24-bit unsigned depth values. */
GLint j;
ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT32);
@@ -133,7 +132,7 @@ read_depth_pixels( GLcontext *ctx,
}
}
else if (type == GL_UNSIGNED_INT && fb->Visual.depthBits == 32
- && !bias_or_scale && !packing->SwapBytes) {
+ && !biasOrScale && !packing->SwapBytes) {
/* Special case: directly read 32-bit unsigned depth values. */
GLint j;
ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT32);