mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
fix precision problem in depth clearing (bug 4395)
This commit is contained in:
parent
3f27b6ffeb
commit
5eb129de76
1 changed files with 10 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.3
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||
*
|
||||
|
|
@ -1273,13 +1273,11 @@ _swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb,
|
|||
|
||||
/**
|
||||
* Clear the depth buffer.
|
||||
* XXX this is no longer a swrast function!!!
|
||||
*/
|
||||
void
|
||||
_swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
|
||||
{
|
||||
const GLuint clearValue
|
||||
= (GLuint) (ctx->Depth.Clear * ctx->DrawBuffer->_DepthMaxF);
|
||||
GLuint clearValue;
|
||||
GLint x, y, width, height;
|
||||
|
||||
if (!rb || !ctx->Depth.Mask) {
|
||||
|
|
@ -1287,6 +1285,14 @@ _swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
|
|||
return;
|
||||
}
|
||||
|
||||
/* compute integer clearing value */
|
||||
if (ctx->Depth.Clear == 1.0) {
|
||||
clearValue = ctx->DrawBuffer->_DepthMax;
|
||||
}
|
||||
else {
|
||||
clearValue = (GLuint) (ctx->Depth.Clear * ctx->DrawBuffer->_DepthMaxF);
|
||||
}
|
||||
|
||||
assert(rb->_BaseFormat == GL_DEPTH_COMPONENT);
|
||||
|
||||
/* compute region to clear */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue