mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
mesa: make sure the gotten value isn't greater than the
max depth buffer value on 64bit system. fix bug #12095
This commit is contained in:
parent
44f032db61
commit
2a86a449ca
1 changed files with 5 additions and 2 deletions
|
|
@ -61,8 +61,11 @@ _swrast_span_default_z( GLcontext *ctx, SWspan *span )
|
|||
const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF;
|
||||
if (ctx->DrawBuffer->Visual.depthBits <= 16)
|
||||
span->z = FloatToFixed(ctx->Current.RasterPos[2] * depthMax + 0.5F);
|
||||
else
|
||||
span->z = (GLint) (ctx->Current.RasterPos[2] * depthMax + 0.5F);
|
||||
else {
|
||||
GLfloat tmpf = ctx->Current.RasterPos[2] * depthMax;
|
||||
tmpf = MIN2(tmpf, depthMax);
|
||||
span->z = (GLint) tmpf;
|
||||
}
|
||||
span->zStep = 0;
|
||||
span->interpMask |= SPAN_Z;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue